Build Status | Badge |
---|---|
Production | |
Master |
REST api for NavigoLearning. This project is built with Node.js, Express, and MariaDB.
Documentation for the api can be found here.
-
Clone the repo
git clone git@github.com:NavigoLearn/API.git
-
Install NPM packages
npm install
-
Create a MariaDB database
CREATE DATABASE navigo_learn; USE navigo_learn; CREATE USER 'navigo_learn'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON navigo_learn.* TO 'navigo_learn'@'localhost';
-
Rename the env.example folder to env and fill in the values for development.env
-
Run tests to make sure everything works
npm test
-
Run the server
npm run dev
The project is split into 4 main folders:
src
- Contains all the source code for the project.spec
- Contains all the unit-tests for the project.docs
- Contains all the documentation for the project.env
- Contains all the environment files for the project. (rename the env.example folder to env to use it)
The src
folder is split into multiple main folders:
constants
- Contains constants used in the project. (HTTP status codes, env variables, etc.)controllers
- Contains the controllers of the project.middleware
- Contains middleware used in the project. (session, etc.)models
- Contains the data models for the project. (Roadmap, User, etc.)routes
- Contains the routers pointing to controllers. (auth, users, etc.)sql
- Contains sql files used in the project. (create tables, metrics, etc.)utils
- Contains utility functions used in the project. (databaseDriver, etc.)validators
- Contains the validators used in the project. (user, roadmap, etc.)index.ts
- The entry point.server.ts
- The server.