# walllu/marketdays architecture

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

- Interactive diagram: https://gitdiagram.com/walllu/marketdays
- Repository: https://github.com/walllu/marketdays

## Overview

MarketDays is a Django trading application for local, time-bounded markets: users join a session, list items, propose or respond to exchanges, and ultimately exchange items in person. The central runtime path is browser request → URL routing → views, which coordinate forms and persistent domain records and render pages. Profiles, session participation, item ownership, offers, and offer contents are distinct domain stages. The README also describes authentication and market-location exchange. Source excerpts are partial, so unshown feature-specific connections are omitted.

Main entry points: [`market/views.py`](https://github.com/walllu/marketdays/blob/master/market/views.py) (Request handlers), [`MarketDays/urls.py`](https://github.com/walllu/marketdays/blob/master/MarketDays/urls.py) (Project routing), [`market/forms.py`](https://github.com/walllu/marketdays/blob/master/market/forms.py) (Profile and item forms), [`market/models.py`](https://github.com/walllu/marketdays/blob/master/market/models.py) (Tradeable items)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry and pages"]
  node_project_routes["Project routing<br/>[urls.py]"]
  node_market_routes["Market routing<br/>[urls.py]"]
  node_market_views["Request handlers<br/>[views.py]"]
  node_market_pages["Market pages"]
end

subgraph group_trade["Trading domain"]
  node_items["Tradeable items<br/>[models.py]"]
  node_offers["Trade offers<br/>[models.py]"]
  node_offer_contents["Offer item sides<br/>[models.py]"]
end

subgraph group_identity["Accounts and sessions"]
  node_registration_pages["Account pages"]
  node_forms["Profile and item forms<br/>[forms.py]"]
  node_profiles["User profiles<br/>[models.py]"]
  node_sessions["Market sessions<br/>[models.py]"]
  node_registration_service["Registration package"]
end

subgraph group_persistence["Persistent state"]
  node_database[("Relational database")]
end

node_visitor(("Market user"))

node_visitor -->|"requests pages"| node_project_routes
node_project_routes -->|"includes routes"| node_market_routes
node_project_routes -->|"routes requests"| node_market_views
node_market_routes -->|"routes requests"| node_market_views
node_market_views -->|"uses forms"| node_forms
node_market_views -->|"reads and writes"| node_profiles
node_market_views -->|"reads and writes"| node_sessions
node_market_views -->|"reads and writes"| node_items
node_market_views -->|"reads and writes"| node_offers
node_market_views -->|"creates trade sides"| node_offer_contents
node_market_views -->|"renders pages"| node_market_pages
node_forms -->|"validates profile"| node_profiles
node_forms -->|"validates item"| node_items
node_profiles -->|"persists records"| node_database
node_sessions -->|"persists records"| node_database
node_items -->|"persists records"| node_database
node_offers -->|"persists records"| node_database
node_offer_contents -->|"persists records"| node_database
node_project_routes -->|"includes registration"| node_registration_service
node_visitor -.->|"registers or logs in"| node_registration_pages
node_visitor -.->|"exchanges in person"| node_database

click node_project_routes "https://github.com/walllu/marketdays/blob/master/MarketDays/urls.py"
click node_market_routes "https://github.com/walllu/marketdays/blob/master/market/urls.py"
click node_market_views "https://github.com/walllu/marketdays/blob/master/market/views.py"
click node_market_pages "https://github.com/walllu/marketdays/tree/master/templates/market"
click node_registration_pages "https://github.com/walllu/marketdays/tree/master/templates/registration"
click node_forms "https://github.com/walllu/marketdays/blob/master/market/forms.py"
click node_profiles "https://github.com/walllu/marketdays/blob/master/market/models.py"
click node_sessions "https://github.com/walllu/marketdays/blob/master/market/models.py"
click node_items "https://github.com/walllu/marketdays/blob/master/market/models.py"
click node_offers "https://github.com/walllu/marketdays/blob/master/market/models.py"
click node_offer_contents "https://github.com/walllu/marketdays/blob/master/market/models.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_project_routes,node_market_routes,node_market_views,node_market_pages,node_visitor toneBlue
class node_items,node_offers,node_offer_contents toneAmber
class node_registration_pages,node_forms,node_profiles,node_sessions,node_registration_service toneMint
class node_database toneRose
```

## Components

### Web entry and pages

- [Project routing](https://github.com/walllu/marketdays/blob/master/MarketDays/urls.py): `MarketDays/urls.py`
- [Market routing](https://github.com/walllu/marketdays/blob/master/market/urls.py): `market/urls.py`
- [Request handlers](https://github.com/walllu/marketdays/blob/master/market/views.py): `market/views.py`
- [Market pages](https://github.com/walllu/marketdays/tree/master/templates/market): `templates/market`

### Trading domain

- [Tradeable items](https://github.com/walllu/marketdays/blob/master/market/models.py): `market/models.py`
- [Trade offers](https://github.com/walllu/marketdays/blob/master/market/models.py): `market/models.py`
- [Offer item sides](https://github.com/walllu/marketdays/blob/master/market/models.py): `market/models.py`

### Accounts and sessions

- [Account pages](https://github.com/walllu/marketdays/tree/master/templates/registration): `templates/registration`
- [Profile and item forms](https://github.com/walllu/marketdays/blob/master/market/forms.py): `market/forms.py`
- [User profiles](https://github.com/walllu/marketdays/blob/master/market/models.py): `market/models.py`
- [Market sessions](https://github.com/walllu/marketdays/blob/master/market/models.py): `market/models.py`
- **Registration package**

### Persistent state

- **Relational database**

### Other components

- **Market user**

## Connections

- Market user → Project routing: requests pages (evidence: `MarketDays/urls.py`)
- Project routing → Market routing: includes routes (evidence: `MarketDays/urls.py`)
- Project routing → Request handlers: routes requests (evidence: `MarketDays/urls.py`)
- Market routing → Request handlers: routes requests (evidence: `market/urls.py`)
- Request handlers → Profile and item forms: uses forms (evidence: `market/views.py`)
- Request handlers → User profiles: reads and writes (evidence: `market/views.py`)
- Request handlers → Market sessions: reads and writes (evidence: `market/views.py`)
- Request handlers → Tradeable items: reads and writes (evidence: `market/views.py`)
- Request handlers → Trade offers: reads and writes (evidence: `market/views.py`)
- Request handlers → Offer item sides: creates trade sides (evidence: `market/views.py`)
- Request handlers → Market pages: renders pages (evidence: `market/views.py`)
- Profile and item forms → User profiles: validates profile (evidence: `market/forms.py`)
- Profile and item forms → Tradeable items: validates item (evidence: `market/forms.py`)
- User profiles → Relational database: persists records (evidence: `market/models.py`)
- Market sessions → Relational database: persists records (evidence: `market/models.py`)
- Tradeable items → Relational database: persists records (evidence: `market/models.py`)
- Trade offers → Relational database: persists records (evidence: `market/models.py`)
- Offer item sides → Relational database: persists records (evidence: `market/models.py`)
- Project routing → Registration package: includes registration (evidence: `MarketDays/urls.py`)
- Market user → Account pages: registers or logs in (evidence: `README.md`)
- Market user → Relational database: exchanges in person (evidence: `README.md`)
