# ki-repos/bytes-2-share architecture

> Architecture diagram of the GitHub repository ki-repos/bytes-2-share, 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/ki-repos/bytes-2-share
- Repository: https://github.com/ki-repos/bytes-2-share

## Overview

@BYTE is a Django app for sharing files among devices on a local Wi-Fi network. A device reaches the Django routes, which dispatch to views for registration, upload, listing, download, and deletion; the views use file metadata and the configured local media store. The README also advertises resumable chunked uploads and QR access, but the sampled upload view shows a standard file upload and no QR implementation, so those capabilities are shown as documented rather than verified. The graph reflects only sampled source and README evidence.

Main entry points: [`fileshare/views.py`](https://github.com/ki-repos/bytes-2-share/blob/main/fileshare/views.py) (Request workflows), [`fileshare/models.py`](https://github.com/ki-repos/bytes-2-share/blob/main/fileshare/models.py) (Shared file metadata), [`localshare/wsgi.py`](https://github.com/ki-repos/bytes-2-share/blob/main/localshare/wsgi.py) (Django entry), [`localshare/urls.py`](https://github.com/ki-repos/bytes-2-share/blob/main/localshare/urls.py) (Project routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_upload_ui["Upload progress UI<br/>[upload.js]"]
  node_templates["Page templates"]
  node_qr["QR access"]
end

subgraph group_transfer["File workflows"]
  node_views["Request workflows<br/>[views.py]"]
  node_resumable["Resumable transfers"]
end

subgraph group_identity["Identity and routing"]
  node_django["Django entry<br/>[wsgi.py]"]
  node_project_routes["Project routes<br/>[urls.py]"]
  node_app_routes["App routes<br/>[urls.py]"]
  node_registration["Registration form<br/>[forms.py]"]
  node_auth["Django authentication"]
end

subgraph group_storage["Persistence"]
  node_file_model["Shared file metadata<br/>[models.py]"]
  node_sqlite[("SQLite metadata store<br/>[db.sqlite3]")]
  node_media[("Local file store<br/>[settings.py]")]
end

node_device(("Wi-Fi device"))

node_device -->|"sends requests"| node_django
node_django -->|"loads routes"| node_project_routes
node_project_routes -->|"includes routes"| node_app_routes
node_app_routes -->|"dispatches requests"| node_views
node_views -->|"validates registration"| node_registration
node_views -->|"uses authentication"| node_auth
node_views -->|"creates and queries"| node_file_model
node_views -->|"renders pages"| node_templates
node_file_model -.->|"stores metadata"| node_sqlite
node_file_model -.->|"stores uploaded files"| node_media
node_upload_ui -.->|"posts upload"| node_views
node_device -.->|"can transfer"| node_resumable
node_device -.->|"can access by QR"| node_qr

click node_django "https://github.com/ki-repos/bytes-2-share/blob/main/localshare/wsgi.py"
click node_project_routes "https://github.com/ki-repos/bytes-2-share/blob/main/localshare/urls.py"
click node_app_routes "https://github.com/ki-repos/bytes-2-share/blob/main/fileshare/urls.py"
click node_registration "https://github.com/ki-repos/bytes-2-share/blob/main/fileshare/forms.py"
click node_views "https://github.com/ki-repos/bytes-2-share/blob/main/fileshare/views.py"
click node_upload_ui "https://github.com/ki-repos/bytes-2-share/blob/main/fileshare/static/fileshare/js/upload.js"
click node_templates "https://github.com/ki-repos/bytes-2-share/tree/main/fileshare/templates/fileshare"
click node_resumable "https://github.com/ki-repos/bytes-2-share/tree/main/fileshare"
click node_qr "https://github.com/ki-repos/bytes-2-share/tree/main/fileshare"
click node_file_model "https://github.com/ki-repos/bytes-2-share/blob/main/fileshare/models.py"
click node_sqlite "https://github.com/ki-repos/bytes-2-share/blob/main/db.sqlite3"
click node_media "https://github.com/ki-repos/bytes-2-share/blob/main/localshare/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_upload_ui,node_templates,node_qr toneBlue
class node_views,node_resumable toneAmber
class node_django,node_project_routes,node_app_routes,node_registration,node_auth toneMint
class node_file_model,node_sqlite,node_media toneRose
class node_device toneIndigo
```

## Components

### Web interface

- [Upload progress UI](https://github.com/ki-repos/bytes-2-share/blob/main/fileshare/static/fileshare/js/upload.js): `fileshare/static/fileshare/js/upload.js`
- [Page templates](https://github.com/ki-repos/bytes-2-share/tree/main/fileshare/templates/fileshare): `fileshare/templates/fileshare`
- [QR access](https://github.com/ki-repos/bytes-2-share/tree/main/fileshare): `fileshare`

### File workflows

- [Request workflows](https://github.com/ki-repos/bytes-2-share/blob/main/fileshare/views.py): `fileshare/views.py`
- [Resumable transfers](https://github.com/ki-repos/bytes-2-share/tree/main/fileshare): `fileshare`

### Identity and routing

- [Django entry](https://github.com/ki-repos/bytes-2-share/blob/main/localshare/wsgi.py): `localshare/wsgi.py`
- [Project routes](https://github.com/ki-repos/bytes-2-share/blob/main/localshare/urls.py): `localshare/urls.py`
- [App routes](https://github.com/ki-repos/bytes-2-share/blob/main/fileshare/urls.py): `fileshare/urls.py`
- [Registration form](https://github.com/ki-repos/bytes-2-share/blob/main/fileshare/forms.py): `fileshare/forms.py`
- **Django authentication**

### Persistence

- [Shared file metadata](https://github.com/ki-repos/bytes-2-share/blob/main/fileshare/models.py): `fileshare/models.py`
- [SQLite metadata store](https://github.com/ki-repos/bytes-2-share/blob/main/db.sqlite3): `db.sqlite3`
- [Local file store](https://github.com/ki-repos/bytes-2-share/blob/main/localshare/settings.py): `localshare/settings.py`

### Other components

- **Wi-Fi device**

## Connections

- Wi-Fi device → Django entry: sends requests (evidence: `README.md`)
- Django entry → Project routes: loads routes (evidence: `localshare/urls.py`)
- Project routes → App routes: includes routes (evidence: `localshare/urls.py`)
- App routes → Request workflows: dispatches requests (evidence: `fileshare/urls.py`)
- Request workflows → Registration form: validates registration (evidence: `fileshare/views.py`)
- Request workflows → Django authentication: uses authentication (evidence: `fileshare/views.py`)
- Request workflows → Shared file metadata: creates and queries (evidence: `fileshare/views.py`)
- Request workflows → Page templates: renders pages (evidence: `fileshare/views.py`)
- Shared file metadata → SQLite metadata store: stores metadata
- Shared file metadata → Local file store: stores uploaded files (evidence: `localshare/settings.py`)
- Upload progress UI → Request workflows: posts upload (evidence: `fileshare/static/fileshare/js/upload.js`)
- Wi-Fi device → Resumable transfers: can transfer (evidence: `README.md`)
- Wi-Fi device → QR access: can access by QR (evidence: `README.md`)
