Skip to content

andr3felipe/Gym-SOLID-api

Repository files navigation

GYM SOLID API

ENGLISH


PORTUGUÊS


ENGLISH

DESCRIPTION:

A gym check-in REST API building under TDD (Vitest) and SOLID concepts, using JWT for authentication.


MADE WITH:

  • Typescript
  • NodeJS
  • Fastify
  • Prisma
  • PostgreSQL
  • Bcryptjs
  • Zod
  • Docker
  • JWT
  • Vitest

FEATURES:

  • - It must be possible to register;
  • - It must be possible to authenticate;
  • - It must be possible to obtain the profile of a logged user;
  • - It must be possible to obtain the numbers of checkins performed by the logged in user;
  • - It must be possible for the user to obtain his checkins history;
  • - It should be possible for the user to search for nearby gyms;
  • - It should be possible for the user to search for gyms by name;
  • - It must be possible for the user to check-in at a gym;
  • - It must be possible to validate a user's check-in;
  • - It must be possible to register a gym;

  • - The user must not be able to register with a duplicate email;
  • - The user cannot make 2 check-ins on the same day;
  • - The user cannot check in if he is not close to the gym (100 meters);
  • - The check in can only be validated up to 20 minutes after being created;
  • - Check in can only be validated by administrators;
  • - The academy can only be registered by administrators;

  • - User password needs to be encrypted;
  • - Application data must be persisted in a PostgreSQL database;
  • - All data lists need to be paginated with 20 items per page;
  • - The user must be identified by a JWT (JSON WEB Token);


HOW TO RUN:

How to clone the project:

Open your terminal and execute the following commands:

git clone https://github.com/andr3felipe/Gym-SOLID-api.git
cd gym-solid-api
npm i

- To test the project run the command:

npm run test

- If you want to run the project and you have docker installed:

npx prisma migrate dev
docker compose up -d
npm run dev

PORTUGUÊS

DESCRIÇÃO:

Uma API REST de check-in de academias, construida utilizando as metodologias TDD (Vitest) e SOLID, com JWT para autenticação.


FEITO COM:

  • Typescript
  • NodeJS
  • Fastify
  • Prisma
  • PostgreSQL
  • Bcryptjs
  • Zod
  • Docker
  • JWT
  • Vitest

FUNCIONALIDADES:

  • - Deve ser possível se cadastrar;
  • - Deve ser possível se autenticar;
  • - Deve ser possível obter o perfil de um usuário logado;
  • - Deve ser possível obter o número de check-ins relizados pelo usuário logado;
  • - Deve ser possível o usuário obter seu histórico de check-ins;
  • - Deve ser possível o usuário buscar academias próximas;
  • - Deve ser possível o usuário buscar academias pelo nome;
  • - Deve ser possível o usuário realizar o check-in em uma academia;
  • - Deve ser possível validar o check-in de um usuário;
  • - Deve ser possível cadastrar uma academia;

  • - O usuário não deve poder se cadastrar com um e-mail duplicado;
  • - O usuário não pode fazer 2 check-ins no mesmo dia;
  • - O usuário não pode fazer check-ins se não estiver perto (100m) da academia;
  • - O check-in só pode ser validado até 20 minutos após criado;
  • - O check-in só pode ser validado por administradores;
  • - A academia só pode ser cadastrar por administradores;

  • - A senha do usuário precisa estar criptografada;
  • - Os dados da aplicação precisam estar persistidos em um banco PostgreSQL;
  • - Todas listas de dados precisam estar paginadas com 20 itens por página;
  • - O usuário deve ser identificado por um JWT (JSON Web Token);


COMO INICIAR O PROJETO:

Como clonar o projeto:

Abra o terminal e execute os seguintes comandos:

git clone https://github.com/andr3felipe/Gym-SOLID-api.git
cd gym-solid-api
npm i

- Para testar o projeto execute o comando:

npm run test

- Se você quer iniciar o projeto e tem docker instalado:

npx prisma migrate dev
docker compose up -d
npm run dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published