-
Clone the repository:
$ git clone <repo-link>
-
Install all dependencies with the following command:
$ npm install
-
Make a
.envfile, if you need to, you can use.example.envas a base for your own. -
If you want, you can fill the database with test data by using the following command:
$ npm run seed
-
Start the project stack with:
$ npm start
client: Source folder for React, this part of the application handles all of the UI.controllers: Source folder for the controllers of our Mongoose models, controls CRUD operations.models: Source folder for all of our Mongoose models.routes: Source folder for all the API routes for our application.scripts: Source folder for admin related scripts.server.js: API server file.
This project is following the MERN stack:
- Mongo: Fast and easy NoSQL database.
- Express: Fast, unopinionated, minimalist web framework for Node.
- React: Javascript library for building user interfaces based on JSX.
- Node: Javascript runtime.
Due to the nature of create-react-app, we're using a proxy to
serve API requests from our Express server, this has some side effects:
- There are two different
node_modulesdirectories, one in therootfor the project, the other is nside theclientdirectory.- To install dependencies for the
SERVERrun yournpm installcommands in therootfolder. - To install dependencies for
REACTrun yournpm installcommands in theclientfolder.
- To install dependencies for the
-
Create a Heroku app for your app:
$ heroku create <NAME-OF-YOUR-APP>
-
Add the MongoLab Addon for your Heroku app:
$ heroku addons:create mongolab:sandbox
-
Add, commit and push your changes to heroku:
$ git add . $ git commit -m "heroku setup" $ git push heroku master