# wger-project/wger architecture

> Architecture diagram of the GitHub repository wger-project/wger, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wger-project/wger
- Repository: https://github.com/wger-project/wger

## Overview

wger is a self-hostable fitness manager. Users access it through its web interface or REST API to build workout routines, consult the exercise wiki, record workout and body measurements, manage nutrition, and review progress. Gym administration and achievement tracking extend that core workflow. The tree identifies separate Django app boundaries; the README documents the major capabilities. Only the dynamic-measurement reconciliation implementation was sampled, so other app-to-app wiring is not inferred.

Main entry points: [`wger/core/api`](https://github.com/wger-project/wger/tree/master/wger/core/api) (REST API), [`wger/measurements/dynamic/engine.py`](https://github.com/wger-project/wger/blob/master/wger/measurements/dynamic/engine.py) (Application database), [`wger/manager`](https://github.com/wger-project/wger/tree/master/wger/manager) (Workout routines), [`wger/nutrition`](https://github.com/wger-project/wger/tree/master/wger/nutrition) (Nutrition plans)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Access and accounts"]
  node_web["Web interface<br/>[urls.py]"]
  node_api["REST API"]
  node_accounts["Accounts and profiles"]
end

subgraph group_training["Training"]
  node_routines["Workout routines"]
  node_exercises["Exercise wiki"]
  node_workoutlogs["Workout logs<br/>[log.py]"]
end

subgraph group_health["Health tracking"]
  node_nutrition["Nutrition plans"]
  node_weight["Body weight"]
  node_measurements["Measurements"]
  node_gallery["Progress gallery"]
end

subgraph group_community["Community and gyms"]
  node_gym["Gym management"]
  node_trophies["Achievements"]
end

subgraph group_platform["Platform services"]
  node_db[("Application database<br/>[engine.py]")]
end

node_person(("User"))
node_off["Open Food Facts"]
node_mobile(("Mobile apps"))

node_person -->|"uses"| node_web
node_person -->|"requests"| node_api
node_mobile -->|"integrates"| node_api
node_web -->|"serves"| node_accounts
node_api -->|"authenticates"| node_accounts
node_api -->|"serves"| node_routines
node_api -->|"serves"| node_exercises
node_api -->|"serves"| node_nutrition
node_api -->|"serves"| node_measurements
node_api -->|"serves"| node_weight
node_api -->|"serves"| node_gallery
node_api -->|"serves"| node_gym
node_api -->|"serves"| node_trophies
node_routines -->|"records"| node_workoutlogs
node_nutrition -.->|"product data"| node_off
node_routines -->|"stores"| node_db
node_exercises -->|"stores"| node_db
node_workoutlogs -->|"stores"| node_db
node_nutrition -->|"stores"| node_db
node_weight -->|"stores"| node_db
node_measurements -->|"reconciles calculated rows"| node_db
node_gallery -->|"stores"| node_db
node_gym -->|"stores"| node_db
node_trophies -->|"stores"| node_db

click node_web "https://github.com/wger-project/wger/blob/master/wger/urls.py"
click node_api "https://github.com/wger-project/wger/tree/master/wger/core/api"
click node_accounts "https://github.com/wger-project/wger/tree/master/wger/core"
click node_routines "https://github.com/wger-project/wger/tree/master/wger/manager"
click node_exercises "https://github.com/wger-project/wger/tree/master/wger/exercises"
click node_workoutlogs "https://github.com/wger-project/wger/blob/master/wger/manager/models/log.py"
click node_nutrition "https://github.com/wger-project/wger/tree/master/wger/nutrition"
click node_weight "https://github.com/wger-project/wger/tree/master/wger/weight"
click node_measurements "https://github.com/wger-project/wger/tree/master/wger/measurements"
click node_gallery "https://github.com/wger-project/wger/tree/master/wger/gallery"
click node_gym "https://github.com/wger-project/wger/tree/master/wger/gym"
click node_trophies "https://github.com/wger-project/wger/tree/master/wger/trophies"
click node_db "https://github.com/wger-project/wger/blob/master/wger/measurements/dynamic/engine.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_api,node_accounts,node_person toneBlue
class node_routines,node_exercises,node_workoutlogs toneAmber
class node_nutrition,node_weight,node_measurements,node_gallery toneMint
class node_gym,node_trophies toneRose
class node_db,node_off,node_mobile toneIndigo
```

## Components

### Access and accounts

- [Web interface](https://github.com/wger-project/wger/blob/master/wger/urls.py): `wger/urls.py`
- [REST API](https://github.com/wger-project/wger/tree/master/wger/core/api): `wger/core/api`
- [Accounts and profiles](https://github.com/wger-project/wger/tree/master/wger/core): `wger/core`

### Training

- [Workout routines](https://github.com/wger-project/wger/tree/master/wger/manager): `wger/manager`
- [Exercise wiki](https://github.com/wger-project/wger/tree/master/wger/exercises): `wger/exercises`
- [Workout logs](https://github.com/wger-project/wger/blob/master/wger/manager/models/log.py): `wger/manager/models/log.py`

### Health tracking

- [Nutrition plans](https://github.com/wger-project/wger/tree/master/wger/nutrition): `wger/nutrition`
- [Body weight](https://github.com/wger-project/wger/tree/master/wger/weight): `wger/weight`
- [Measurements](https://github.com/wger-project/wger/tree/master/wger/measurements): `wger/measurements`
- [Progress gallery](https://github.com/wger-project/wger/tree/master/wger/gallery): `wger/gallery`

### Community and gyms

- [Gym management](https://github.com/wger-project/wger/tree/master/wger/gym): `wger/gym`
- [Achievements](https://github.com/wger-project/wger/tree/master/wger/trophies): `wger/trophies`

### Platform services

- [Application database](https://github.com/wger-project/wger/blob/master/wger/measurements/dynamic/engine.py): `wger/measurements/dynamic/engine.py`

### Other components

- **User**
- **Open Food Facts**
- **Mobile apps**

## Connections

- User → Web interface: uses
- User → REST API: requests
- Mobile apps → REST API: integrates
- Web interface → Accounts and profiles: serves
- REST API → Accounts and profiles: authenticates
- REST API → Workout routines: serves
- REST API → Exercise wiki: serves
- REST API → Nutrition plans: serves
- REST API → Measurements: serves
- REST API → Body weight: serves
- REST API → Progress gallery: serves
- REST API → Gym management: serves
- REST API → Achievements: serves
- Workout routines → Workout logs: records
- Nutrition plans → Open Food Facts: product data
- Workout routines → Application database: stores
- Exercise wiki → Application database: stores
- Workout logs → Application database: stores
- Nutrition plans → Application database: stores
- Body weight → Application database: stores
- Measurements → Application database: reconciles calculated rows
- Progress gallery → Application database: stores
- Gym management → Application database: stores
- Achievements → Application database: stores
