Skip to content

TheIronJoe/old-fits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Old Fits Fits

Fitness app for older athletes. Joints first. Ego second.

Stack

Layer Technology
Frontend React 18 + Vite (mobile-first)
Backend FastAPI (Python 3.12)
Database PostgreSQL 16
MCP Server Python MCP SDK (stdio)
Reverse Proxy Nginx
Container Docker Compose

Quick Start (dev — no SSL)

cp .env.example .env
# Edit .env — set passwords and SECRET_KEY

# Use the dev nginx config (no SSL required locally)
cp nginx/nginx.dev.conf nginx/nginx.conf

docker compose up --build

App at http://localhost API docs at http://localhost/api/docs


Production Setup (Debian VM)

  1. Copy project to your server
  2. Obtain SSL certs (e.g. Let's Encrypt) and place in nginx/ssl/:
    • nginx/ssl/fullchain.pem
    • nginx/ssl/privkey.pem
  3. Set up .env with strong secrets
  4. docker compose up -d --build

MCP Server (Claude Admin Interface)

The MCP server lets an admin interact with Claude via natural language to populate and manage the exercise database.

Connecting Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "old-fits": {
      "command": "docker",
      "args": ["exec", "-i", "oldfits_mcp", "python", "server.py"],
      "env": {}
    }
  }
}

Available Tools

Tool Description
add_exercise Add a new exercise (Claude fills most fields automatically)
search_exercises Search by name, muscle, equipment, type
update_exercise Update any field on an exercise
get_exercises_by_category Filter/audit exercises by category or missing fields
tag_exercise Add or replace tags on an exercise

Example prompts for admin

Add 20 upper body exercises suitable for men over 55 with shoulder limitations.

Find all exercises where video_url is missing.

Update exercise 42 — set ego_check_rating to 9 and add the tag "ego-trap".

Add all major hip mobility exercises with zero impact, and tag them "hip-friendly".

API Endpoints

Method Path Description
POST /auth/register Create account
POST /auth/login Get JWT token
GET /auth/me Current user
GET /exercises/ List/filter exercises
GET /exercises/search?q= Full-text search
GET /exercises/{id} Exercise detail
POST /exercises/ Create exercise (admin)
PATCH /exercises/{id} Update exercise (admin)
GET /workouts/ User's workouts
POST /workouts/ Create workout
GET /admin/stats Platform stats (admin)
GET /admin/users User list (admin)

Project Structure

old-fits/
├── docker-compose.yml
├── .env.example
├── nginx/
│   ├── Dockerfile
│   ├── nginx.conf          ← production (SSL)
│   └── nginx.dev.conf      ← development (no SSL)
├── backend/
│   ├── Dockerfile
│   ├── requirements.txt
│   └── app/
│       ├── main.py
│       ├── config.py
│       ├── database.py
│       ├── models.py
│       ├── schemas.py
│       ├── auth.py
│       └── routers/
│           ├── auth.py
│           ├── exercises.py
│           ├── workouts.py
│           └── admin.py
├── mcp-server/
│   ├── Dockerfile
│   ├── requirements.txt
│   └── server.py
├── frontend/
│   ├── Dockerfile
│   ├── package.json
│   ├── vite.config.js
│   ├── index.html
│   └── src/
│       ├── index.jsx
│       ├── App.jsx
│       ├── context/AuthContext.jsx
│       ├── hooks/useApi.js
│       ├── components/
│       │   ├── Navbar.jsx
│       │   └── ExerciseCard.jsx
│       └── pages/
│           ├── Login.jsx
│           ├── Register.jsx
│           ├── Dashboard.jsx
│           ├── Exercises.jsx
│           ├── ExerciseDetail.jsx
│           └── Workouts.jsx
└── db/
    └── init.sql

First Admin Account

Register normally via the app, then run:

UPDATE users SET is_admin = TRUE WHERE email = 'your@email.com';

Or via docker:

docker exec -it oldfits_db psql -U oldfits_user -d oldfits \
  -c "UPDATE users SET is_admin = TRUE WHERE email = 'your@email.com';"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors