This project is my attempt at using Node.js and Express to consume data from a Wordpress database using GraphQL and Relay and React and...other stuff.
It's built using Webpack, and requires Node V 5.0.0. You might be able to get away with 4.0, but really just tighten up and use 5.0.
You should also read about why I am doing this.
Inspired by this project and the evolving of react-transform and CSS Modules, this project has gotten a major upgrade.
Just run npm install
and then npm start
You'll notice a settings folder, which contains JSON files for development and production. This is where your wordpress database settings, as well as a wordpress table prefix, and uploads directory. Change accordingly.
The project runs with React by default and hot replacement of changes to the modules.
SASS files loaded into components are locally scoped and you can point to class names with javascript. You can also compose classes together, also from other files. These are also hot loaded. Read more about them here.
Both Node server and frontend code runs with Babel. And all of it is linted. With atom you install the linter
package, then linter-eslint
and linter-jscs
. You are covered. Also run npm run eslint
or npm run jscs
to verify all files. I would recommend installing language-babel
package too for syntax highlighting
With a beautify package installed in your editor it will also do that