Tag this project with a star 🌟
Gen Api is a RestFul Api made using Node js, Express, Jest, Jwt, Swagger, Docker, and Prisma. The api aims to manage users and perform secure authentication.
- Automated tests with Jest
- User registration
- Documentation with Swagger
- User authentication with JWT
- User listing + Pagination
- User update
- User deletion
- Data validation with Yup
- Password encryption with Bcrypt
- Postgres database with Prisma + Docker
- Node Js (Runtime)
- Express (Framework)
- Prisma (ORM)
- Swagger (Documentation)
- Docker + Postgres (Database)
- Jest (Testing)
- JWT (Authentication)
- Bcrypt (Encryption)
- Yup (Data Validation)
The project was structured following some architecture patterns for better organization and scalability.
src/
├── docs/
├── middlewares/
├── routes/
├── repositorys/
├── validations/
├── test/
├── utils/
├── index.js
.env
.docker-compose.yml
.jest.config.js
swagger.js
server.js
Automated tests with Jest
Documentation with Swagger
Data validation with Yup
User registration
User authentication with JWT
User listing + Pagination
-
Clone the repository:
git clone https://github.com/luiisp/gen-api
-
Navigate to the project directory:
cd gen-api
-
Install dependencies:
yarn install
ornpm install
-
Create a .env file and add the environment variables according to the .env.example file
-
Start the database with Docker:
docker-compose up -d
-
Run the migrations:
yarn prisma
ornpx prisma
-
Start the server:
yarn dev
ornpm run dev
To run the tests, execute the command: yarn test
or npm run test
To access the api documentation, access the endpoint: /docs
To generate documentation automatically with Swagger, execute the command: yarn docs
or npm run docs