Application developed to do check-ins at gyms. I've learned so many concepts about JWT, Refresh Token, Middlewares, Authentication, SOLID, Integration Tests, E2E Tests, Docker, Design Patterns, Prisma, Postgres, and CI/CD.
1: Change the DATABASE_URL in your .env to: postgresql://POSTGRESQL_USERNAME:POSTGRESQL_PASSWORD@localhost:5432/apisolid?schema=public
2: Run the following command on CMD: npm install && npm run dev
1: Change the DATABASE_URL in your .env to: postgresql://root:root@db:5432/apisolid?schema=public
2: Run the following command on CMD: npm install && docker-compose up -d
3: On CMD App Root, execute these following steps:
3.1 - docker exec -it api_gym /bin/sh
3.2 - npx prisma migrate deploy
3.3 - exit
- [POST]
/users
- [POST]
/sessions
- [PATCH]
/token/refresh
- [GET]
/me
-
[GET]
/check-ins/history
-
[GET]
/check-ins/metrics
-
[POST]
/gyms/:gymId/check-ins
-
[PATCH]
/check-ins/:checkInId/validate
- [GET]
/gyms/search
- [GET]
/gyms/nearby
- [POST]
/gyms
- It should be possible to sign up;
- It should be possible to authenticate;
- It should be possible to obtain the profile of a logged-in user;
- It should be possible to get the number of check-ins made by the logged-in user;
- It should be possible for the user to obtain their check-in history;
- It should be possible for the user to search for gyms nearby (within 10KM);
- It should be possible for the user to search for gyms by name;
- It should be possible for the user to check-in at a gym;
- It should be possible to validate a user's check-in;
- It should be possible to register a gym.
- The user must not be able to register with a duplicate email;
- The user cannot do 2 check-ins on the same day;
- The user cannot check in if they are not close (100m) to the gym;
- Check-in can only be validated up to 20 minutes after being created;
- Check-in can only be validated by administrators;
- The gym can only be registered by administrators;
- The user's password must be encrypted;
- Application data must be persisted in a PostgreSQL database;
- All data lists must be paged with 20 items per page;
- The user must be identified by a JWT (JSON Web Token);