# m1cckey/secure-shop architecture

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

- Interactive diagram: https://gitdiagram.com/m1cckey/secure-shop
- Repository: https://github.com/m1cckey/secure-shop

## Overview

secure-shop is a small Django demo site described as being for attack detection. Its visible request path is access-logging middleware, URL routing, page handlers, and rendered templates. The excerpts show page rendering and access-log writes, but no attack-detection logic, authentication processing, or search implementation; those paths should not be inferred from page names. The graph focuses on the evidenced runtime and configured request flow.

Main entry points: [`web/shop/middleware.py`](https://github.com/m1cckey/secure-shop/blob/main/web/shop/middleware.py) (Access middleware), [`web/web/settings.py`](https://github.com/m1cckey/secure-shop/blob/main/web/web/settings.py) (Django settings), [`web/web/urls.py`](https://github.com/m1cckey/secure-shop/blob/main/web/web/urls.py) (Project routes), [`web/shop/urls.py`](https://github.com/m1cckey/secure-shop/blob/main/web/shop/urls.py) (Shop routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_request["Request handling"]
  node_middleware["Access middleware<br/>[middleware.py]"]
  node_accesslog["Access log"]
  node_projecturls["Project routes<br/>[urls.py]"]
  node_shopurls["Shop routes<br/>[urls.py]"]
end

subgraph group_pages["Site pages"]
  node_views["Page handlers<br/>[views.py]"]
  node_templates["Page templates"]
end

subgraph group_config["Runtime configuration"]
  node_settings["Django settings<br/>[settings.py]"]
  node_jinjaenv["Jinja environment<br/>[jinja2env.py]"]
end

node_visitor(("Visitor"))

node_visitor -.->|"sends request"| node_middleware
node_middleware -->|"writes access entry"| node_accesslog
node_middleware -->|"passes request"| node_projecturls
node_projecturls -->|"includes routes"| node_shopurls
node_shopurls -->|"dispatches routes"| node_views
node_views -->|"renders pages"| node_templates
node_settings -->|"configures middleware"| node_middleware
node_settings -->|"selects routes"| node_projecturls
node_settings -->|"sets environment"| node_jinjaenv

click node_middleware "https://github.com/m1cckey/secure-shop/blob/main/web/shop/middleware.py"
click node_projecturls "https://github.com/m1cckey/secure-shop/blob/main/web/web/urls.py"
click node_shopurls "https://github.com/m1cckey/secure-shop/blob/main/web/shop/urls.py"
click node_views "https://github.com/m1cckey/secure-shop/blob/main/web/shop/views.py"
click node_templates "https://github.com/m1cckey/secure-shop/tree/main/web/templates"
click node_settings "https://github.com/m1cckey/secure-shop/blob/main/web/web/settings.py"
click node_jinjaenv "https://github.com/m1cckey/secure-shop/blob/main/web/shop/jinja2env.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_middleware,node_accesslog,node_projecturls,node_shopurls toneBlue
class node_views,node_templates toneAmber
class node_settings,node_jinjaenv toneMint
class node_visitor toneIndigo
```

## Components

### Request handling

- [Access middleware](https://github.com/m1cckey/secure-shop/blob/main/web/shop/middleware.py): `web/shop/middleware.py`
- **Access log**
- [Project routes](https://github.com/m1cckey/secure-shop/blob/main/web/web/urls.py): `web/web/urls.py`
- [Shop routes](https://github.com/m1cckey/secure-shop/blob/main/web/shop/urls.py): `web/shop/urls.py`

### Site pages

- [Page handlers](https://github.com/m1cckey/secure-shop/blob/main/web/shop/views.py): `web/shop/views.py`
- [Page templates](https://github.com/m1cckey/secure-shop/tree/main/web/templates): `web/templates`

### Runtime configuration

- [Django settings](https://github.com/m1cckey/secure-shop/blob/main/web/web/settings.py): `web/web/settings.py`
- [Jinja environment](https://github.com/m1cckey/secure-shop/blob/main/web/shop/jinja2env.py): `web/shop/jinja2env.py`

### Other components

- **Visitor**

## Connections

- Visitor → Access middleware: sends request
- Access middleware → Access log: writes access entry (evidence: `web/shop/middleware.py`)
- Access middleware → Project routes: passes request (evidence: `web/shop/middleware.py`)
- Project routes → Shop routes: includes routes (evidence: `web/web/urls.py`)
- Shop routes → Page handlers: dispatches routes (evidence: `web/shop/urls.py`)
- Page handlers → Page templates: renders pages (evidence: `web/shop/views.py`)
- Django settings → Access middleware: configures middleware (evidence: `web/web/settings.py`)
- Django settings → Project routes: selects routes (evidence: `web/web/settings.py`)
- Django settings → Jinja environment: sets environment (evidence: `web/web/settings.py`)
