Skip to content

API for check-ins at gyms. Applying concepts of SOLID, Design Patterns, Docker, JWT and Refresh Token, RBAC and others.

Notifications You must be signed in to change notification settings

luc-ribeiro/gympass-solid-node

Repository files navigation

GymPass API SOLID Node.js

Clique aqui para ver a versão em Português.

💻 Project

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.

🚀 Technologies

  • Node.js
  • TypeScript
  • Fastify
  • Prisma ORM
  • Docker
  • Vitest
  • CI/CD
  • Zod
  • PostgreSQL

📝 Concepts

  • SOLID
  • E2E and Unit Tests
  • TDD
  • Design Patterns: Factory, Adapter, Repository
  • InMemoryTestDatabase
  • RBAC
  • Refresh Token

📄 How to Use

  • 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

About

API for check-ins at gyms. Applying concepts of SOLID, Design Patterns, Docker, JWT and Refresh Token, RBAC and others.

Topics

Resources

Stars

Watchers

Forks