OrangeJuice-Hackaton5-0-Squad-17 / back-end

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Nest framework TypeScript starter repository.

Installation

# install modules *Required
$ npm install

# run migrations *Required
$ npx prisma migrate deploy

# sync dataBase with Prisma ORM *Required
$ npx prisma db push

# run all seeds to have basic information at database To run some tests *Required
$ npx prisma db seed

Running the app

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Run Tests

# unit tests
$ npm run test

# test coverage
$ npm run test:cov

Swagger endpoint

# swagger
http://localhost:3333/api

Routes:

TestRoute

# GET http://localhost:3333/test (to check if backend is up and running!)
no body required

User

# POST http://localhost:3333/user (to create user)
body:{
  "name": "Marcos Mantovani", STRING;
  "email": "teste@teste.com", STRING;
  "password": "pass@sword123*" STRING;
}
# PATCH http://localhost:3333/user/:id (to update user info) access_token required
# header: Authorization: Bearer "access_token"
body:{
  "name": "New Name", STRING
  "email": "newemail@teste.com", STRING;
  "password": "new@pass123*" STRING;
}
# GET http://localhost:3333/user/:id (to get user account information) access_token required
# header: Authorization: Bearer "access_token"
no body required
# DELETE http://localhost:3333/user/:id (to delete user account) access_token required
# header: Authorization: Bearer "access_token"
no body required

Autentication

# POST http://localhost:3333/login (to validate email/password and get access_token)
body:{
  "email": "teste@teste.com", STRING;
  "password": "pass@sword123*" STRING;
}

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed. dev

About

License:GNU General Public License v3.0


Languages

Language:TypeScript 98.7%Language:JavaScript 1.3%