main
GymLogAI
GymLogAI is a minimal multi-project skeleton for importing workout messages, parsing them into structured training history, and generating workout recommendations.
Architecture
GymLogAI.Core: domain entities, enums, and primitive abstractions likeIClockandIIdGeneratorGymLogAI.Application: repository contracts, AI contracts, DTOs, and use-case handlersGymLogAI.Persistence: EF CoreAppDbContext, PostgreSQL mappings, repositories, infrastructure services, and the first migrationGymLogAI.AI: OpenRouter-ready options and stubbed AI implementations for parsing, recommendations, and embeddingsGymLogAI.API: minimal API composition root with Swagger, import/recommend/history endpoints, and database migration on startupGymLogAI.TelegramBot: Telegram long-polling host with/start,/today, and text message importGymLogAI.Worker: background worker that polls pending telegram messages and parses them into workouts
Runtime Flow
- API or Telegram bot imports a raw Telegram message into
telegram_messageswithPendingstatus. - Worker polls pending messages and runs
ParseTelegramMessageHandler. - Parsed workouts are stored in
workouts,workout_exercises, andexercise_sets. - API and Telegram bot can request workout recommendations from the application layer.
Key Endpoints
POST /api/messages/importPOST /api/workouts/recommendGET /api/workouts/history?userId=<guid>- Swagger UI:
/swagger
Database
- Provider: PostgreSQL
- Migration project:
GymLogAI.Persistence - Initial migration is included in
GymLogAI.Persistence/Migrations Exerciseincludes anEmbeddingfield stored as nullablereal[]
Run
dotnet build
dotnet run --project GymLogAI.API/
dotnet run --project GymLogAI.TelegramBot/
dotnet run --project GymLogAI.Worker/
docker compose -f compose.yaml up --build
Configuration
- Connection string:
ConnectionStrings:Postgres - Telegram bot token:
TelegramBot:BotToken - OpenRouter settings:
OpenRouter:* - Worker polling settings:
Worker:BatchSize,Worker:PollingIntervalSeconds
Description
Languages
C#
96.4%
Dockerfile
3.6%