Run following commands on CMD:
npm install
npm run install-client
- Replace the mongodbURL in
config/keys.js
file npm run dev
: This should run the client & server simultaneously
Make sure Step 1 has been performed.
npm run dev
: This should run the client & server simultaneously- Goto http://localhost:3000 open the browser console and you should see:
Successfully Connected to Backend...
This message means everything is working properly.
If running in production mode you will not see this.
For Heroku:
- Just init a git repository
- Create a project in Heroku
- Connect the project repo with heroku project
- Deploy the project
For Local Production / Other Sites Deployment
npm run build
: This will create a optimized build in client folder.npm run start
: for local testing or delploy to where ever you wish to deploy the app.
In the project directory, you can run:
-
This installs all the required packages for server side
-
This command installs all the required packages for client side.
-
This will only run the client.
-
This will only run the server in developement mode with the help of nodemon.
-
This will only run the server without nodemon
-
Runs the app in the development mode.
Server will run on http://localhost:5000
Open http://localhost:3000 to view client side in the browser.
It will run both React & NodeJS at the same time using a package called Concurrently.
-
This command is useful
only when the entire app is done
and you want to build the production version.Builds the app for production to the
build
folder Inside Client Folder. The build is minified and the filenames include the hashes. Your app is ready to be deployed!You can the goto Open http://localhost:5000 to view it in the browser.
Axios
express
mongoose
concurrently
Note : For any Queries you can contact me on twitter at
@sunilpoojari91
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify