This is a Node.js application inspired by GymPass, designed to manage gym check-ins, user profiles, and gym registrations with specific business and functional requirements.
- ✨ Features
- 📋 Business Rules
- ⚙️ Non-Functional Requirements
- 🧰 Technologies
- 🚀 Setup
- 💡 Usage
- 🤝 Contributing
- 📄 License
- 👤 User Registration: Users can sign up with a unique email address.
- 🔐 User Authentication: Secure login system for registered users.
- 🧾 User Profile: Retrieve the profile details of a logged-in user.
- 🏁 Check-in Count: View the total number of check-ins made by the logged-in user.
- 🕓 Check-in History: Access the user's check-in history.
- 📍 Nearby Gym Search: Find gyms within a 10km radius.
- 🔎 Gym Search by Name: Search for gyms by their name.
- 🏋️ Check-in at Gym: Users can check in at a gym if within 100 meters.
- ✅ Check-in Validation: Admins can validate check-ins within 20 minutes of creation.
- 🏢 Gym Registration: Admins can register new gyms.
- 🚫 Users cannot register with a duplicate email.
- 📅 Users are restricted to one check-in per day.
- 📏 Check-ins are only allowed if the user is within 100 meters of the gym.
- ⏱️ Check-ins must be validated within 20 minutes of creation.
- 🧑💼 Only administrators can validate check-ins.
- 🏫 Only administrators can register new gyms.
- 🔒 User passwords are encrypted for security.
- 💾 Data is persisted in a PostgreSQL database.
- 📄 All data lists are paginated (20 items per page).
- 🪪 User authentication is managed using JWT (JSON Web Tokens).
| Technology | Description |
|---|---|
| Node.js | Backend runtime environment |
| PostgreSQL | Database for persistent storage |
| JWT | Secure user authentication |
| Docker | Containerized deployment |
| Express / Prisma | (Optional) Frameworks and ORM for backend structure |
git clone https://github.com/Renan-ag/node-modulo-03.git
cd node-modulo-03npm installCreate a .env file in the root directory:
DATABASE_URL="postgresql://user:password@db:5432/gympass?schema=public"
JWT_SECRET="your_jwt_secret_key"Ensure Docker is installed and running:
docker-compose up -dThen, run migrations (if using Prisma):
npx prisma migrate devIf using Docker Compose:
docker-compose upOr manually:
npm start- Access the app via: http://localhost:3000
- Test the API using Postman or cURL.
- Example endpoints (to be documented as implemented):
POST /registerPOST /loginPOST /check-inGET /gyms/nearby
- Fork the repository
- Create a new branch
git checkout -b feature/your-feature
- Commit your changes
git commit -m "Add your feature" - Push to the branch
git push origin feature/your-feature
- Open a Pull Request
This project is licensed under the MIT License.
See the LICENSE file for details.
💬 Developed by Renan Andrade