{"id":21827279,"url":"https://github.com/nabilaferdousprapty/track-tonic-server","last_synced_at":"2026-04-13T00:02:09.048Z","repository":{"id":244558592,"uuid":"815597163","full_name":"NabilaFerdousPrapty/Track-Tonic-Server","owner":"NabilaFerdousPrapty","description":"Track Tonic is a cutting-edge fitness app that empowers users to track progress, set goals, and engage with a vibrant community, promoting healthier lifestyles through advanced technology. This is the server side code","archived":false,"fork":false,"pushed_at":"2024-07-02T04:51:41.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T08:27:03.527Z","etag":null,"topics":["cors","dotenv","expressjs","jwt","mongodb","nodejs","stripe"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/NabilaFerdousPrapty.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":"2024-06-15T15:24:31.000Z","updated_at":"2024-07-02T04:51:44.000Z","dependencies_parsed_at":"2024-06-15T16:54:48.402Z","dependency_job_id":"98c05af1-5df9-4a6a-b846-a39fcaaaf4bc","html_url":"https://github.com/NabilaFerdousPrapty/Track-Tonic-Server","commit_stats":null,"previous_names":["nabilaferdousprapty/track-tonic-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NabilaFerdousPrapty%2FTrack-Tonic-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NabilaFerdousPrapty%2FTrack-Tonic-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NabilaFerdousPrapty%2FTrack-Tonic-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NabilaFerdousPrapty%2FTrack-Tonic-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NabilaFerdousPrapty","download_url":"https://codeload.github.com/NabilaFerdousPrapty/Track-Tonic-Server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244795519,"owners_count":20511521,"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":["cors","dotenv","expressjs","jwt","mongodb","nodejs","stripe"],"created_at":"2024-11-27T18:12:45.263Z","updated_at":"2026-04-13T00:02:08.987Z","avatar_url":"https://github.com/NabilaFerdousPrapty.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# TrackTonic Fitness Training\n\nTrackTonic Fitness Training is a comprehensive platform that connects fitness trainers with clients, offering a range of features such as trainer profiles, booking, reviews, and a forum for discussions. The backend is built with Node.js, Express, MongoDB, and Stripe for payment processing.\n\n## Table of Contents\n\n- [Setup](#setup)\n- [Installation](#installation)\n- [Environment Variables](#environment-variables)\n- [API Endpoints](#api-endpoints)\n- [Technologies Used](#technologies-used)\n- [License](#license)\n\n## Setup\n\nTo set up the project locally, follow these steps:\n\n1. **Clone the repository**:\n    ```bash\n    git clone https://github.com/yourusername/tracktonic-fitness-training.git\n    cd tracktonic-fitness-training\n    ```\n\n2. **Install dependencies**:\n    ```bash\n    npm install\n    ```\n\n3. **Set up the environment variables**:\n    Create a `.env` file in the root directory and add the following environment variables:\n    ```plaintext\n    PORT=7000\n    DB_USER=your_mongodb_username\n    DB_PASS=your_mongodb_password\n    ACCESS_TOKEN_SECRET=your_jwt_secret\n    STRIPE_SECRET_KEY=your_stripe_secret_key\n    ```\n\n4. **Start the server**:\n    ```bash\n    nodemon index.js\n    ```\n\n5. **Access the application**:\n    Open your web browser and navigate to `http://localhost:7000` to access the application.\n\n## Installation\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/yourusername/tracktonic-fitness-training.git\n    cd tracktonic-fitness-training\n    ```\n\n2. Install dependencies:\n    ```bash\n    npm install\n    ```\n\n3. Start the server:\n    ```bash\n    npm start\n    ```\n\n## Environment Variables\n\nCreate a `.env` file in the root directory and add the following environment variables:\n\n```plaintext\nPORT=7000\nDB_USER=your_mongodb_username\nDB_PASS=your_mongodb_password\nACCESS_TOKEN_SECRET=your_jwt_secret\nSTRIPE_SECRET_KEY=your_stripe_secret_key\n```\n\n## API Endpoints\n\n### Authentication\n\n- **Generate JWT Token**: `POST /jwt`\n  - Body: `{ \"email\": \"user@example.com\", \"password\": \"password\" }`\n\n### Reviews\n\n- **Get All Reviews**: `GET /reviews`\n- **Get Review by ID**: `GET /reviews/:id`\n- **Create Review**: `POST /reviews`\n  - Body: `{ \"review\": \"Great trainer!\", \"rating\": 5 }`\n\n### Trainers\n\n- **Get All Approved Trainers**: `GET /trainers`\n- **Get All Trainers**: `GET /trainers/all`\n- **Get Pending Trainers**: `GET /trainers/pending`\n- **Get Trainer by ID**: `GET /trainers/:id`\n- **Get Trainer by Email**: `GET /trainers/email/:email`\n- **Get Rejected Trainers by Email**: `GET /rejectedTrainers/:email`\n- **Get Pending Trainers by Email**: `GET /pendingTrainers/:email`\n- **Create Trainer**: `POST /trainers`\n  - Body: `{ \"name\": \"John Doe\", \"email\": \"john@example.com\", \"status\": \"pending\" }`\n- **Approve Trainer**: `PATCH /approveTrainer/:id`\n- **Reject Trainer**: `PATCH /rejectTrainer/:id`\n  - Body: `{ \"reason\": \"Does not meet criteria\" }`\n- **Update Trainer Role to 'trainer'**: `PATCH /trainers/approve/:email`\n- **Update Trainer Role to 'member'**: `PATCH /trainers/delete/:email`\n- **Delete Trainer**: `DELETE /trainers/remove/:id`\n\n### Forum Posts\n\n- **Get All Posts with Pagination**: `GET /posts?page=0\u0026size=10`\n- **Create Post**: `POST /posts`\n  - Body: `{ \"title\": \"New Post\", \"content\": \"This is a new post.\" }`\n- **Get Post by ID**: `GET /posts/:id`\n- **Upvote Post**: `PATCH /posts/upvote/:postId`\n- **Downvote Post**: `PATCH /posts/downvote/:postId`\n- **Get Post Count**: `GET /postsCount`\n\n### Users\n\n- **Get All Users**: `GET /users`\n- **Create User**: `POST /users`\n  - Body: `{ \"name\": \"John Doe\", \"email\": \"john@example.com\" }`\n- **Check Admin Role**: `GET /users/admin/:email`\n- **Check Trainer Role**: `GET /users/trainer/:email`\n\n### Classes\n\n- **Create Class**: `POST /classes` (Admin only)\n  - Body: `{ \"class_name\": \"Yoga\", \"description\": \"A relaxing yoga class\" }`\n- **Get All Classes with Pagination and Search**: `GET /classes?page=0\u0026size=10\u0026search=yoga`\n- **Get Class Count**: `GET /classesCount`\n- **Get Class by ID**: `GET /classes/:id`\n- **Get Featured Classes**: `GET /featuredClasses`\n- **Book Class**: `PATCH /bookClass/:id`\n\n### Payments\n\n- **Create Payment Intent**: `POST /create_payment_intent`\n  - Body: `{ \"price\": 100 }`\n- **Record Payment**: `POST /payments`\n  - Body: `{ \"amount\": 100, \"email\": \"user@example.com\" }`\n- **Get All Payments**: `GET /payments`\n- **Get Payments by Email**: `GET /payments/:email`\n\n## Technologies Used\n\n- **Backend**: Node.js, Express.js\n- **Database**: MongoDB\n- **Authentication**: JWT\n- **Payment Processing**: Stripe\n- **Environment Variables**: dotenv\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabilaferdousprapty%2Ftrack-tonic-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnabilaferdousprapty%2Ftrack-tonic-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabilaferdousprapty%2Ftrack-tonic-server/lists"}