As soon as you bootstrap a new project, you will have an application running with:
- Node.js backend
- React.js frontend
Under the hood it uses Webpack, Babel, ESLint and StyleLint with a few other plugins enabling a powerful development workflow, such as server live reload with nodemon and more. All preconfigured out of the box, so that you can focus on the important stuff!
💡 To get up and running with your first Crana app, fist install Crana globally:
npm i -g crana
Initialize your app
crana init <projectName> [projectFolder]
...and you are ready to go!
💻 Now start developing!
crana dev
This will fire up the frontend and the backend concurrently in development mode.. Just edit files under src and see what happens!
Command | Description |
---|---|
crana -V | Outputs crana's version |
crana -h | Show available commands |
Command | Description |
---|---|
⭐ crana init [projectFolderName] | Create a new crana project |
💫 crana dev | Concurrently starts the frontend and the backend in development mode |
📡 crana dev:client | Starts the webpack development server for the frontend |
📊 crana dev:server | Starts the node.js backend in development mode with live-reload |
🚙 crana build:client | Creates a production build for the frontend application |
Command | Description |
---|---|
🔍 crana lint:client | Executes eslint and styleling in autofix mode for your client files (src/client + src/shared) |
🔍 crana lint:server | Executes eslint in autofix mode for your server files (src/server + src/shared) |
📚 crana count-lines | See how many LOC you've already written |
The interesting files for you are all located in the src folder. The src folder has three subfolders:
- client
- server
- shared
As you can imagine, the client folder contains all files for React and the server folder contains all files for Node.js backend. The shared folder contains code you would like to share between client and server. This is a good place for e.g. utility functions, domain logic etc.
NOTE:Be aware that the server files are not transpiled and thus don't support certain features like ES6 imports. This also the reason why all code in the shared folder must be executable with your current node.js version.
If you're using Windows Linux Subsystem, eslint will not immediatly work. You need to edit the path under .vscode/settings.json
.
Replace C:/mnt/c
with C:
and it should work.
Pull requests are always welcome. Please have a look at CONTRIBUTING.md and open an issue before submitting a pull request.
This project is licensed under the MIT License - see the LICENSE.md file for details.
Have a look at CODE_OF_CONDUCT.md