The Coach Management API is a backend application designed to facilitate the management of coaches and their clients. It provides a robust set of features that enable coaches to efficiently manage their clients' information, as well as create and assign custom Workout and Nutrition templates to their clients.
-
Client Management: Coaches can create, update, and delete client profiles. Clients can update their personal information and maintain an up-to-date profile.
-
Workout and Nutrition Templates: Coaches can create and manage their own Workout and Nutrition templates, tailoring them to the specific needs of their clients.
-
Template Assignment: Coaches can assign their Workout and Nutrition templates to their created clients, ensuring personalized fitness and nutrition plans.
-
Clone the repository:
git clone https://github.com/Vaatu/Fitness-cms.git
-
Install dependencies:
cd Fitness-cms npm install
-
Set up the database:
- Create a database with the name specified in the
.env.example
file. - Update the database configuration and rename it to
.env
file.
- Create a database with the name specified in the
-
Run database migrations:
npx sequelize-cli db:migrate
-
Start the server:
npm start
The server will start running on http://localhost:3000
.
API documentation is available using Swagger UI.
- Open the API documentation in a web browser:
http://localhost:3000/api-docs
GET /clients
: Get all clients.GET /clients/:id
: Get a client by ID.POST /clients
: Create a new client.PUT /clients/:id
: Update a client.DELETE /clients/:id
: Delete a client.GET /clients/:id/coaches
: Get the coaches assigned to a client.GET /clients/:id/workout-template
: Get the workout template assigned to a client.GET /clients/:id/nutrition-template
: Get the nutrition template assigned to a client.
GET /coaches
: Get all coaches.GET /coaches/:id
: Get a coach by ID.POST /coaches
: Create a new coach.PUT /coaches/:id
: Update a coach.DELETE /coaches/:id
: Delete a coach.
GET /coaches/:coachId/certificates
: Get the certificates of a coach.POST /coaches/:coachId/certificates
: Create a certificate for a coach.
GET /coaches/:coachId/posts
: Get the posts of a coach.
GET /coaches/:coachId/nutrition-templates
: Get the nutrition templates of a coach.POST /coaches/:coachId/nutrition-templates
: Create a nutrition template for a coach.DELETE /coaches/:coachId/nutrition-templates/:templateId
: Delete a nutrition template.POST /coaches/:coachId/clients/:clientId/nutrition-template/:templateId
: Assign a nutrition template to a client.GET /coaches/:coachId/clients/:clientId/nutrition-templates
: Get the nutrition templates assigned to a client.DELETE /coaches/:coachId/clients/:clientId/nutrition-templates
: Remove a nutrition template from a client.
POST /coaches/:coachId/workout-templates
: Create a workout template for a coach.GET /coaches/:coachId/workout-templates
: Get the workout templates of a coach.DELETE /coaches/:coachId/workout-templates/:templateId
: Delete a workout template.POST /coaches/:coachId/workout-templates/:templateId/days
: Insert a day into a workout template.POST /coaches/:coachId/clients/:clientId/workout-template/:templateId
: Assign a workout template to a client.GET /coaches/:coachId/clients/:clientId/workout-templates
: Get the workout templates assigned to a client.DELETE /coaches/:coachId/clients/:clientId/workout-templates
: Remove a workout template from a client.