Skip to content

Repository files navigation

Fitness App

A cross-platform mobile fitness application with client-server architecture for tracking daily calorie intake, weight, and body measurements with AI-powered feedback, notifications, and subscription monetization.

Project Structure

project-root/
├── backend/                         # Backend services
│   ├── auth-service/                # Authentication & Authorization
│   ├── calorie-service/             # Meal logging & FatSecret integration
│   ├── measurement-service/         # Weight & body measurements
│   ├── chat-service/                # OpenAI chat analysis
│   ├── subscription-service/        # Monetization & billing
│   ├── notification-dispatcher/     # Firebase notifications
│   ├── common-lib/                  # Shared backend utilities
│   ├── docker-compose.yml           # Compose orchestration
│   └── build.gradle.kts
├── mobile/                          # Mobile applications
│   ├── shared/                      # Kotlin Multiplatform shared code
│   ├── androidApp/                  # Android-specific UI & integration
│   ├── iosApp/                      # iOS-specific UI & integration
│   └── features/                    # Feature modules for UI & use-cases
├── infrastructure/                  # Deployment & infrastructure
├── scripts/                         # Utility scripts
└── README.md

Technologies Used

  • Backend: Ktor server in Kotlin, exposes REST and WebSocket endpoints
  • Client: Kotlin Multiplatform (Android & iOS) using Ktor HTTP client
  • Deployment: Dockerized services; Docker Compose
  • Push Notifications: Firebase Cloud Messaging
  • AI Integration: OpenAI REST API
  • Nutrition API: FatSecret REST API
  • Database: PostgreSQL
  • Logging & Monitoring: Prometheus + Grafana
  • CI/CD: GitHub Actions for build, tests, and Docker image publishing

Getting Started

Prerequisites

  • JDK 17+
  • Docker and Docker Compose
  • Android Studio or IntelliJ IDEA

Running the Backend

  1. Navigate to the backend directory:

    cd backend
  2. Start all backend services using Docker Compose:

    docker-compose up -d
  3. Or run a specific service locally for development:

    ./gradlew :backend:auth-service:run

API Endpoints

Authentication

  • POST /auth/signup/email - Sign up with email/password
  • POST /auth/login/email - Login with email/password
  • POST /auth/oauth/google - Login with Google
  • POST /auth/oauth/apple - Login with Apple

User Profile

  • GET /user/profile - Get user profile
  • PUT /user/profile - Update user profile

Meals

  • GET /meals?date=YYYY-MM-DD - Get meals for a specific date
  • POST /meals - Log a meal
  • PUT /meals/{id} - Update a meal
  • DELETE /meals/{id} - Delete a meal

Weight & Measurements

  • GET /weights?from=DATE&to=DATE - Get weight entries in a date range
  • POST /weights - Log weight
  • GET /measurements?week=YYYY-WW - Get measurements for a specific week
  • POST /measurements - Log measurements

AI Chat

  • WS /chat/ws - WebSocket for AI chat
  • POST /chat/message - Send a message to AI

Subscriptions

  • GET /subscriptions - Get user subscription info
  • POST /subscriptions - Purchase a subscription
  • DELETE /subscriptions/{id} - Cancel a subscription

Development

Adding a New Service

  1. Create a new directory under backend/
  2. Add the service to settings.gradle.kts
  3. Use the common library for shared utilities
  4. Add the service to docker-compose.yml

Testing

Run all tests with:

./gradlew test

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Full AI Demo project (backend + mobile_app + frontend)

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages