# rrshafikov/notes-rest-api architecture

> Architecture diagram of the GitHub repository rrshafikov/notes-rest-api, 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/rrshafikov/notes-rest-api
- Repository: https://github.com/rrshafikov/notes-rest-api

## Overview

This Django application serves a browser-based notes editor and a REST API. The main workflow is user registration and email confirmation, authentication, then creating, opening, editing, and deleting owner-scoped notes; the web editor autosaves changes through the API. The README also documents profile management and OpenAPI/Swagger. Some URL and model implementations were not sampled, so the graph follows documented routing and capabilities where source excerpts are incomplete; no CI, build, or test components are included.

Main entry points: [`src/api/urls.py`](https://github.com/rrshafikov/notes-rest-api/blob/main/src/api/urls.py) (API router), [`src/authorization/views.py`](https://github.com/rrshafikov/notes-rest-api/blob/main/src/authorization/views.py) (Auth handlers), [`src/notes/views.py`](https://github.com/rrshafikov/notes-rest-api/blob/main/src/notes/views.py) (Notes handlers), [`src/config/urls.py`](https://github.com/rrshafikov/notes-rest-api/blob/main/src/config/urls.py) (Application routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_web_routes["Web routes<br/>[urls.py]"]
  node_auth_pages["Auth pages"]
  node_auth_js["Auth interactions<br/>[auth.js]"]
  node_notes_page["Notes page<br/>[index.html]"]
  node_notes_js["Notes editor<br/>[notes.js]"]
end

subgraph group_auth["Identity"]
  node_auth_routes["Auth API routes<br/>[urls.py]"]
  node_auth_views["Auth handlers<br/>[views.py]"]
  node_auth_serializer["Auth serializers<br/>[serializers.py]"]
  node_auth_model["User and codes<br/>[models.py]"]
end

subgraph group_notes["Notes"]
  node_notes_routes["Notes routes<br/>[urls.py]"]
  node_notes_views["Notes handlers<br/>[views.py]"]
  node_note_rules["Owner permissions<br/>[permissions.py]"]
  node_note_serializer["Note serialization<br/>[serializers.py]"]
  node_note_model["Note model<br/>[models.py]"]
end

subgraph group_api["API surface"]
  node_jwt_views["JWT endpoints<br/>[views.py]"]
  node_api_routes["API router<br/>[urls.py]"]
  node_app_routes["Application routes<br/>[urls.py]"]
  node_openapi["OpenAPI docs<br/>[urls.py]"]
end

node_visitor(("Browser user"))
node_client(("API client"))
node_database[("SQLite database<br/>[settings.py]")]
node_email_stub["Email code files"]

node_visitor -->|"requests pages"| node_app_routes
node_app_routes -->|"dispatches"| node_web_routes
node_web_routes -->|"renders"| node_auth_pages
node_web_routes -->|"serves notes"| node_notes_page
node_auth_pages -->|"loads script"| node_auth_js
node_notes_page -->|"loads script"| node_notes_js
node_auth_js -->|"submits auth"| node_auth_routes
node_auth_js -->|"requests tokens"| node_jwt_views
node_client -->|"requests API"| node_app_routes
node_app_routes -->|"dispatches API"| node_api_routes
node_api_routes -->|"dispatches auth"| node_auth_views
node_api_routes -->|"dispatches JWT"| node_jwt_views
node_api_routes -->|"routes notes"| node_notes_routes
node_notes_routes -->|"dispatches"| node_notes_views
node_notes_js -->|"sends CRUD requests"| node_api_routes
node_notes_views -->|"checks ownership"| node_note_rules
node_notes_views -->|"serializes notes"| node_note_serializer
node_notes_views -->|"queries and saves"| node_note_model
node_note_model -->|"persists notes"| node_database
node_auth_views -->|"validates input"| node_auth_serializer
node_auth_views -->|"reads and writes"| node_auth_model
node_auth_model -->|"persists identity"| node_database
node_auth_views -.->|"writes codes"| node_email_stub
node_api_routes -->|"serves schema and docs"| node_openapi

click node_web_routes "https://github.com/rrshafikov/notes-rest-api/blob/main/src/authorization/urls.py"
click node_auth_pages "https://github.com/rrshafikov/notes-rest-api/tree/main/src/templates/auth"
click node_auth_js "https://github.com/rrshafikov/notes-rest-api/blob/main/src/static/js/auth.js"
click node_notes_page "https://github.com/rrshafikov/notes-rest-api/blob/main/src/templates/notes/index.html"
click node_notes_js "https://github.com/rrshafikov/notes-rest-api/blob/main/src/static/js/notes.js"
click node_notes_routes "https://github.com/rrshafikov/notes-rest-api/blob/main/src/notes/urls.py"
click node_notes_views "https://github.com/rrshafikov/notes-rest-api/blob/main/src/notes/views.py"
click node_note_rules "https://github.com/rrshafikov/notes-rest-api/blob/main/src/notes/permissions.py"
click node_note_serializer "https://github.com/rrshafikov/notes-rest-api/blob/main/src/notes/serializers.py"
click node_note_model "https://github.com/rrshafikov/notes-rest-api/blob/main/src/notes/models.py"
click node_auth_routes "https://github.com/rrshafikov/notes-rest-api/blob/main/src/api/urls.py"
click node_auth_views "https://github.com/rrshafikov/notes-rest-api/blob/main/src/authorization/views.py"
click node_auth_serializer "https://github.com/rrshafikov/notes-rest-api/blob/main/src/authorization/serializers.py"
click node_auth_model "https://github.com/rrshafikov/notes-rest-api/blob/main/src/authorization/models.py"
click node_jwt_views "https://github.com/rrshafikov/notes-rest-api/blob/main/src/api/views.py"
click node_api_routes "https://github.com/rrshafikov/notes-rest-api/blob/main/src/api/urls.py"
click node_app_routes "https://github.com/rrshafikov/notes-rest-api/blob/main/src/config/urls.py"
click node_openapi "https://github.com/rrshafikov/notes-rest-api/blob/main/src/api/urls.py"
click node_database "https://github.com/rrshafikov/notes-rest-api/blob/main/src/config/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_web_routes,node_auth_pages,node_auth_js,node_notes_page,node_notes_js,node_visitor,node_client toneBlue
class node_auth_routes,node_auth_views,node_auth_serializer,node_auth_model,node_database toneAmber
class node_notes_routes,node_notes_views,node_note_rules,node_note_serializer,node_note_model toneMint
class node_jwt_views,node_api_routes,node_app_routes,node_openapi toneRose
class node_email_stub toneIndigo
```

## Components

### Web experience

- [Web routes](https://github.com/rrshafikov/notes-rest-api/blob/main/src/authorization/urls.py): `src/authorization/urls.py`
- [Auth pages](https://github.com/rrshafikov/notes-rest-api/tree/main/src/templates/auth): `src/templates/auth`
- [Auth interactions](https://github.com/rrshafikov/notes-rest-api/blob/main/src/static/js/auth.js): `src/static/js/auth.js`
- [Notes page](https://github.com/rrshafikov/notes-rest-api/blob/main/src/templates/notes/index.html): `src/templates/notes/index.html`
- [Notes editor](https://github.com/rrshafikov/notes-rest-api/blob/main/src/static/js/notes.js): `src/static/js/notes.js`

### Identity

- [Auth API routes](https://github.com/rrshafikov/notes-rest-api/blob/main/src/api/urls.py): `src/api/urls.py`
- [Auth handlers](https://github.com/rrshafikov/notes-rest-api/blob/main/src/authorization/views.py): `src/authorization/views.py`
- [Auth serializers](https://github.com/rrshafikov/notes-rest-api/blob/main/src/authorization/serializers.py): `src/authorization/serializers.py`
- [User and codes](https://github.com/rrshafikov/notes-rest-api/blob/main/src/authorization/models.py): `src/authorization/models.py`

### Notes

- [Notes routes](https://github.com/rrshafikov/notes-rest-api/blob/main/src/notes/urls.py): `src/notes/urls.py`
- [Notes handlers](https://github.com/rrshafikov/notes-rest-api/blob/main/src/notes/views.py): `src/notes/views.py`
- [Owner permissions](https://github.com/rrshafikov/notes-rest-api/blob/main/src/notes/permissions.py): `src/notes/permissions.py`
- [Note serialization](https://github.com/rrshafikov/notes-rest-api/blob/main/src/notes/serializers.py): `src/notes/serializers.py`
- [Note model](https://github.com/rrshafikov/notes-rest-api/blob/main/src/notes/models.py): `src/notes/models.py`

### API surface

- [JWT endpoints](https://github.com/rrshafikov/notes-rest-api/blob/main/src/api/views.py): `src/api/views.py`
- [API router](https://github.com/rrshafikov/notes-rest-api/blob/main/src/api/urls.py): `src/api/urls.py`
- [Application routes](https://github.com/rrshafikov/notes-rest-api/blob/main/src/config/urls.py): `src/config/urls.py`
- [OpenAPI docs](https://github.com/rrshafikov/notes-rest-api/blob/main/src/api/urls.py): `src/api/urls.py`

### Other components

- **Browser user**
- **API client**
- [SQLite database](https://github.com/rrshafikov/notes-rest-api/blob/main/src/config/settings.py): `src/config/settings.py`
- **Email code files**

## Connections

- Browser user → Application routes: requests pages
- Application routes → Web routes: dispatches
- Web routes → Auth pages: renders
- Web routes → Notes page: serves notes
- Auth pages → Auth interactions: loads script
- Notes page → Notes editor: loads script
- Auth interactions → Auth API routes: submits auth
- Auth interactions → JWT endpoints: requests tokens
- API client → Application routes: requests API
- Application routes → API router: dispatches API
- API router → Auth handlers: dispatches auth
- API router → JWT endpoints: dispatches JWT
- API router → Notes routes: routes notes
- Notes routes → Notes handlers: dispatches
- Notes editor → API router: sends CRUD requests
- Notes handlers → Owner permissions: checks ownership
- Notes handlers → Note serialization: serializes notes
- Notes handlers → Note model: queries and saves
- Note model → SQLite database: persists notes
- Auth handlers → Auth serializers: validates input
- Auth handlers → User and codes: reads and writes
- User and codes → SQLite database: persists identity
- Auth handlers → Email code files: writes codes
- API router → OpenAPI docs: serves schema and docs
