Build with NestJS framework
See application structure on the image below:
This is the Backend application.
For Frontend application, please go to https://github.com/leogomesdev/circuit-on-frontend
This project provides APIs for the frontend application.
Not sure about how a REST API works? See on the image below:
- NestJS, a Typescript framework for Node.js
- MongoDB as database
- MongoDB Node Driver for database connection
- OKTA for Authentication
- REST API
- Jest for unit tests
- Commitizen command line tool
- Conventional Commits specification
This project uses ESLint packages to ensure code inspection and formatting. If you change the code, make sure to run the command below for code inspection:
npm run lint
You must create an OKTA Application (for Authentication). Follow this doc for instructions, to get your Client Id and Domain/Issuer
- Node.js (v16 or v18)
- npm
- MongoDB database. Highly recommended to Deploy a Free Cluster at MongoDB Atlas
-
Be sure to install the requirements
- If you have nvm - Node Version Manager installed, you could just run
nvm install
and it will install the correct version of Node.js based on file.nvmrc
- If you have nvm - Node Version Manager installed, you could just run
-
Create .env file:
cp -v .env.example .env
-
Edit .env file to provide the required environment variables.
-
Install dependencies:
npm install
-
Start the application:
# development npm run start # watch mode npm run start:dev
Follow this doc for instructions
# unit tests
npm run test
# test coverage
npm run test:cov
Please create indexes for supporting your application complex aggregation pipelines. Follow this doc for instructions
Consult the API documentation available at Swagger http://localhost:3000/api
To generate and download a Swagger JSON file, navigate to http://localhost:3000/api-json
- Open Postman and make API calls. Follow this doc for instructions