- Install mongodb
- Install nodejs
-
Create a
.env
file in the root directory and copy the content from.env.example
-
Make sure mongodb is running
-
Install dependencies:
yarn
-
Use this command for development mode:
yarn run watch
-
If you need to customize your env, take a look at
secrets.ts
file
Below are the steps that you need to finish in order to finish this module
- Explore the code base, start with
server.ts
- Create all the mongoose schema for your ERD
- Create CRUD endpoints for all the schema
- Separate the routers and controller, controller goes into the controller folders. Controllers only handles request and response
- Create more controller for your app if needed. Eg: borrow books, add product to order
- For business logic like saving data to database, filtering, searching or updating, these are services and goes into services folder
- Add authentication middleware using passport, google and jwt strategy
- Add tests for your controllers and services. Remember to create the jwt token for your tests, because if your controller is protected, then the test should send the token also
- Create a client folder in the project root, you will set up your react frontend in here. If there's a problem running the react app after install, try creating a
.env
file insideclient
folder. And put this line in there:SKIP_PREFLIGHT_CHECK=true