# njogubless/mwendo architecture

> Architecture diagram of the GitHub repository njogubless/mwendo, 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/njogubless/mwendo
- Repository: https://github.com/njogubless/mwendo

## Overview

Mwendo is an adaptive routine and personal-progress app. Its documented user journey is to manage routines, work through a daily plan, and review progress; the sampled tracking service materializes plans and supports completion and adaptation. The tree also identifies accounts, goals, and insights API subsystems, but their detailed behavior and endpoint wiring were not sampled. The Flutter application sources are not present in the supplied tree, so the graph focuses on the backend and does not infer mobile-to-API calls.

Main entry points: [`backend/apps/tracking/services.py`](https://github.com/njogubless/mwendo/blob/main/backend/apps/tracking/services.py) (Day operations), [`backend/apps/routines/services.py`](https://github.com/njogubless/mwendo/blob/main/backend/apps/routines/services.py) (Routine services), [`backend/apps/accounts/services.py`](https://github.com/njogubless/mwendo/blob/main/backend/apps/accounts/services.py) (Account services), [`backend/config/urls.py`](https://github.com/njogubless/mwendo/blob/main/backend/config/urls.py) (Django API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and accounts"]
  node_api["Django API<br/>[urls.py]"]
  node_accounts["Accounts"]
  node_account_service["Account services<br/>[services.py]"]
end

subgraph group_routines["Routine management"]
  node_routine_api["Routine endpoints<br/>[views.py]"]
  node_routine_service["Routine services<br/>[services.py]"]
  node_routine_data["Routine data<br/>[models.py]"]
end

subgraph group_tracking["Daily tracking"]
  node_tracking_api["Tracking endpoints<br/>[views.py]"]
  node_tracking_service["Day operations<br/>[services.py]"]
  node_tracking_domain["Adaptation logic"]
  node_tracking_data["Plan and completion data<br/>[models.py]"]
end

subgraph group_progress["Goals and insights"]
  node_goals_api["Goal endpoints<br/>[views.py]"]
  node_goals_data["Goal data<br/>[models.py]"]
  node_insights_api["Insights endpoints<br/>[views.py]"]
  node_insights_selectors["Progress queries<br/>[selectors.py]"]
end

node_person(("App user"))
node_email["Email service"]
node_database[("PostgreSQL")]

node_person -->|"uses"| node_api
node_account_service -->|"sends reset email"| node_email
node_routine_service -->|"syncs today's plan"| node_tracking_service
node_routine_service -->|"writes routines"| node_routine_data
node_tracking_service -->|"plans adaptations"| node_tracking_domain
node_tracking_service -->|"updates plans"| node_tracking_data
node_account_service -->|"stores accounts"| node_database
node_routine_service -->|"stores routines"| node_database
node_tracking_service -->|"stores tracking"| node_database

click node_api "https://github.com/njogubless/mwendo/blob/main/backend/config/urls.py"
click node_accounts "https://github.com/njogubless/mwendo/tree/main/backend/apps/accounts"
click node_account_service "https://github.com/njogubless/mwendo/blob/main/backend/apps/accounts/services.py"
click node_routine_api "https://github.com/njogubless/mwendo/blob/main/backend/apps/routines/views.py"
click node_routine_service "https://github.com/njogubless/mwendo/blob/main/backend/apps/routines/services.py"
click node_routine_data "https://github.com/njogubless/mwendo/blob/main/backend/apps/routines/models.py"
click node_tracking_api "https://github.com/njogubless/mwendo/blob/main/backend/apps/tracking/views.py"
click node_tracking_service "https://github.com/njogubless/mwendo/blob/main/backend/apps/tracking/services.py"
click node_tracking_domain "https://github.com/njogubless/mwendo/tree/main/backend/apps/tracking/domain"
click node_tracking_data "https://github.com/njogubless/mwendo/blob/main/backend/apps/tracking/models.py"
click node_goals_api "https://github.com/njogubless/mwendo/blob/main/backend/apps/goals/views.py"
click node_goals_data "https://github.com/njogubless/mwendo/blob/main/backend/apps/goals/models.py"
click node_insights_api "https://github.com/njogubless/mwendo/blob/main/backend/apps/insights/views.py"
click node_insights_selectors "https://github.com/njogubless/mwendo/blob/main/backend/apps/insights/selectors.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_api,node_accounts,node_account_service,node_person toneBlue
class node_routine_api,node_routine_service,node_routine_data,node_database toneAmber
class node_tracking_api,node_tracking_service,node_tracking_domain,node_tracking_data toneMint
class node_goals_api,node_goals_data,node_insights_api,node_insights_selectors toneRose
class node_email toneIndigo
```

## Components

### API and accounts

- [Django API](https://github.com/njogubless/mwendo/blob/main/backend/config/urls.py): `backend/config/urls.py`
- [Accounts](https://github.com/njogubless/mwendo/tree/main/backend/apps/accounts): `backend/apps/accounts`
- [Account services](https://github.com/njogubless/mwendo/blob/main/backend/apps/accounts/services.py): `backend/apps/accounts/services.py`

### Routine management

- [Routine endpoints](https://github.com/njogubless/mwendo/blob/main/backend/apps/routines/views.py): `backend/apps/routines/views.py`
- [Routine services](https://github.com/njogubless/mwendo/blob/main/backend/apps/routines/services.py): `backend/apps/routines/services.py`
- [Routine data](https://github.com/njogubless/mwendo/blob/main/backend/apps/routines/models.py): `backend/apps/routines/models.py`

### Daily tracking

- [Tracking endpoints](https://github.com/njogubless/mwendo/blob/main/backend/apps/tracking/views.py): `backend/apps/tracking/views.py`
- [Day operations](https://github.com/njogubless/mwendo/blob/main/backend/apps/tracking/services.py): `backend/apps/tracking/services.py`
- [Adaptation logic](https://github.com/njogubless/mwendo/tree/main/backend/apps/tracking/domain): `backend/apps/tracking/domain`
- [Plan and completion data](https://github.com/njogubless/mwendo/blob/main/backend/apps/tracking/models.py): `backend/apps/tracking/models.py`

### Goals and insights

- [Goal endpoints](https://github.com/njogubless/mwendo/blob/main/backend/apps/goals/views.py): `backend/apps/goals/views.py`
- [Goal data](https://github.com/njogubless/mwendo/blob/main/backend/apps/goals/models.py): `backend/apps/goals/models.py`
- [Insights endpoints](https://github.com/njogubless/mwendo/blob/main/backend/apps/insights/views.py): `backend/apps/insights/views.py`
- [Progress queries](https://github.com/njogubless/mwendo/blob/main/backend/apps/insights/selectors.py): `backend/apps/insights/selectors.py`

### Other components

- **App user**
- **Email service**
- **PostgreSQL**

## Connections

- App user → Django API: uses
- Account services → Email service: sends reset email
- Routine services → Day operations: syncs today's plan
- Routine services → Routine data: writes routines
- Day operations → Adaptation logic: plans adaptations
- Day operations → Plan and completion data: updates plans
- Account services → PostgreSQL: stores accounts
- Routine services → PostgreSQL: stores routines
- Day operations → PostgreSQL: stores tracking
