Skip to content

CepedaBrayan/greenrun-test

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

🚀 Description

Greenrun-test is an API-RESTful developed in Nest v9.0.0, using a Node v16.13.1, with a microservices software model and following the SOLID and DRY principles, using Jest for unit testing and JWT for access auth.

Greenrun-test is deployed in Heroku both the backend and the database, that is a PostgreSQL database, which is connected with the backend through Prisma as ORM tool.

This App wass deployed automatically by CI/CD workflows (CI: GitHub Actions pipeline, CD: Heroku auto deployment), using the MASTER branch for it deploy, using too GitHub repo secrets.

URLS

# local
http://localhost:3000/api/

# deploy
http://localhost:3000/apidoc/

Installation

# install dependencies
$ npm install

# build the project
$ npm run build

Environment vars needed

# set environment variables
PORT
POSTGRESQL_DATABASE_URL
BCRYPT_SALT_ROUNDS
AUTH_CODE_CREATE_ADMIN = 945790 !also use it to test the register admin endpoint
JWT_SECRET_KEY

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

DOCUMENTATION

This application is documented using Swagger, you can also look de docs in both environments:

# local
http://localhost:3000/apidoc/

# deploy
https://greenrun-sports-backend.herokuapp.com/apidoc/

And also there is a Insomnia collection to test the API manually (there are both environments in itself: local and deploy, setup the vars before to test), that it's in

# collection file
root/Insomnia API/Insomnia_2022-08-09.json

Autor

Brayan Rivera Cepeda - Ssr. fullstack web developer

FRAMEWORK SOURCE: Stay in touch

License

Nest is MIT licensed.