Warning
This repository is archived and no longer maintained. The code is kept here for reference only. Issues and pull requests are not accepted, and the app is no longer deployed.
Swimming support continues in marola-dev, which plans to improve its swimming features much more in 2027.
A comprehensive swimming training application inspired by Strava, designed specifically for competitive swimmers and open water enthusiasts. Features activity tracking, advanced analytics, personal record management, goal setting, and AI-powered coaching insights.
- React 18 with TypeScript
- Vite for fast development and building
- TanStack React Query for server state management
- Tailwind CSS with shadcn/ui components
- Wouter for lightweight routing
- Recharts for data visualization
- FastAPI (Python) - Primary API server
- Express.js (Node.js) - Development proxy and static file serving
- SQLAlchemy ORM with PostgreSQL
- Google OAuth 2.0 with PKCE for authentication
- PostgreSQL database
- OpenAI API for AI coaching features
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ React App │────▶│ Express Proxy │────▶│ FastAPI │
│ (Port 5000) │ │ (Port 5000) │ │ (Port 8000) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐
│ PostgreSQL │
└─────────────────┘
- Frontend: React SPA served via Vite (development) or Express (production)
- Express Proxy: Routes
/api/*requests to FastAPI backend - FastAPI Backend: Handles all API logic, authentication, and database operations
- PostgreSQL: Stores user data, activities, goals, and session information
- Activity Tracking: Log swimming workouts with detailed metrics (distance, time, pace, strokes)
- CSV Import: Import activities from Garmin Connect exports
- Analytics Dashboard: Visualize training progress with charts and statistics
- Personal Records: Track and celebrate your best performances
- Goal Setting: Set and monitor swimming goals
- AI Swim Coach: Get personalized training insights powered by OpenAI
├── client/ # React frontend
│ └── src/
│ ├── components/ # UI components (shadcn/ui based)
│ ├── hooks/ # React Query hooks
│ ├── pages/ # Page components
│ └── lib/ # Utilities
├── python_backend/ # FastAPI backend
│ ├── main.py # API routes
│ ├── auth.py # Google OAuth implementation
│ ├── models.py # SQLAlchemy models
│ ├── schemas.py # Pydantic schemas
│ ├── csv_parser.py # Garmin CSV parser
│ └── database.py # Database connection
├── server/ # Express.js proxy server
│ ├── index.ts # Server entry point
│ ├── routes.ts # Proxy configuration
│ └── static.ts # Static file serving
├── shared/ # Shared types and schemas
│ ├── schema.ts # Drizzle table definitions
│ └── routes.ts # API contract definitions
└── dist/ # Production build output
| Variable | Description |
|---|---|
DATABASE_URL |
PostgreSQL connection string |
GOOGLE_CLIENT_ID |
Google OAuth client ID |
GOOGLE_CLIENT_SECRET |
Google OAuth client secret |
SESSION_SECRET |
Session cookie signing key |
| Variable | Description |
|---|---|
AI_INTEGRATIONS_OPENAI_API_KEY |
OpenAI API key for AI coach |
AI_INTEGRATIONS_OPENAI_BASE_URL |
OpenAI API base URL |
- Fork this project on Replit
- Add required secrets in the Secrets tab
- Configure Google OAuth redirect URIs in Google Cloud Console
- Click Run
See DEVELOPMENT.md for detailed local setup instructions.
See .github/workflows/deploy.yml for CI/CD pipeline configuration.
The included GitHub Actions workflow automatically deploys to GCP Cloud Run on push to main.
Required GitHub Secrets:
GCP_PROJECT_ID- Your GCP project IDGCP_SA_KEY- Service account JSON key with Cloud Run permissionsGCP_REGION- Deployment region (e.g.,us-central1)
GET /api/login- Initiate Google OAuth loginGET /api/auth/callback- OAuth callback handlerGET /api/auth/user- Get current user infoGET /api/logout- End session
GET /api/activities- List user activitiesPOST /api/activities- Create activityGET /api/activities/:id- Get activity detailsDELETE /api/activities/:id- Delete activityPOST /api/import/csv- Import from Garmin CSV
GET /api/personal-records- List personal records
GET /api/goals- List user goalsPOST /api/goals- Create goal
GET /api/conversations- List conversationsPOST /api/conversations- Create new conversationGET /api/conversations/:id- Get conversation detailsDELETE /api/conversations/:id- Delete conversationPOST /api/conversations/:id/messages- Send message to AI coach
GET /api/health- Health check endpoint
MIT