# p4bl1t0ck/urbanex architecture

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

- Interactive diagram: https://gitdiagram.com/p4bl1t0ck/urbanex
- Repository: https://github.com/p4bl1t0ck/urbanex

## Overview

Urbanex is a small web application centered on email-and-password login, account lockout, JWT issuance, and a session-gated dashboard. The browser login calls the shared API client; Django routes the request to the login view, which validates input, checks and updates the user, and returns tokens. The dashboard checks the stored access token and supports logout. The README describes the Django/Next.js setup but documents no other product capabilities. Source excerpts do not show all model or database behavior, so those links are limited to explicit ORM and settings evidence.

Main entry points: [`backend/apps/users/views.py`](https://github.com/p4bl1t0ck/urbanex/blob/master/backend/apps/users/views.py) (Login handler), [`frontend/app/(auth)/login/page.tsx`](https://github.com/p4bl1t0ck/urbanex/blob/master/frontend/app/(auth)/login/page.tsx) (Login page), [`frontend/lib/api.ts`](https://github.com/p4bl1t0ck/urbanex/blob/master/frontend/lib/api.ts) (API client), [`backend/config/urls.py`](https://github.com/p4bl1t0ck/urbanex/blob/master/backend/config/urls.py) (API routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web client"]
  node_login["Login page<br/>[page.tsx]"]
  node_api["API client<br/>[api.ts]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
end

subgraph group_backend["Django API"]
  node_routing["API routing<br/>[urls.py]"]
  node_auth_routes["Auth routes<br/>[urls.py]"]
  node_login_view["Login handler<br/>[views.py]"]
  node_serializer["Login validation<br/>[serializers.py]"]
  node_settings["Backend settings<br/>[settings.py]"]
end

subgraph group_data["Identity data"]
  node_user_model["User account model<br/>[models.py]"]
  node_database[("SQLite database<br/>[db.sqlite3]")]
end

node_user(("User"))

node_user -->|"submits credentials"| node_login
node_login -->|"calls"| node_api
node_api -->|"posts login request"| node_routing
node_routing -->|"includes routes"| node_auth_routes
node_auth_routes -->|"routes login"| node_login_view
node_login_view -->|"validates with"| node_serializer
node_login_view -->|"queries and updates"| node_user_model
node_settings -->|"configures database"| node_database
node_login_view -->|"returns tokens; client navigates"| node_dashboard
node_user -->|"uses session"| node_dashboard

click node_login "https://github.com/p4bl1t0ck/urbanex/blob/master/frontend/app/(auth)/login/page.tsx"
click node_api "https://github.com/p4bl1t0ck/urbanex/blob/master/frontend/lib/api.ts"
click node_dashboard "https://github.com/p4bl1t0ck/urbanex/blob/master/frontend/app/dashboard/page.tsx"
click node_routing "https://github.com/p4bl1t0ck/urbanex/blob/master/backend/config/urls.py"
click node_auth_routes "https://github.com/p4bl1t0ck/urbanex/blob/master/backend/apps/users/urls.py"
click node_login_view "https://github.com/p4bl1t0ck/urbanex/blob/master/backend/apps/users/views.py"
click node_serializer "https://github.com/p4bl1t0ck/urbanex/blob/master/backend/apps/users/serializers.py"
click node_settings "https://github.com/p4bl1t0ck/urbanex/blob/master/backend/config/settings.py"
click node_user_model "https://github.com/p4bl1t0ck/urbanex/blob/master/backend/apps/users/models.py"
click node_database "https://github.com/p4bl1t0ck/urbanex/blob/master/backend/db.sqlite3"

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_login,node_api,node_dashboard,node_user toneBlue
class node_routing,node_auth_routes,node_login_view,node_serializer,node_settings toneAmber
class node_user_model,node_database toneMint
```

## Components

### Web client

- [Login page](https://github.com/p4bl1t0ck/urbanex/blob/master/frontend/app/(auth)/login/page.tsx): `frontend/app/(auth)/login/page.tsx`
- [API client](https://github.com/p4bl1t0ck/urbanex/blob/master/frontend/lib/api.ts): `frontend/lib/api.ts`
- [Dashboard](https://github.com/p4bl1t0ck/urbanex/blob/master/frontend/app/dashboard/page.tsx): `frontend/app/dashboard/page.tsx`

### Django API

- [API routing](https://github.com/p4bl1t0ck/urbanex/blob/master/backend/config/urls.py): `backend/config/urls.py`
- [Auth routes](https://github.com/p4bl1t0ck/urbanex/blob/master/backend/apps/users/urls.py): `backend/apps/users/urls.py`
- [Login handler](https://github.com/p4bl1t0ck/urbanex/blob/master/backend/apps/users/views.py): `backend/apps/users/views.py`
- [Login validation](https://github.com/p4bl1t0ck/urbanex/blob/master/backend/apps/users/serializers.py): `backend/apps/users/serializers.py`
- [Backend settings](https://github.com/p4bl1t0ck/urbanex/blob/master/backend/config/settings.py): `backend/config/settings.py`

### Identity data

- [User account model](https://github.com/p4bl1t0ck/urbanex/blob/master/backend/apps/users/models.py): `backend/apps/users/models.py`
- [SQLite database](https://github.com/p4bl1t0ck/urbanex/blob/master/backend/db.sqlite3): `backend/db.sqlite3`

### Other components

- **User**

## Connections

- User → Login page: submits credentials (evidence: `frontend/app/(auth)/login/page.tsx`)
- Login page → API client: calls (evidence: `frontend/app/(auth)/login/page.tsx`)
- API client → API routing: posts login request (evidence: `frontend/lib/api.ts`)
- API routing → Auth routes: includes routes (evidence: `backend/config/urls.py`)
- Auth routes → Login handler: routes login (evidence: `backend/apps/users/urls.py`)
- Login handler → Login validation: validates with (evidence: `backend/apps/users/views.py`)
- Login handler → User account model: queries and updates (evidence: `backend/apps/users/views.py`)
- Backend settings → SQLite database: configures database (evidence: `backend/config/settings.py`)
- Login handler → Dashboard: returns tokens; client navigates
- User → Dashboard: uses session (evidence: `frontend/app/dashboard/page.tsx`)
