Triance Architecture

Tech Stack Overview

Triance is built as a full stack health and fitness tracking platform using a React frontend (deployed via Vercel/CDN for static assets) and a FastAPI backend running on EC2 behind Nginx and Gunicorn/Uvicorn for high-performance API serving. Data is persisted in an Amazon RDS MySQL database, with SQLAlchemy models and Pydantic schemas ensuring type safe data validation. Authentication and user management are powered by FastAPI Users with JWT tokens, and workout/exercise data is organized through carefully designed relational models. AWS Secrets Manager is used to securely store DB credentials and JWT secrets, while CloudWatch provides centralized logging, metrics, and alarms for production monitoring. The codebase is container-friendly, supports Alembic migrations, and is fully end to end tested with pytest.

System Design

Data Model (ERD)

Sequence Diagrams

Create Auth User

Login + Persisted Session on Refresh

Create Workout

Update Workout

Minimal Deployment Diagram

  • Nginx: TLS termination, static gzip, reverse proxy to Gunicorn/Uvicorn.
  • Gunicorn/Uvicorn: ASGI server for FastAPI (workers tuned to CPU/RAM).
  • RDS MySQL: production DB; add backups + IAM auth if desired.
  • CloudWatch: structured logs & dashboards; alarms on latency/errors.
  • Secrets Manager: DB creds/JWT secrets rotated out of code/env files.