POST v1/users/{id}/workouts
body:
{ time_stamp: datetime
workout_type: str
data_source: str <-- manual or external device
duration: time
calories_burned: (optional): int
additional_metrics (optional): <-- store additional workout data when from wearable or external device.
workout_id: unique identifier for workout
}
headers:
Auth: JWT
POST v1/users/{id}/measurements
body:
{
weight: int
height (optional): int
sex (optional): str
}
GET v1/workoutresources
{
workout_name:
{
returns: S3 URL for rendering in client UI
headers:
Auth: JWT
GET v1/users/{id}/workouts/{id} <-- use id to filter for specific workout, or use query params for optional filters like date, workout type, etc.
headers:
Auth: JWT
POST v1/users/{id}/goals
body:
{
type: str <-- activity minutes or weight
name (optional):
due_date: datetime
goal: int <-- activity minute value or weight value
}
headers:
Auth: JWT
GET v1/users/{id}/progress
body:
{
goal_id: str
}
headers:
Auth: JWT
GET v1/users/{id}/dashboard <-- returns a summary of activity for specific time frame.
body:
{
timeframe: <-- time frame to view stats
}
headers:
Auth: JWT
Client: Mobile Application
API Gateway: Used to handle auth, endpoint routing, and rate limiting.
Load Balancer: As we scale replicas of our services. the load balancer will evenly distribute requests, supporting horizontal scaling as needed. Will check for server health and route appropriately.
Services
Notification Service
Scaling the services:
Scaling the DB: