# alexandr1830/diploma architecture

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

- Interactive diagram: https://gitdiagram.com/alexandr1830/diploma
- Repository: https://github.com/alexandr1830/diploma

## Overview

DocManager supports authenticated document drafting, versioning and review, published-document browsing, discussions, compliance checks, and administration. Users enter through the web app; document pages call the API for document and review operations, while library pages support published content and shared discussions. The Go backend provides HTTP handlers, services, parsing, compliance, and persistence. The README is empty, and several backend wiring details are not excerpted, so uncertain backend relationships are omitted or marked unverified.

Main entry points: [`internal/handler/router.go`](https://github.com/alexandr1830/diploma/blob/main/internal/handler/router.go) (HTTP routing), [`frontend/src/App.jsx`](https://github.com/alexandr1830/diploma/blob/main/frontend/src/App.jsx) (Routes and access), [`frontend/src/api/client.js`](https://github.com/alexandr1830/diploma/blob/main/frontend/src/api/client.js) (API client), [`frontend/src/pages/DocumentPage.jsx`](https://github.com/alexandr1830/diploma/blob/main/frontend/src/pages/DocumentPage.jsx) (Document workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Routes and access<br/>[App.jsx]"]
  node_api["API client<br/>[client.js]"]
end

subgraph group_workflow["Document workflows"]
  node_docpages["Document workspace<br/>[DocumentPage.jsx]"]
  node_doclist["Document listing"]
  node_create["Document creation"]
  node_discussions["Thread discussions"]
  node_diff["Version comparison<br/>[DiffModal.jsx]"]
  node_viewer["Document preview"]
  node_library["Published library<br/>[LibraryPage.jsx]"]
  node_librarydoc["Library document"]
  node_complianceui["Compliance interface"]
  node_admin["Administration<br/>[AdminUsersPage.jsx]"]
end

subgraph group_backend["Backend services"]
  node_router["HTTP routing<br/>[router.go]"]
  node_auth["Authentication<br/>[auth.go]"]
  node_documents["Document services<br/>[document.go]"]
  node_review["Review workflow<br/>[review.go]"]
  node_discussion["Discussion service<br/>[discussion.go]"]
  node_librarysvc["Library service<br/>[library.go]"]
  node_compliance["Compliance engine<br/>[engine.go]"]
  node_rules["Rule-set service<br/>[ruleset.go]"]
  node_adminsvc["Admin services<br/>[admin.go]"]
end

subgraph group_storage["Persistence and processing"]
  node_repository["Repository layer<br/>[postgres.go]"]
  node_database[("PostgreSQL<br/>[postgres.go]")]
  node_parser["Document parsers"]
  node_preview["Preview generation<br/>[preview.go]"]
  node_models["Domain models<br/>[models.go]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"checks session"| node_api
node_app -->|"routes to"| node_docpages
node_app -->|"routes to"| node_doclist
node_app -->|"routes to"| node_create
node_app -->|"routes to"| node_library
node_app -->|"routes to"| node_librarydoc
node_app -->|"routes to"| node_admin
node_docpages -->|"calls"| node_api
node_docpages -->|"renders"| node_discussions
node_docpages -->|"renders"| node_diff
node_docpages -->|"renders"| node_viewer
node_doclist -->|"calls"| node_api
node_create -->|"calls"| node_api
node_library -->|"calls"| node_api
node_librarydoc -->|"calls"| node_api
node_librarydoc -->|"renders"| node_discussions
node_complianceui -->|"runs checks"| node_api
node_discussions -->|"posts and resolves"| node_api
node_api -.->|"HTTP requests"| node_router
node_router -.->|"dispatches"| node_auth
node_router -.->|"dispatches"| node_documents
node_router -.->|"dispatches"| node_review
node_router -.->|"dispatches"| node_discussion
node_router -.->|"dispatches"| node_librarysvc
node_router -.->|"dispatches"| node_compliance
node_router -.->|"dispatches"| node_rules
node_router -.->|"dispatches"| node_adminsvc
node_documents -.->|"uses"| node_repository
node_review -.->|"uses"| node_repository
node_discussion -.->|"uses"| node_repository
node_librarysvc -.->|"uses"| node_repository
node_compliance -.->|"evaluates content"| node_parser
node_repository -.->|"persists data"| node_database
node_documents -.->|"generates previews"| node_preview

click node_app "https://github.com/alexandr1830/diploma/blob/main/frontend/src/App.jsx"
click node_api "https://github.com/alexandr1830/diploma/blob/main/frontend/src/api/client.js"
click node_docpages "https://github.com/alexandr1830/diploma/blob/main/frontend/src/pages/DocumentPage.jsx"
click node_doclist "https://github.com/alexandr1830/diploma/blob/main/frontend/src/pages/DocumentsListPage.jsx"
click node_create "https://github.com/alexandr1830/diploma/blob/main/frontend/src/pages/CreateDocumentPage.jsx"
click node_discussions "https://github.com/alexandr1830/diploma/tree/main/frontend/src/components/discussions"
click node_diff "https://github.com/alexandr1830/diploma/blob/main/frontend/src/components/DiffModal.jsx"
click node_viewer "https://github.com/alexandr1830/diploma/blob/main/frontend/src/components/FullscreenViewer.jsx"
click node_library "https://github.com/alexandr1830/diploma/blob/main/frontend/src/pages/LibraryPage.jsx"
click node_librarydoc "https://github.com/alexandr1830/diploma/blob/main/frontend/src/pages/LibraryDocumentPage.jsx"
click node_complianceui "https://github.com/alexandr1830/diploma/blob/main/frontend/src/components/ComplianceModal.jsx"
click node_admin "https://github.com/alexandr1830/diploma/blob/main/frontend/src/pages/AdminUsersPage.jsx"
click node_router "https://github.com/alexandr1830/diploma/blob/main/internal/handler/router.go"
click node_auth "https://github.com/alexandr1830/diploma/blob/main/internal/service/auth.go"
click node_documents "https://github.com/alexandr1830/diploma/blob/main/internal/service/document.go"
click node_review "https://github.com/alexandr1830/diploma/blob/main/internal/service/review.go"
click node_discussion "https://github.com/alexandr1830/diploma/blob/main/internal/service/discussion.go"
click node_librarysvc "https://github.com/alexandr1830/diploma/blob/main/internal/service/library.go"
click node_compliance "https://github.com/alexandr1830/diploma/blob/main/internal/compliance/engine.go"
click node_rules "https://github.com/alexandr1830/diploma/blob/main/internal/service/ruleset.go"
click node_adminsvc "https://github.com/alexandr1830/diploma/blob/main/internal/service/admin.go"
click node_repository "https://github.com/alexandr1830/diploma/blob/main/internal/repository/postgres.go"
click node_database "https://github.com/alexandr1830/diploma/blob/main/pkg/database/postgres.go"
click node_parser "https://github.com/alexandr1830/diploma/tree/main/internal/parser"
click node_preview "https://github.com/alexandr1830/diploma/blob/main/internal/preview/preview.go"
click node_models "https://github.com/alexandr1830/diploma/blob/main/internal/models/models.go"

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_app,node_api,node_user toneBlue
class node_docpages,node_doclist,node_create,node_discussions,node_diff,node_viewer,node_library,node_librarydoc,node_complianceui,node_admin toneAmber
class node_router,node_auth,node_documents,node_review,node_discussion,node_librarysvc,node_compliance,node_rules,node_adminsvc toneMint
class node_repository,node_database,node_parser,node_preview,node_models toneRose
```

## Components

### Web application

- [Routes and access](https://github.com/alexandr1830/diploma/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [API client](https://github.com/alexandr1830/diploma/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`

### Document workflows

- [Document workspace](https://github.com/alexandr1830/diploma/blob/main/frontend/src/pages/DocumentPage.jsx): `frontend/src/pages/DocumentPage.jsx`
- [Document listing](https://github.com/alexandr1830/diploma/blob/main/frontend/src/pages/DocumentsListPage.jsx): `frontend/src/pages/DocumentsListPage.jsx`
- [Document creation](https://github.com/alexandr1830/diploma/blob/main/frontend/src/pages/CreateDocumentPage.jsx): `frontend/src/pages/CreateDocumentPage.jsx`
- [Thread discussions](https://github.com/alexandr1830/diploma/tree/main/frontend/src/components/discussions): `frontend/src/components/discussions`
- [Version comparison](https://github.com/alexandr1830/diploma/blob/main/frontend/src/components/DiffModal.jsx): `frontend/src/components/DiffModal.jsx`
- [Document preview](https://github.com/alexandr1830/diploma/blob/main/frontend/src/components/FullscreenViewer.jsx): `frontend/src/components/FullscreenViewer.jsx`
- [Published library](https://github.com/alexandr1830/diploma/blob/main/frontend/src/pages/LibraryPage.jsx): `frontend/src/pages/LibraryPage.jsx`
- [Library document](https://github.com/alexandr1830/diploma/blob/main/frontend/src/pages/LibraryDocumentPage.jsx): `frontend/src/pages/LibraryDocumentPage.jsx`
- [Compliance interface](https://github.com/alexandr1830/diploma/blob/main/frontend/src/components/ComplianceModal.jsx): `frontend/src/components/ComplianceModal.jsx`
- [Administration](https://github.com/alexandr1830/diploma/blob/main/frontend/src/pages/AdminUsersPage.jsx): `frontend/src/pages/AdminUsersPage.jsx`

### Backend services

- [HTTP routing](https://github.com/alexandr1830/diploma/blob/main/internal/handler/router.go): `internal/handler/router.go`
- [Authentication](https://github.com/alexandr1830/diploma/blob/main/internal/service/auth.go): `internal/service/auth.go`
- [Document services](https://github.com/alexandr1830/diploma/blob/main/internal/service/document.go): `internal/service/document.go`
- [Review workflow](https://github.com/alexandr1830/diploma/blob/main/internal/service/review.go): `internal/service/review.go`
- [Discussion service](https://github.com/alexandr1830/diploma/blob/main/internal/service/discussion.go): `internal/service/discussion.go`
- [Library service](https://github.com/alexandr1830/diploma/blob/main/internal/service/library.go): `internal/service/library.go`
- [Compliance engine](https://github.com/alexandr1830/diploma/blob/main/internal/compliance/engine.go): `internal/compliance/engine.go`
- [Rule-set service](https://github.com/alexandr1830/diploma/blob/main/internal/service/ruleset.go): `internal/service/ruleset.go`
- [Admin services](https://github.com/alexandr1830/diploma/blob/main/internal/service/admin.go): `internal/service/admin.go`

### Persistence and processing

- [Repository layer](https://github.com/alexandr1830/diploma/blob/main/internal/repository/postgres.go): `internal/repository/postgres.go`
- [PostgreSQL](https://github.com/alexandr1830/diploma/blob/main/pkg/database/postgres.go): `pkg/database/postgres.go`
- [Document parsers](https://github.com/alexandr1830/diploma/tree/main/internal/parser): `internal/parser`
- [Preview generation](https://github.com/alexandr1830/diploma/blob/main/internal/preview/preview.go): `internal/preview/preview.go`
- [Domain models](https://github.com/alexandr1830/diploma/blob/main/internal/models/models.go): `internal/models/models.go`

### Other components

- **User**

## Connections

- User → Routes and access: uses (evidence: `frontend/src/App.jsx`)
- Routes and access → API client: checks session (evidence: `frontend/src/App.jsx`)
- Routes and access → Document workspace: routes to (evidence: `frontend/src/App.jsx`)
- Routes and access → Document listing: routes to (evidence: `frontend/src/App.jsx`)
- Routes and access → Document creation: routes to (evidence: `frontend/src/App.jsx`)
- Routes and access → Published library: routes to (evidence: `frontend/src/App.jsx`)
- Routes and access → Library document: routes to (evidence: `frontend/src/App.jsx`)
- Routes and access → Administration: routes to (evidence: `frontend/src/App.jsx`)
- Document workspace → API client: calls (evidence: `frontend/src/pages/DocumentPage.jsx`)
- Document workspace → Thread discussions: renders (evidence: `frontend/src/pages/DocumentPage.jsx`)
- Document workspace → Version comparison: renders (evidence: `frontend/src/pages/DocumentPage.jsx`)
- Document workspace → Document preview: renders (evidence: `frontend/src/pages/DocumentPage.jsx`)
- Document listing → API client: calls (evidence: `frontend/src/pages/DocumentsListPage.jsx`)
- Document creation → API client: calls (evidence: `frontend/src/pages/CreateDocumentPage.jsx`)
- Published library → API client: calls (evidence: `frontend/src/pages/LibraryPage.jsx`)
- Library document → API client: calls (evidence: `frontend/src/pages/LibraryDocumentPage.jsx`)
- Library document → Thread discussions: renders (evidence: `frontend/src/pages/LibraryDocumentPage.jsx`)
- Compliance interface → API client: runs checks (evidence: `frontend/src/components/ComplianceModal.jsx`)
- Thread discussions → API client: posts and resolves (evidence: `frontend/src/components/discussions/ThreadMessages.jsx`)
- API client → HTTP routing: HTTP requests
- HTTP routing → Authentication: dispatches
- HTTP routing → Document services: dispatches
- HTTP routing → Review workflow: dispatches
- HTTP routing → Discussion service: dispatches
- HTTP routing → Library service: dispatches
- HTTP routing → Compliance engine: dispatches
- HTTP routing → Rule-set service: dispatches
- HTTP routing → Admin services: dispatches
- Document services → Repository layer: uses
- Review workflow → Repository layer: uses
- Discussion service → Repository layer: uses
- Library service → Repository layer: uses
- Compliance engine → Document parsers: evaluates content
- Repository layer → PostgreSQL: persists data
- Document services → Preview generation: generates previews
