{"id":25211518,"url":"https://github.com/PedroLucasAraujo/nodejs_gympass_style_api_rest","last_synced_at":"2025-10-25T11:30:21.003Z","repository":{"id":273786403,"uuid":"920875118","full_name":"PedroLucasAraujo/nodejs_api_rest03-solid","owner":"PedroLucasAraujo","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-03T22:13:20.000Z","size":248,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T22:35:12.908Z","etag":null,"topics":["design-patterns","docker","jwt","nodejs","rbac","refresh-token","solid"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PedroLucasAraujo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-22T23:20:39.000Z","updated_at":"2025-02-03T22:13:23.000Z","dependencies_parsed_at":"2025-01-23T00:36:48.371Z","dependency_job_id":null,"html_url":"https://github.com/PedroLucasAraujo/nodejs_api_rest03-solid","commit_stats":null,"previous_names":["pedrolucasaraujo/nodejs_api_rest03-solid"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PedroLucasAraujo%2Fnodejs_api_rest03-solid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PedroLucasAraujo%2Fnodejs_api_rest03-solid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PedroLucasAraujo%2Fnodejs_api_rest03-solid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PedroLucasAraujo%2Fnodejs_api_rest03-solid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PedroLucasAraujo","download_url":"https://codeload.github.com/PedroLucasAraujo/nodejs_api_rest03-solid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238125220,"owners_count":19420470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["design-patterns","docker","jwt","nodejs","rbac","refresh-token","solid"],"created_at":"2025-02-10T14:16:15.141Z","updated_at":"2025-10-25T11:30:20.999Z","avatar_url":"https://github.com/PedroLucasAraujo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GymPass Style App\n\n## Overview\nThis project is a REST API for a GymPass-style application that provides various functionalities for user authentication, gym check-ins, and gym management.\n\n## Features\n### Functional Requirements (RFs)\n- Users can register an account.\n- Users can authenticate.\n- Logged-in users can retrieve their profile.\n- Logged-in users can get the number of check-ins they have made.\n- Users can view their check-in history.\n- Users can search for nearby gyms (within 10km).\n- Users can search for gyms by name.\n- Users can check-in at a gym.\n- Admins can validate user check-ins.\n- Admins can register new gyms.\n\n### Business Rules (RNs)\n- Users cannot register with a duplicate email.\n- Users can only perform one check-in per day.\n- Users can only check-in if they are within 100 meters of the gym.\n- Check-ins can only be validated within 20 minutes of creation.\n- Only administrators can validate check-ins.\n- Only administrators can register gyms.\n\n### Non-Functional Requirements (RNFs)\n- User passwords are encrypted.\n- Application data is stored in a PostgreSQL database.\n- Data lists are paginated (20 items per page).\n- Users are identified via JWT (JSON Web Token).\n\n## Tech Stack\nThis project was built using the following technologies:\n- **Node.js** - JavaScript runtime\n- **Docker** - Containerization\n- **JWT (JSON Web Token)** - Authentication\n- **SOLID principles** - Software architecture\n- **Design Patterns** - Code structure optimization\n- **RBAC (Role-Based Access Control)** - Access control\n- **Refresh Token** - Token refresh mechanism\n- **Vitest** - Testing framework\n- **Prisma** - ORM for database management\n- **TypeScript** - Strongly typed JavaScript\n- **Day.js** - Date/time management\n- **Bcrypt** - Password hashing\n- **Fastify** - Web framework for Node.js\n- **Zod** - Data validation\n\n## Setup\nTo run the project locally, follow these steps:\n1. Clone the repository:\n   ```sh\n   git clone https://github.com/PedroLucasAraujo/nodejs_gympass_style_api_rest\n   cd nodejs_gympass_style_api_rest\n   ```\n2. Install dependencies:\n   ```sh\n   npm install\n   ```\n3. Start the Docker container:\n   ```sh\n   docker-compose up -d\n   ```\n4. Run database migrations:\n   ```sh\n   npx prisma migrate dev\n   ```\n5. Start the server:\n   ```sh\n   npm run dev\n   ```\n\n## Testing\nTo run tests, use:\n```sh\nnpm run test\n```\n\n## License\nThis project is licensed under the MIT License.\n\n---\nFeel free to contribute and improve this project!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPedroLucasAraujo%2Fnodejs_gympass_style_api_rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPedroLucasAraujo%2Fnodejs_gympass_style_api_rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPedroLucasAraujo%2Fnodejs_gympass_style_api_rest/lists"}