Skip to content

Repository files navigation

🏋️‍♂️ GymPass Style App

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.


📑 Table of Contents


✨ Features

  • 👤 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.

📋 Business Rules

  • 🚫 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.

⚙️ Non-Functional Requirements

  • 🔒 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).

🧰 Technologies

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

🚀 Setup

1️⃣ Clone the Repository

git clone https://github.com/Renan-ag/node-modulo-03.git
cd node-modulo-03

2️⃣ Install Dependencies

npm install

3️⃣ Configure Environment Variables

Create a .env file in the root directory:

DATABASE_URL="postgresql://user:password@db:5432/gympass?schema=public"
JWT_SECRET="your_jwt_secret_key"

4️⃣ Set Up the Database

Ensure Docker is installed and running:

docker-compose up -d

Then, run migrations (if using Prisma):

npx prisma migrate dev

5️⃣ Start the Application

If using Docker Compose:

docker-compose up

Or manually:

npm start

💡 Usage

  • Access the app via: http://localhost:3000
  • Test the API using Postman or cURL.
  • Example endpoints (to be documented as implemented):
    • POST /register
    • POST /login
    • POST /check-in
    • GET /gyms/nearby

🤝 Contributing

  1. Fork the repository
  2. Create a new branch
    git checkout -b feature/your-feature
  3. Commit your changes
    git commit -m "Add your feature"
  4. Push to the branch
    git push origin feature/your-feature
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License.
See the LICENSE file for details.


💬 Developed by Renan Andrade

About

Projeto desenvolvido durante um curso de Node.js, inspirado no aplicativo GymPass, com foco em autenticação, check-ins em academias e regras de negócio reais utilizando PostgreSQL, JWT e Docker.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages