-
You need to install docker on your machine in order to easily create the postgresql database.
-
when you successfully install docker run:
docker-compose up -d
This will download the postgres image and start the database server on port 5432
-
Now you need to install the project's dependencies:
npm install #or yarn
-
Create a
.env
file and fill it accordingly:cp .env.example .env
-
Run the server for the first time to initialize the database:
npm run dev # or yarn dev
-
Run the database migrations to fill up the database with the initial data:
yarn migration:run # or npm run migration:run
-
You can run the development server by running this command:
npm run dev # or yarn dev
- Check the Documentation
- Has configuration files for various libraries and frameworks as well as general project configs objects
- Has methods that are invoked by the HTTP API calls
- Has middleware functions that will be invoked on the API endpoints (for example authentication middlewares)
- This folder is managed by Typeorm, we'll use it to store the migration scripts for the database.
- Has model definitions for the Typeorm entity classes (User, PrivateSchool, Course,...)
- This has definition and structure of the API's routes
- This has the abstract business logic code.
- This should never be dependant on external implementations (libraries, modules,...)
- Defines different schemas to validate the request inputs
- General utility functions used here and there by all the system.
- [Insomnia](Download - Insomnia) configuration to test the API's endpoints
- This project will strictly use a clean architecture.
- Well try to decouple the business logic from the database and the frameworks so that the backend system will be scalable and modular.
- The diagram below demonstrates the architecture: