This document provides details for all the API endpoints available in the FitSense-Ai project.
Create a new user in the system.
- URL:
/api/auth/register - Method:
POST - Request Body:
{ "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "password": "securepassword", "weight": 75 } - Response:
200 OK{ "userID": "uuid", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "weight": 75, "createdAt": "2024-02-06T10:00:00Z", "updatedAt": "2024-02-06T10:00:00Z" }
List all registered users.
- URL:
/api/auth/users - Method:
GET - Response:
200 OK[ { "userID": "uuid", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "weight": 75, "createdAt": "...", "updatedAt": "..." } ]
Log a new fitness activity for a user.
- URL:
/api/activity - Method:
POST - Request Body:
{ "userId": "uuid", "type": "RUNNING", "duration": 45, "effortLevel": "HIGH", "startedAt": "2024-02-06T08:00:00Z" } - Response:
200 OK{ "activityId": "uuid", "userId": "uuid", "type": "RUNNING", "startedAt": "2024-02-06T08:00:00Z", "duration": 45, "effortLevel": "HIGH", "caloriesBurned": 525.0, "createdAt": "..." }
Retrieve all activities logged by a specific user.
- URL:
/api/activity/{userId} - Method:
GET - Response:
200 OK[ { "activityId": "uuid", "userId": "uuid", "type": "RUNNING", "duration": 45, "caloriesBurned": 525.0, "..." } ]
Get AI-generated fitness recommendations and insights based on a specific activity.
- URL:
/api/recommendation - Method:
POST - Request Body:
{ "activityId": "uuid" } - Response:
200 OK{ "id": "uuid", "recommendation": "Great job on your run! To improve performance...", "improvements": ["Work on breathing technique", "Increase pace gradually"], "safety": ["Stay hydrated", "Stretch after running"], "suggestions": ["Try interval training next time"], "createdAt": "...", "updatedAt": "...", "userId": "uuid", "activityId": "uuid" }