# 0x-fyve/popi architecture

> Architecture diagram of the GitHub repository 0x-fyve/popi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/0x-fyve/popi
- Repository: https://github.com/0x-fyve/popi

## Overview

Popi is a Django API and Channels application for account access and creating or joining rooms, with a WebSocket route for room connections. The visible HTTP workflow includes registration/login and authenticated room creation or joining. The consumer, URL modules, and models were not sampled, so room messaging behavior and some route-to-view details are not inferred.

Main entry points: [`accounts/views.py`](https://github.com/0x-fyve/popi/blob/main/accounts/views.py) (Account endpoints), [`Popi/urls.py`](https://github.com/0x-fyve/popi/blob/main/Popi/urls.py) (HTTP routes), [`Popi/asgi.py`](https://github.com/0x-fyve/popi/blob/main/Popi/asgi.py) (ASGI dispatch), [`Popi/settings.py`](https://github.com/0x-fyve/popi/blob/main/Popi/settings.py) (Runtime settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_urls["HTTP routes<br/>[urls.py]"]
  node_asgi["ASGI dispatch<br/>[asgi.py]"]
  node_settings["Runtime settings<br/>[settings.py]"]
end

subgraph group_accounts["Accounts"]
  node_accounturls["Account routes<br/>[urls.py]"]
  node_accountviews["Account endpoints<br/>[views.py]"]
  node_register["Registration serializer<br/>[serializers.py]"]
  node_cookieauth["Cookie JWT auth<br/>[authentication.py]"]
end

subgraph group_rooms["Rooms"]
  node_wsroutes["WebSocket routes<br/>[routing.py]"]
  node_consumer["Room consumer<br/>[consumers.py]"]
  node_roomurls["Room routes<br/>[urls.py]"]
  node_roomviews["Room endpoints<br/>[views.py]"]
end

subgraph group_state["Persistence"]
  node_roommodel["Room model<br/>[models.py]"]
  node_userstore[("User store")]
  node_roomstore[("Room store")]
end

node_client(("Client"))

node_client -->|"HTTP requests"| node_urls
node_urls -->|"dispatches"| node_accounturls
node_urls -->|"dispatches"| node_roomurls
node_accountviews -->|"validates registration"| node_register
node_accountviews -->|"creates users"| node_userstore
node_accountviews -->|"sets auth cookies"| node_client
node_cookieauth -->|"loads user"| node_userstore
node_settings -->|"configures auth"| node_cookieauth
node_roomviews -->|"queries and creates"| node_roommodel
node_roommodel -->|"persists rooms"| node_roomstore
node_asgi -->|"routes WebSockets"| node_wsroutes
node_wsroutes -->|"dispatches connection"| node_consumer
node_client -->|"WebSocket connection"| node_asgi
node_settings -->|"configures Channels"| node_asgi

click node_urls "https://github.com/0x-fyve/popi/blob/main/Popi/urls.py"
click node_asgi "https://github.com/0x-fyve/popi/blob/main/Popi/asgi.py"
click node_wsroutes "https://github.com/0x-fyve/popi/blob/main/rooms/routing.py"
click node_consumer "https://github.com/0x-fyve/popi/blob/main/rooms/consumers.py"
click node_accounturls "https://github.com/0x-fyve/popi/blob/main/accounts/urls.py"
click node_accountviews "https://github.com/0x-fyve/popi/blob/main/accounts/views.py"
click node_register "https://github.com/0x-fyve/popi/blob/main/accounts/serializers.py"
click node_cookieauth "https://github.com/0x-fyve/popi/blob/main/accounts/authentication.py"
click node_roomurls "https://github.com/0x-fyve/popi/blob/main/rooms/urls.py"
click node_roomviews "https://github.com/0x-fyve/popi/blob/main/rooms/views.py"
click node_roommodel "https://github.com/0x-fyve/popi/blob/main/rooms/models.py"
click node_settings "https://github.com/0x-fyve/popi/blob/main/Popi/settings.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_urls,node_asgi,node_settings,node_client toneBlue
class node_accounturls,node_accountviews,node_register,node_cookieauth toneAmber
class node_wsroutes,node_consumer,node_roomurls,node_roomviews toneMint
class node_roommodel,node_userstore,node_roomstore toneRose
```

## Components

### Application entry

- [HTTP routes](https://github.com/0x-fyve/popi/blob/main/Popi/urls.py): `Popi/urls.py`
- [ASGI dispatch](https://github.com/0x-fyve/popi/blob/main/Popi/asgi.py): `Popi/asgi.py`
- [Runtime settings](https://github.com/0x-fyve/popi/blob/main/Popi/settings.py): `Popi/settings.py`

### Accounts

- [Account routes](https://github.com/0x-fyve/popi/blob/main/accounts/urls.py): `accounts/urls.py`
- [Account endpoints](https://github.com/0x-fyve/popi/blob/main/accounts/views.py): `accounts/views.py`
- [Registration serializer](https://github.com/0x-fyve/popi/blob/main/accounts/serializers.py): `accounts/serializers.py`
- [Cookie JWT auth](https://github.com/0x-fyve/popi/blob/main/accounts/authentication.py): `accounts/authentication.py`

### Rooms

- [WebSocket routes](https://github.com/0x-fyve/popi/blob/main/rooms/routing.py): `rooms/routing.py`
- [Room consumer](https://github.com/0x-fyve/popi/blob/main/rooms/consumers.py): `rooms/consumers.py`
- [Room routes](https://github.com/0x-fyve/popi/blob/main/rooms/urls.py): `rooms/urls.py`
- [Room endpoints](https://github.com/0x-fyve/popi/blob/main/rooms/views.py): `rooms/views.py`

### Persistence

- [Room model](https://github.com/0x-fyve/popi/blob/main/rooms/models.py): `rooms/models.py`
- **User store**
- **Room store**

### Other components

- **Client**

## Connections

- Client → HTTP routes: HTTP requests
- HTTP routes → Account routes: dispatches
- HTTP routes → Room routes: dispatches
- Account endpoints → Registration serializer: validates registration
- Account endpoints → User store: creates users
- Account endpoints → Client: sets auth cookies
- Cookie JWT auth → User store: loads user
- Runtime settings → Cookie JWT auth: configures auth
- Room endpoints → Room model: queries and creates
- Room model → Room store: persists rooms
- ASGI dispatch → WebSocket routes: routes WebSockets
- WebSocket routes → Room consumer: dispatches connection
- Client → ASGI dispatch: WebSocket connection
- Runtime settings → ASGI dispatch: configures Channels
