# artizote/htmlify architecture

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

- Interactive diagram: https://gitdiagram.com/artizote/htmlify
- Repository: https://github.com/artizote/htmlify

## Overview

HTMLify is a developer-focused application for hosting and sharing front-end projects and code snippets. Users manage files or multi-part pens, then share or browse hosted content; supporting workflows include authentication, search, temporary file sharing, short links, QR codes, and interactive code execution. The repository separates a Next.js presentation layer from FastAPI routes and services, with Peewee-backed domain models and blob storage. Several capabilities are evident in the tree and README but their implementation excerpts were not provided, so those relationships are left unverified rather than inferred.

Main entry points: [`backend/app/models/file.py`](https://github.com/artizote/htmlify/blob/main/backend/app/models/file.py) (Hosted files), [`backend/app/models/blob.py`](https://github.com/artizote/htmlify/blob/main/backend/app/models/blob.py) (Blob storage), [`backend/app/services/file_service.py`](https://github.com/artizote/htmlify/blob/main/backend/app/services/file_service.py) (File service), [`frontend/components/file/file-preview.tsx`](https://github.com/artizote/htmlify/blob/main/frontend/components/file/file-preview.tsx) (File preview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web experience"]
  node_web["Next.js pages<br/>[page.tsx]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_authform["Sign-in forms<br/>[auth-form.tsx]"]
  node_filepreview["File preview<br/>[file-preview.tsx]"]
  node_codeeditor["Code editor<br/>[code-editor.tsx]"]
  node_tmpview["Temporary file view<br/>[file-preview.tsx]"]
  node_frames["Frames UI<br/>[frames-content.tsx]"]
end

subgraph group_api["API and services"]
  node_authroutes["Auth routes<br/>[auth.py]"]
  node_authservice["Authentication<br/>[auth_service.py]"]
  node_fileservice["File service<br/>[file_service.py]"]
  node_searchservice["Search service<br/>[search_service.py]"]
  node_searchcore["Search query<br/>[search.py]"]
  node_penservice["Pen service<br/>[pen_service.py]"]
  node_tmpservice["Temporary files<br/>[tmpfile_service.py]"]
  node_shortservice["Short links"]
  node_qrservice["QR codes<br/>[qrcode_service.py]"]
  node_blobservice["Blob service<br/>[blob_service.py]"]
  node_executor["Code execution<br/>[executor.py]"]
end

subgraph group_domain["Domain storage"]
  node_filemodel[("Hosted files<br/>[file.py]")]
  node_penmodel[("Code pens<br/>[pen.py]")]
  node_blobmodel[("Blob storage<br/>[blob.py]")]
  node_searchmodel[("Search index<br/>[search.py]")]
  node_usermodel[("Users<br/>[user.py]")]
  node_tmpmodel[("Temporary files<br/>[tmpfile.py]")]
  node_shortmodel[("Short links<br/>[shortlink.py]")]
  node_revision[("Revisions<br/>[revision.py]")]
end

subgraph group_extras["Sharing and execution"]
  node_socket["Execution socket<br/>[code_execution.py]"]
end

node_developer(("Developer"))

node_developer -->|"browses"| node_web
node_developer -->|"manages content"| node_dashboard
node_web -.->|"presents files"| node_filepreview
node_dashboard -.->|"manages files"| node_fileservice
node_authform -.->|"submits credentials"| node_authroutes
node_authroutes -->|"authenticates"| node_authservice
node_authservice -->|"looks up users"| node_usermodel
node_fileservice -->|"creates and reads"| node_filemodel
node_fileservice -->|"stores content"| node_blobmodel
node_filemodel -->|"references blobs"| node_blobmodel
node_filepreview -->|"renders code with"| node_codeeditor
node_tmpview -->|"previews through"| node_filepreview
node_searchservice -->|"runs queries"| node_searchcore
node_searchservice -->|"paginates results"| node_searchmodel
node_searchcore -->|"queries index"| node_searchmodel
node_penservice -.->|"manages pens"| node_penmodel
node_penmodel -->|"references blobs"| node_blobmodel
node_tmpservice -.->|"manages temporary files"| node_tmpmodel
node_shortservice -.->|"manages links"| node_shortmodel
node_qrservice -.->|"encodes hosted links"| node_filemodel
node_blobservice -.->|"manages blobs"| node_blobmodel
node_filemodel -->|"creates revisions"| node_revision
node_developer -.->|"uses playground"| node_frames
node_executor -.->|"serves execution"| node_socket

click node_web "https://github.com/artizote/htmlify/blob/main/frontend/app/(with-nav)/%5B...path%5D/page.tsx"
click node_dashboard "https://github.com/artizote/htmlify/blob/main/frontend/app/dashboard/page.tsx"
click node_authform "https://github.com/artizote/htmlify/blob/main/frontend/components/auth/auth-form.tsx"
click node_filepreview "https://github.com/artizote/htmlify/blob/main/frontend/components/file/file-preview.tsx"
click node_codeeditor "https://github.com/artizote/htmlify/blob/main/frontend/components/playgroud/code-editor.tsx"
click node_tmpview "https://github.com/artizote/htmlify/blob/main/frontend/components/tmp/folder/file-preview.tsx"
click node_authroutes "https://github.com/artizote/htmlify/blob/main/backend/app/api/v1/routes/auth.py"
click node_authservice "https://github.com/artizote/htmlify/blob/main/backend/app/services/auth_service.py"
click node_fileservice "https://github.com/artizote/htmlify/blob/main/backend/app/services/file_service.py"
click node_searchservice "https://github.com/artizote/htmlify/blob/main/backend/app/services/search_service.py"
click node_searchcore "https://github.com/artizote/htmlify/blob/main/backend/app/services/search/search.py"
click node_penservice "https://github.com/artizote/htmlify/blob/main/backend/app/services/pen_service.py"
click node_tmpservice "https://github.com/artizote/htmlify/blob/main/backend/app/services/tmpfile_service.py"
click node_shortservice "https://github.com/artizote/htmlify/blob/main/backend/app/services/shortlink_service.py"
click node_qrservice "https://github.com/artizote/htmlify/blob/main/backend/app/services/qrcode_service.py"
click node_blobservice "https://github.com/artizote/htmlify/blob/main/backend/app/services/blob_service.py"
click node_executor "https://github.com/artizote/htmlify/blob/main/backend/app/services/executor/executor.py"
click node_filemodel "https://github.com/artizote/htmlify/blob/main/backend/app/models/file.py"
click node_penmodel "https://github.com/artizote/htmlify/blob/main/backend/app/models/pen.py"
click node_blobmodel "https://github.com/artizote/htmlify/blob/main/backend/app/models/blob.py"
click node_searchmodel "https://github.com/artizote/htmlify/blob/main/backend/app/models/search.py"
click node_usermodel "https://github.com/artizote/htmlify/blob/main/backend/app/models/user.py"
click node_tmpmodel "https://github.com/artizote/htmlify/blob/main/backend/app/models/tmpfile.py"
click node_shortmodel "https://github.com/artizote/htmlify/blob/main/backend/app/models/shortlink.py"
click node_revision "https://github.com/artizote/htmlify/blob/main/backend/app/models/revision.py"
click node_frames "https://github.com/artizote/htmlify/blob/main/frontend/components/frames/frames-content.tsx"
click node_socket "https://github.com/artizote/htmlify/blob/main/backend/app/sockets/code_execution.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,node_dashboard,node_authform,node_filepreview,node_codeeditor,node_tmpview,node_frames toneBlue
class node_authroutes,node_authservice,node_fileservice,node_searchservice,node_searchcore,node_penservice,node_tmpservice,node_shortservice,node_qrservice,node_blobservice,node_executor toneAmber
class node_filemodel,node_penmodel,node_blobmodel,node_searchmodel,node_usermodel,node_tmpmodel,node_shortmodel,node_revision toneMint
class node_socket toneRose
class node_developer toneIndigo
```

## Components

### Web experience

- [Next.js pages](https://github.com/artizote/htmlify/blob/main/frontend/app/(with-nav)/%5B...path%5D/page.tsx): `frontend/app/(with-nav)/[...path]/page.tsx`
- [Dashboard](https://github.com/artizote/htmlify/blob/main/frontend/app/dashboard/page.tsx): `frontend/app/dashboard/page.tsx`
- [Sign-in forms](https://github.com/artizote/htmlify/blob/main/frontend/components/auth/auth-form.tsx): `frontend/components/auth/auth-form.tsx`
- [File preview](https://github.com/artizote/htmlify/blob/main/frontend/components/file/file-preview.tsx): `frontend/components/file/file-preview.tsx`
- [Code editor](https://github.com/artizote/htmlify/blob/main/frontend/components/playgroud/code-editor.tsx): `frontend/components/playgroud/code-editor.tsx`
- [Temporary file view](https://github.com/artizote/htmlify/blob/main/frontend/components/tmp/folder/file-preview.tsx): `frontend/components/tmp/folder/file-preview.tsx`
- [Frames UI](https://github.com/artizote/htmlify/blob/main/frontend/components/frames/frames-content.tsx): `frontend/components/frames/frames-content.tsx`

### API and services

- [Auth routes](https://github.com/artizote/htmlify/blob/main/backend/app/api/v1/routes/auth.py): `backend/app/api/v1/routes/auth.py`
- [Authentication](https://github.com/artizote/htmlify/blob/main/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`
- [File service](https://github.com/artizote/htmlify/blob/main/backend/app/services/file_service.py): `backend/app/services/file_service.py`
- [Search service](https://github.com/artizote/htmlify/blob/main/backend/app/services/search_service.py): `backend/app/services/search_service.py`
- [Search query](https://github.com/artizote/htmlify/blob/main/backend/app/services/search/search.py): `backend/app/services/search/search.py`
- [Pen service](https://github.com/artizote/htmlify/blob/main/backend/app/services/pen_service.py): `backend/app/services/pen_service.py`
- [Temporary files](https://github.com/artizote/htmlify/blob/main/backend/app/services/tmpfile_service.py): `backend/app/services/tmpfile_service.py`
- [Short links](https://github.com/artizote/htmlify/blob/main/backend/app/services/shortlink_service.py): `backend/app/services/shortlink_service.py`
- [QR codes](https://github.com/artizote/htmlify/blob/main/backend/app/services/qrcode_service.py): `backend/app/services/qrcode_service.py`
- [Blob service](https://github.com/artizote/htmlify/blob/main/backend/app/services/blob_service.py): `backend/app/services/blob_service.py`
- [Code execution](https://github.com/artizote/htmlify/blob/main/backend/app/services/executor/executor.py): `backend/app/services/executor/executor.py`

### Domain storage

- [Hosted files](https://github.com/artizote/htmlify/blob/main/backend/app/models/file.py): `backend/app/models/file.py`
- [Code pens](https://github.com/artizote/htmlify/blob/main/backend/app/models/pen.py): `backend/app/models/pen.py`
- [Blob storage](https://github.com/artizote/htmlify/blob/main/backend/app/models/blob.py): `backend/app/models/blob.py`
- [Search index](https://github.com/artizote/htmlify/blob/main/backend/app/models/search.py): `backend/app/models/search.py`
- [Users](https://github.com/artizote/htmlify/blob/main/backend/app/models/user.py): `backend/app/models/user.py`
- [Temporary files](https://github.com/artizote/htmlify/blob/main/backend/app/models/tmpfile.py): `backend/app/models/tmpfile.py`
- [Short links](https://github.com/artizote/htmlify/blob/main/backend/app/models/shortlink.py): `backend/app/models/shortlink.py`
- [Revisions](https://github.com/artizote/htmlify/blob/main/backend/app/models/revision.py): `backend/app/models/revision.py`

### Sharing and execution

- [Execution socket](https://github.com/artizote/htmlify/blob/main/backend/app/sockets/code_execution.py): `backend/app/sockets/code_execution.py`

### Other components

- **Developer**

## Connections

- Developer → Next.js pages: browses (evidence: `README.md`)
- Developer → Dashboard: manages content (evidence: `README.md`)
- Next.js pages → File preview: presents files
- Dashboard → File service: manages files
- Sign-in forms → Auth routes: submits credentials
- Auth routes → Authentication: authenticates (evidence: `backend/app/api/v1/routes/auth.py`)
- Authentication → Users: looks up users (evidence: `backend/app/services/auth_service.py`)
- File service → Hosted files: creates and reads (evidence: `backend/app/services/file_service.py`)
- File service → Blob storage: stores content (evidence: `backend/app/services/file_service.py`)
- Hosted files → Blob storage: references blobs (evidence: `backend/app/models/file.py`)
- File preview → Code editor: renders code with (evidence: `frontend/components/file/file-preview.tsx`)
- Temporary file view → File preview: previews through (evidence: `frontend/components/tmp/folder/file-preview.tsx`)
- Search service → Search query: runs queries (evidence: `backend/app/services/search_service.py`)
- Search service → Search index: paginates results (evidence: `backend/app/services/search_service.py`)
- Search query → Search index: queries index (evidence: `backend/app/services/search/search.py`)
- Pen service → Code pens: manages pens
- Code pens → Blob storage: references blobs (evidence: `backend/app/models/pen.py`)
- Temporary files → Temporary files: manages temporary files
- Short links → Short links: manages links
- QR codes → Hosted files: encodes hosted links
- Blob service → Blob storage: manages blobs
- Hosted files → Revisions: creates revisions (evidence: `backend/app/models/file.py`)
- Developer → Frames UI: uses playground
- Code execution → Execution socket: serves execution
