# upstairs-aura/mf-pg_track architecture

> Architecture diagram of the GitHub repository upstairs-aura/mf-pg_track, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/upstairs-aura/mf-pg_track
- Repository: https://github.com/upstairs-aura/mf-pg_track

## Overview

This Django project is a manager-facing project/location tracker. Managers sign in, browse locations and scoped task lists, update tasks, and review progress; the application also provides access controls, reports, online status, and historical snapshots. The excerpts show model persistence and URL routing, but views.py is partial, so detailed links among its individual workflows are limited to routes and calls explicitly shown. The database is configured as PostgreSQL; snapshot creation is a separate management command.

Main entry points: [`tracker/views.py`](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py) (Tracking views), [`tracker/models.py`](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/models.py) (Tracking records), [`tracker/urls.py`](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/urls.py) (URL routes), [`tracker/middleware.py`](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/middleware.py) (Manager session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry and session"]
  node_routes["URL routes<br/>[urls.py]"]
  node_session["Manager session<br/>[middleware.py]"]
  node_browser["Tracker interface<br/>[app.js]"]
end

subgraph group_tracking["Project tracking"]
  node_views["Tracking views<br/>[views.py]"]
  node_location["Location tracking<br/>[views.py]"]
  node_tasks["Task management<br/>[views.py]"]
  node_domain["Tracking records<br/>[models.py]"]
  node_database[("PostgreSQL")]
end

subgraph group_governance["Access and history"]
  node_access["Access management<br/>[views.py]"]
  node_adminreset["Admin reset<br/>[views.py]"]
  node_history["Archive and snapshots<br/>[take_snapshot.py]"]
  node_snapshotview["Snapshot views<br/>[views.py]"]
end

subgraph group_reporting["Reports"]
  node_reportdata["Report generation<br/>[views.py]"]
  node_theme["Report theme<br/>[report_theme.py]"]
  node_reporttemplates["Report templates"]
  node_staticstyles["Shared status styles<br/>[styles.css]"]
end

node_manager(("Manager"))

node_manager -->|"requests pages"| node_routes
node_routes -->|"dispatches to"| node_views
node_session -->|"sets manager context"| node_views
node_browser -->|"polls online status"| node_views
node_browser -->|"redirects on idle"| node_routes
node_views -->|"handles location workflows"| node_location
node_views -->|"handles task workflows"| node_tasks
node_views -->|"handles access workflows"| node_access
node_views -->|"handles reset route"| node_adminreset
node_views -->|"handles archive views"| node_snapshotview
node_views -->|"handles report routes"| node_reportdata
node_location -->|"creates records"| node_domain
node_tasks -->|"reads and updates"| node_domain
node_domain -->|"persists models"| node_database
node_session -->|"looks up manager"| node_domain
node_history -->|"reads tracking data"| node_domain
node_history -->|"stores snapshot"| node_snapshotview
node_snapshotview -->|"reads snapshots"| node_domain
node_reportdata -->|"loads report colors"| node_theme
node_reportdata -->|"renders report HTML"| node_reporttemplates
node_theme -->|"reads CSS palette"| node_staticstyles

click node_routes "https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/urls.py"
click node_session "https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/middleware.py"
click node_browser "https://github.com/upstairs-aura/mf-pg_track/blob/main/static/tracker/app.js"
click node_views "https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py"
click node_location "https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py"
click node_tasks "https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py"
click node_domain "https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/models.py"
click node_access "https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py"
click node_adminreset "https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py"
click node_history "https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/management/commands/take_snapshot.py"
click node_snapshotview "https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py"
click node_reportdata "https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py"
click node_theme "https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/report_theme.py"
click node_reporttemplates "https://github.com/upstairs-aura/mf-pg_track/tree/main/templates/tracker/reports"
click node_staticstyles "https://github.com/upstairs-aura/mf-pg_track/blob/main/static/tracker/styles.css"

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_routes,node_session,node_browser toneBlue
class node_views,node_location,node_tasks,node_domain,node_database toneAmber
class node_access,node_adminreset,node_history,node_snapshotview toneMint
class node_reportdata,node_theme,node_reporttemplates,node_staticstyles toneRose
class node_manager toneIndigo
```

## Components

### Web entry and session

- [URL routes](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/urls.py): `tracker/urls.py`
- [Manager session](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/middleware.py): `tracker/middleware.py`
- [Tracker interface](https://github.com/upstairs-aura/mf-pg_track/blob/main/static/tracker/app.js): `static/tracker/app.js`

### Project tracking

- [Tracking views](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py): `tracker/views.py`
- [Location tracking](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py): `tracker/views.py`
- [Task management](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py): `tracker/views.py`
- [Tracking records](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/models.py): `tracker/models.py`
- **PostgreSQL**

### Access and history

- [Access management](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py): `tracker/views.py`
- [Admin reset](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py): `tracker/views.py`
- [Archive and snapshots](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/management/commands/take_snapshot.py): `tracker/management/commands/take_snapshot.py`
- [Snapshot views](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py): `tracker/views.py`

### Reports

- [Report generation](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/views.py): `tracker/views.py`
- [Report theme](https://github.com/upstairs-aura/mf-pg_track/blob/main/tracker/report_theme.py): `tracker/report_theme.py`
- [Report templates](https://github.com/upstairs-aura/mf-pg_track/tree/main/templates/tracker/reports): `templates/tracker/reports`
- [Shared status styles](https://github.com/upstairs-aura/mf-pg_track/blob/main/static/tracker/styles.css): `static/tracker/styles.css`

### Other components

- **Manager**

## Connections

- Manager → URL routes: requests pages (evidence: `tracker/urls.py`)
- URL routes → Tracking views: dispatches to (evidence: `tracker/urls.py`)
- Manager session → Tracking views: sets manager context (evidence: `tracker/middleware.py`)
- Tracker interface → Tracking views: polls online status (evidence: `static/tracker/app.js`)
- Tracker interface → URL routes: redirects on idle (evidence: `static/tracker/app.js`)
- Tracking views → Location tracking: handles location workflows (evidence: `tracker/urls.py`)
- Tracking views → Task management: handles task workflows (evidence: `tracker/urls.py`)
- Tracking views → Access management: handles access workflows (evidence: `tracker/urls.py`)
- Tracking views → Admin reset: handles reset route (evidence: `tracker/urls.py`)
- Tracking views → Snapshot views: handles archive views (evidence: `tracker/urls.py`)
- Tracking views → Report generation: handles report routes (evidence: `tracker/urls.py`)
- Location tracking → Tracking records: creates records (evidence: `tracker/views.py`)
- Task management → Tracking records: reads and updates (evidence: `tracker/views.py`)
- Tracking records → PostgreSQL: persists models
- Manager session → Tracking records: looks up manager (evidence: `tracker/middleware.py`)
- Archive and snapshots → Tracking records: reads tracking data (evidence: `tracker/management/commands/take_snapshot.py`)
- Archive and snapshots → Snapshot views: stores snapshot (evidence: `tracker/management/commands/take_snapshot.py`)
- Snapshot views → Tracking records: reads snapshots (evidence: `tracker/views.py`)
- Report generation → Report theme: loads report colors (evidence: `tracker/views.py`)
- Report generation → Report templates: renders report HTML (evidence: `tracker/views.py`)
- Report theme → Shared status styles: reads CSS palette (evidence: `tracker/report_theme.py`)
