The project involves creating a REST API for gym check-ins, applying SOLID and Design Patterns concepts. It uses technologies like Fastify, Prisma ORM, Vitest, and Docker. The goal is to practice creating APIs using these concepts and technologies, and also emphasize the importance of building a well-structured and easily maintainable application.
- Node.js
- TypeScript
- Fastify
- Prisma ORM
- Docker
- Vitest
- CI/CD
- Zod
- PostgreSQL
- SOLID
- E2E and Unit Tests
- TDD
- Design Patterns: Factory, Adapter, Repository
- InMemoryTestDatabase
- RBAC
- Refresh Token
- Clone this repository:
$ git clone https://github.com/luc-ribeiro/gympass-solid-node.git
- Install the dependencies:
# with npm
$ npm install
# with yarn
$ yarn install
-
Create a
.env
file following the structure of.env.example
-
It's important that the Database URL is the same as in the
docker-compose.yaml
file, or vice versa -
Run Docker Compose to start the container with the Database:
$ docker compose up
- Run the migrations:
# with npm
$ npx prisma db push
# with yarn
$ yarn prisma db push
- Run the project:
# with npm
$ npm run dev
# with yarn
$ yarn dev
-
The project will run on
localhost:3333
-
To visualize the Database:
# with npm
$ npx prisma studio
# with yarn
$ yarn prisma studio