Clone the project
git clone https://github.com/emanoelhenrick/Gym-API.git
Enter the project directory
cd Gym-API
Install the dependencies
npm install
Set the environment variables using the .env.example file as a guide and configure the docker compose file, then bring up the database container
docker compose up
Run migrations
npx prisma migrate dev
For development, start the server
npm run dev
For production, build first
npm run build
And then start the server
npm start
A gym check-in management system built using Node.js, inspired by the GymPass app. It offers the following key functionalities:
-
User Registration and Authentication:
- Users can register and log in securely using email and password.
-
User Profile and Check-in Information:
- Logged-in users can access their profile and view their check-in count.
-
Check-in History:
- Users can retrieve their check-in history, including details of previous check-ins.
-
Gym Search:
- Users can search for nearby gyms based on their location or by name.
-
Check-in Process:
- Users can check in at a gym, with validation ensuring proximity within 100m.
- Duplicate check-ins on the same day are prevented.
-
Gym Registration:
- Admin users can register new gyms within the system.
- Unique email addresses are required for user registration.
- Users must be within 100m of a gym to check in.
- Check-ins can only be validated by admins within 20 minutes of creation.
- Only admins can register new gyms.
- User passwords are encrypted for security.
- Application data is stored and retrieved from a PostgreSQL database.
- Data lists, such as check-in history, are paginated with 20 items per page.
- User identification is performed using JSON Web Tokens (JWT).