Skip to content

Repository files navigation

FitCore - AI-Powered Fitness App (Backend )

📌 Project Overview

FitCore is a cross-platform fitness app that offers AI-generated personalised meal plans and premium workout videos. The backend will be built using Django & Django REST Framework to serve as a robust API-driven system for both Android and ios clients.

Users will be able to:

  • Watch categorised workout videos
  • Receive AI-based meal plans
  • Track health data via smart devices or manual input
  • Subscribe or make one-time purchases for content

🏋️ FitCore System Architecture Overview

The FitCore app will follow a client-server architecture with several key components:

🧩 Key Components


📱 Client Applications

  • iOS and Android Apps: Built with React Native for cross-platform support.
  • Admin Web Dashboard: Used for managing content, users, and analytics.

🚪 API Gateway / Load Balancer

  • Routes requests to appropriate backend services.
  • Handles authentication, rate limiting, and request validation.
  • Ensures scalability and load distribution.

🧠 Backend Services

Service NameDescription
Authentication ServiceManages user sign-up, login, tokens, and OAuth.
User Profile ServiceStores and manages user data, goals, preferences, etc.
Content Management ServiceAllows admins to manage workout videos, meal plans, articles, etc.
Payment Processing ServiceHandles subscription billing and in-app purchases.
Health Data IntegrationSyncs with devices like Google Fit and Apple HealthKit.
AI Meal Plan GeneratorUses Openai API to generate personalised meal plans.
Notification ServiceSends push, email, and in-app notifications.
Analytics ServiceTracks user engagement, health trends, and admin reports.

☁️ External Services & Storage

ComponentPurpose
PostgreSQL DatabaseRelational data storage for core app data.
AWS S3 / CloudinaryStores media files like images, videos, and documents.
OpenAI APIGenerates AI-driven meal plans and suggestions.
Payment GatewaysIntegrates Stripe, PayPal, etc. for handling payments.
Health Data ProvidersSyncs data from Google Fit, Apple HealthKit, etc.

FitCore - Relational Database Design & Architecture

ER Diagram


📐 Entity Relationship Diagram Overview

🧱 Database Models

  • User: Stores basic user credentials and serves as the central entity linked to almost all other components.
  • users_profiles: Contains extended user information like age, weight, height, gender, and fitness goals.
  • HealthData: Tracks users' health metrics such as heart rate and other measurable health indicators over time.
  • MealPlan: Stores a user’s daily or AI-generated nutritional plan, including calories, macros (protein, carbs, fats), and date.
  • meal: Details individual meals within a meal plan, including ingredients, macros, description, recipe, and mealtime.
  • workout: Defines high-level workout goals, difficulty level, categories, and whether it's a premium plan.
  • WorkoutVideo: Each workout can include multiple videos with order index, duration, thumbnails, and access settings (free/premium).
  • Subscription: Stores data about users’ active or past subscription plans, including plan type and validity.
  • Payments: Logs payment transactions related to subscriptions or other purchases, along with plan details and transaction status.
  • Purchases: Stores non-subscription purchases like premium workout plans or meal packages.
  • Notification: Contains app notifications specific to users, such as messages, alerts, or updates.
  • UserWorkoutProgress: Tracks a user's progress for each workout, including completion timestamp and progress percentage.

🔄 Database Relationships

  • UsersUsersProfile, HealthData, Subscriptions, Payments, Notifications, MealPlan, UserWorkoutProgress, Purchases
  • MealPlanMeal (One-to-Many)
  • WorkoutWorkoutVideo (One-to-Many)
  • UsersUserWorkoutProgress (One-to-Many)
  • WorkoutUserWorkoutProgress (Many-to-Many through tracking)
  • WorkoutPurchases (for purchasing premium content)
  • UsersWorkout (via Progress and Purchases)

📌 API Endpoints

All endpoints are categorised by service, along with HTTP methods, descriptions, and estimated implementation times.


🔐 Authentication Service

EndpointMethodDescriptionTime Estimate
/api/auth/registerPOSTRegister a new user1 day
/api/auth/loginPOSTLogin with email/password1 day
/api/auth/social/googlePOSTGoogle OAuth login1.5 days
/api/auth/social/applePOSTApple OAuth login1.5 days
/api/auth/refresh-tokenPOSTRefresh JWT token0.5 day
/api/auth/password-resetPOSTRequest password reset1 day
/api/auth/password-reset/confirmPOSTConfirm password reset1 day

👤 User Service

EndpointMethodDescriptionTime Estimate
/api/users/profileGETGet user profile0.5 day
/api/users/profilePUTUpdate user profile0.5 day
/api/users/settingsGETGet user settings0.5 day
/api/users/settingsPUTUpdate user settings0.5 day
/api/users/progressGETGet user fitness progress1 day
/api/users/favoritesGETGet user favorite workouts/meals0.5 day
/api/users/favoritesPOSTAdd to favorites0.5 day
/api/users/favorites/:idDELETERemove from favorites0.5 day
/api/users/dashboardGETGet user dashboard summaryundefine

🧬 Health Data Service

EndpointMethodDescriptionTime Estimate
/api/health/dataGETGet user health data1 day
/api/health/dataPOSTAdd manual health data1 day
/api/health/sync/google-fitPOSTSync with Google Fitundefine
/api/health/sync/apple-healthPOSTSync with Apple HealthKitundefine
/api/health/metricsGETGet user health metrics1 day
/api/health/goalsGETGet fitness goals0.5 day
/api/health/goalsPUTUpdate fitness goals0.5 day

🏋️‍♂️ Workouts

EndpointMethodDescriptionTime Estimate
/api/workoutsGETList workouts with filters1 day
/api/workouts/:idGETGet workout details0.5 day
/api/workouts/categoriesGETGet workout categories0.5 day
/api/workouts/featuredGETGet featured workouts0.5 day
/api/workouts/:id/videosGETGet workout videos1 day
/api/workouts/:id/progressPOSTUpdate workout progress2 day
/api/workouts/:id/ratePOSTRate a workout0.5 day
/api/workouts/searchGETSearch workouts1 day

⚙️ Admin Endpoints

EndpointMethodDescriptionTime Estimate
/api/admin/workoutsGETList all workouts (admin)0.5 day
/api/admin/workoutsPOSTCreate workout (admin)1 day
/api/admin/workouts/:idPUTUpdate workout (admin)1 day
/api/admin/workouts/:idDELETEDelete workout (admin)0.5 day
/api/admin/videosPOSTUpload workout video (admin)1.5 days
/api/admin/videos/:idPUTUpdate video (admin)1 day
/api/admin/videos/:idDELETEDelete video (admin)0.5 day
/api/admin/usersGETList users (admin)1 day
/api/admin/analyticsGETGet platform analytics (admin)undefine

🥗 Meal Plan Service - Manual Endpoints

EndpointMethodDescriptionTime Estimate
/api/meals/plansPOSTCreate a manual meal plan1 days
/api/meals/plans/:idPUTUpdate meal plan1 day
/api/meals/plans/:idDELETECancel user meal plan0.5 day

🧠 AI Meal Plan Service

EndpointMethodDescriptionTime Estimate
/api/meals/plansGETGet user meal plans.5 day
/api/meals/plans/generatePOSTGenerate AI meal planundefine
/api/meals/plans/:idGETGet specific meal plan.5 day
/api/meals/plans/:idDELETEDelete meal planundefine
/api/meals/templatesGETGet meal plan templatesundefine
/api/meals/foodsGETSearch foods database.5 day

💳 Payment Service

EndpointMethodDescriptionTime Estimate
/api/payments/subscriptionsGETGet user subscriptions0.5 day
/api/payments/subscriptionsPOSTCreate subscription2 days
/api/payments/subscriptions/:idPUTUpdate subscription1 day
/api/payments/subscriptions/:id/cancelPOSTCancel subscription1 day
/api/payments/purchasesGETGet user purchases0.5 day
/api/payments/purchasesPOSTMake one-time purchase2 days
/api/payments/methodsGETGet payment methods0.5 day
/api/payments/methodsPOSTAdd payment method1 day
/api/payments/methods/:idDELETERemove payment method0.5 day
/api/payments/webhooksPOSTPayment provider webhooks1.5 days

🔔 Notification Service

EndpointMethodDescriptionTime Estimate
/api/notificationsGETGet user notifications0.5 day
/api/notifications/:id/readPUTMark notification as read0.5 day
/api/notifications/settingsGETGet notification settings0.5 day
/api/notifications/settingsPUTUpdate notification settings1 day
/api/notifications/subscribePOSTSubscribe to push notifications1 day
/api/notifications/unsubscribePOSTUnsubscribe from push notifications0.5 day

🛒 Monetization

  • Monthly/Yearly Subscription: Unlock full access
  • One-time Purchase: Buy specific videos or plans
  • Free Tier: Access limited features and samples

🗂️ Tech Stack

  • Backend: Django, Django REST Framework
  • Database: PostgreSQL
  • Authentication: JWT, OAuth2
  • AI Integration: OpenAI API / Custom ML
  • Media: AWS S3 or Cloudinary
  • Payments: Google Play Billing, Apple IAP, Stripe (for web)

About

FitCore is a cross-platform fitness app that offers AI-generated personalised meal plans and premium workout videos. The backend will be built using Django & Django REST Framework to serve as a robust API-driven system for both Android and ios clients.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages