# thehotice/pwa_project architecture

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

- Interactive diagram: https://gitdiagram.com/thehotice/pwa_project
- Repository: https://github.com/thehotice/pwa_project

## Overview

This Django REST backend provides account and social-network APIs: users authenticate, manage profiles and invitations, find or connect with other users, and create and interact with posts. The primary request path enters through the project URL configuration, dispatches to account or post views, and uses serializers for validation and models for persisted state. Password reset and email are additional capabilities. The README gives no feature detail, and the sampled views are incomplete, so the graph omits uncertain route-level and cross-feature wiring.

Main entry points: [`pwa/urls.py`](https://github.com/thehotice/pwa_project/blob/master/pwa/urls.py) (API routing), [`accounts/views.py`](https://github.com/thehotice/pwa_project/blob/master/accounts/views.py) (Account endpoints), [`posts/views.py`](https://github.com/thehotice/pwa_project/blob/master/posts/views.py) (Post endpoints), [`accounts/models.py`](https://github.com/thehotice/pwa_project/blob/master/accounts/models.py) (Users and connections)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry and auth"]
  node_urls["API routing<br/>[urls.py]"]
  node_jwt["JWT login<br/>[urls.py]"]
  node_backend["Email or username auth<br/>[modelbackend.py]"]
  node_reset_views["Password reset<br/>[views.py]"]
  node_reset_routes["Reset routes<br/>[urls.py]"]
end

subgraph group_accounts["Accounts and connections"]
  node_account_views["Account endpoints<br/>[views.py]"]
  node_account_serializers["Account validation<br/>[serializers.py]"]
  node_account_models["Users and connections<br/>[models.py]"]
  node_account_utils["Connection helpers<br/>[utils.py]"]
  node_account_routes["Account routes<br/>[urls.py]"]
end

subgraph group_posts["Posts and interactions"]
  node_post_views["Post endpoints<br/>[views.py]"]
  node_post_serializers["Post validation<br/>[serializers.py]"]
  node_post_models["Posts and activity<br/>[models.py]"]
  node_post_utils["Post helpers<br/>[utils.py]"]
  node_post_routes["Post routes<br/>[urls.py]"]
end

subgraph group_state["Persistence and messaging"]
  node_reset_models["Reset tokens<br/>[models.py]"]
  node_database[("SQLite database<br/>[settings.py]")]
  node_email["SMTP email"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_urls
node_urls -->|"dispatches login"| node_jwt
node_urls -->|"dispatches accounts"| node_account_routes
node_urls -->|"dispatches posts"| node_post_routes
node_urls -->|"dispatches reset"| node_reset_routes
node_account_routes -->|"dispatches"| node_account_views
node_post_routes -->|"dispatches"| node_post_views
node_reset_routes -->|"dispatches"| node_reset_views
node_account_views -->|"validates with"| node_account_serializers
node_account_views -->|"reads and writes"| node_account_models
node_account_views -->|"uses helpers"| node_account_utils
node_account_serializers -->|"checks records"| node_account_models
node_post_views -->|"validates with"| node_post_serializers
node_post_views -->|"reads and writes"| node_post_models
node_post_views -->|"uses helpers"| node_post_utils
node_post_serializers -->|"checks records"| node_post_models
node_post_serializers -->|"reads visibility settings"| node_account_models
node_account_models -->|"persists"| node_database
node_post_models -->|"persists"| node_database
node_jwt -->|"authenticates with"| node_backend
node_reset_views -->|"manages tokens"| node_reset_models
node_reset_views -.->|"sends reset mail"| node_email
node_account_views -.->|"sends invitations"| node_email

click node_urls "https://github.com/thehotice/pwa_project/blob/master/pwa/urls.py"
click node_jwt "https://github.com/thehotice/pwa_project/blob/master/pwa/urls.py"
click node_backend "https://github.com/thehotice/pwa_project/blob/master/accounts/modelbackend.py"
click node_account_views "https://github.com/thehotice/pwa_project/blob/master/accounts/views.py"
click node_account_serializers "https://github.com/thehotice/pwa_project/blob/master/accounts/serializers.py"
click node_account_models "https://github.com/thehotice/pwa_project/blob/master/accounts/models.py"
click node_account_utils "https://github.com/thehotice/pwa_project/blob/master/accounts/utils.py"
click node_account_routes "https://github.com/thehotice/pwa_project/blob/master/accounts/urls.py"
click node_post_views "https://github.com/thehotice/pwa_project/blob/master/posts/views.py"
click node_post_serializers "https://github.com/thehotice/pwa_project/blob/master/posts/serializers.py"
click node_post_models "https://github.com/thehotice/pwa_project/blob/master/posts/models.py"
click node_post_utils "https://github.com/thehotice/pwa_project/blob/master/posts/utils.py"
click node_post_routes "https://github.com/thehotice/pwa_project/blob/master/posts/urls.py"
click node_reset_views "https://github.com/thehotice/pwa_project/blob/master/django_rest_passwordreset/views.py"
click node_reset_routes "https://github.com/thehotice/pwa_project/blob/master/django_rest_passwordreset/urls.py"
click node_reset_models "https://github.com/thehotice/pwa_project/blob/master/django_rest_passwordreset/models.py"
click node_database "https://github.com/thehotice/pwa_project/blob/master/pwa/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_jwt,node_backend,node_reset_views,node_reset_routes,node_client toneBlue
class node_account_views,node_account_serializers,node_account_models,node_account_utils,node_account_routes toneAmber
class node_post_views,node_post_serializers,node_post_models,node_post_utils,node_post_routes toneMint
class node_reset_models,node_database,node_email toneRose
```

## Components

### API entry and auth

- [API routing](https://github.com/thehotice/pwa_project/blob/master/pwa/urls.py): `pwa/urls.py`
- [JWT login](https://github.com/thehotice/pwa_project/blob/master/pwa/urls.py): `pwa/urls.py`
- [Email or username auth](https://github.com/thehotice/pwa_project/blob/master/accounts/modelbackend.py): `accounts/modelbackend.py`
- [Password reset](https://github.com/thehotice/pwa_project/blob/master/django_rest_passwordreset/views.py): `django_rest_passwordreset/views.py`
- [Reset routes](https://github.com/thehotice/pwa_project/blob/master/django_rest_passwordreset/urls.py): `django_rest_passwordreset/urls.py`

### Accounts and connections

- [Account endpoints](https://github.com/thehotice/pwa_project/blob/master/accounts/views.py): `accounts/views.py`
- [Account validation](https://github.com/thehotice/pwa_project/blob/master/accounts/serializers.py): `accounts/serializers.py`
- [Users and connections](https://github.com/thehotice/pwa_project/blob/master/accounts/models.py): `accounts/models.py`
- [Connection helpers](https://github.com/thehotice/pwa_project/blob/master/accounts/utils.py): `accounts/utils.py`
- [Account routes](https://github.com/thehotice/pwa_project/blob/master/accounts/urls.py): `accounts/urls.py`

### Posts and interactions

- [Post endpoints](https://github.com/thehotice/pwa_project/blob/master/posts/views.py): `posts/views.py`
- [Post validation](https://github.com/thehotice/pwa_project/blob/master/posts/serializers.py): `posts/serializers.py`
- [Posts and activity](https://github.com/thehotice/pwa_project/blob/master/posts/models.py): `posts/models.py`
- [Post helpers](https://github.com/thehotice/pwa_project/blob/master/posts/utils.py): `posts/utils.py`
- [Post routes](https://github.com/thehotice/pwa_project/blob/master/posts/urls.py): `posts/urls.py`

### Persistence and messaging

- [Reset tokens](https://github.com/thehotice/pwa_project/blob/master/django_rest_passwordreset/models.py): `django_rest_passwordreset/models.py`
- [SQLite database](https://github.com/thehotice/pwa_project/blob/master/pwa/settings.py): `pwa/settings.py`
- **SMTP email**

### Other components

- **API client**

## Connections

- API client → API routing: sends requests
- API routing → JWT login: dispatches login
- API routing → Account routes: dispatches accounts
- API routing → Post routes: dispatches posts
- API routing → Reset routes: dispatches reset
- Account routes → Account endpoints: dispatches
- Post routes → Post endpoints: dispatches
- Reset routes → Password reset: dispatches
- Account endpoints → Account validation: validates with
- Account endpoints → Users and connections: reads and writes
- Account endpoints → Connection helpers: uses helpers
- Account validation → Users and connections: checks records
- Post endpoints → Post validation: validates with
- Post endpoints → Posts and activity: reads and writes
- Post endpoints → Post helpers: uses helpers
- Post validation → Posts and activity: checks records
- Post validation → Users and connections: reads visibility settings
- Users and connections → SQLite database: persists
- Posts and activity → SQLite database: persists
- JWT login → Email or username auth: authenticates with
- Password reset → Reset tokens: manages tokens
- Password reset → SMTP email: sends reset mail
- Account endpoints → SMTP email: sends invitations
