# sorded/cvm-elib-demo architecture

> Architecture diagram of the GitHub repository sorded/cvm-elib-demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sorded/cvm-elib-demo
- Repository: https://github.com/sorded/cvm-elib-demo

## Overview

DVM E-Library is a browser-based college resource library and administration prototype. Users sign in, browse or search subjects and resources, then open resources for reading or viewing; faculty and managers can publish resources, while administrators manage users, catalog metadata, announcements, reports, and audit activity. The sampled services use a local browser database with persistent storage and live-update subscriptions. The README is empty, and many page implementations were not sampled, so those capability branches are shown from the route table and source index without inferring unshown page-to-service calls.

Main entry points: [`src/App.tsx`](https://github.com/sorded/cvm-elib-demo/blob/main/src/App.tsx) (Route and guard layer), [`src/services/resourceService.ts`](https://github.com/sorded/cvm-elib-demo/blob/main/src/services/resourceService.ts) (Resource catalog service), [`src/services/store.ts`](https://github.com/sorded/cvm-elib-demo/blob/main/src/services/store.ts) (Local data store), [`src/services/authService.ts`](https://github.com/sorded/cvm-elib-demo/blob/main/src/services/authService.ts) (Authentication service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and access"]
  node_router["Route and guard layer<br/>[App.tsx]"]
  node_login["Sign-in<br/>[LoginPage.tsx]"]
  node_sessions["Session state<br/>[useSession.ts]"]
  node_auth_service["Authentication service<br/>[authService.ts]"]
  node_navigation["Navigation configuration<br/>[navigation.ts]"]
end

subgraph group_library["Student library"]
  node_home["Library home<br/>[HomePage.tsx]"]
  node_search["Resource search<br/>[SearchPage.tsx]"]
  node_subjects["Subject catalog<br/>[SubjectsPage.tsx]"]
  node_resource["Resource details<br/>[ResourcePage.tsx]"]
  node_reader["Reader and watch<br/>[ReaderPage.tsx]"]
  node_library_saved["Saved library<br/>[LibraryPage.tsx]"]
end

subgraph group_publishing["Publishing"]
  node_manage["Resource management"]
  node_resource_form["Resource publishing form"]
end

subgraph group_operations["Administration and data"]
  node_resource_service["Resource catalog service<br/>[resourceService.ts]"]
  node_users["User administration<br/>[UsersPage.tsx]"]
  node_admin_ui["Admin interface parts<br/>[AdminUi.tsx]"]
  node_subjects_admin["Subject administration"]
  node_types_admin["Resource type administration"]
  node_announcements["Announcements"]
  node_reports["Reports<br/>[ReportsPage.tsx]"]
  node_audit["Audit service<br/>[auditService.ts]"]
  node_user_service["User service<br/>[userService.ts]"]
  node_store[("Local data store<br/>[store.ts]")]
  node_live["Live update hook<br/>[useLive.ts]"]
end

node_visitor(("Library user"))

node_visitor -.->|"opens app"| node_router
node_router -->|"routes to"| node_login
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_search
node_router -->|"routes to"| node_subjects
node_router -->|"routes to"| node_resource
node_router -->|"routes to"| node_reader
node_router -->|"routes to"| node_library_saved
node_router -->|"routes to"| node_manage
node_router -->|"routes to"| node_resource_form
node_router -->|"routes to"| node_users
node_router -->|"routes to"| node_subjects_admin
node_router -->|"routes to"| node_types_admin
node_router -->|"routes to"| node_announcements
node_router -->|"routes to"| node_reports
node_router -->|"uses roles"| node_navigation
node_login -.->|"authenticates with"| node_auth_service
node_sessions -->|"reads session"| node_auth_service
node_auth_service -->|"checks account"| node_user_service
node_auth_service -->|"reads and updates"| node_store
node_manage -->|"lists and changes"| node_resource_service
node_resource_service -->|"reads and commits"| node_store
node_resource_service -->|"logs actions"| node_audit
node_user_service -->|"reads and commits"| node_store
node_user_service -->|"logs actions"| node_audit
node_users -->|"uses controls"| node_admin_ui
node_users -.->|"manages accounts"| node_user_service
node_audit -->|"reads and commits"| node_store
node_live -->|"subscribes to changes"| node_store
node_home -.->|"loads resources"| node_resource_service
node_search -->|"searches catalog"| node_resource_service
node_resource -.->|"loads resource"| node_resource_service
node_reader -.->|"loads content"| node_resource_service
node_announcements -.->|"uses data"| node_store
node_reports -.->|"uses data"| node_store

click node_router "https://github.com/sorded/cvm-elib-demo/blob/main/src/App.tsx"
click node_login "https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/auth/LoginPage.tsx"
click node_sessions "https://github.com/sorded/cvm-elib-demo/blob/main/src/hooks/useSession.ts"
click node_home "https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/student/HomePage.tsx"
click node_search "https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/student/SearchPage.tsx"
click node_subjects "https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/student/SubjectsPage.tsx"
click node_resource "https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/student/ResourcePage.tsx"
click node_reader "https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/student/ReaderPage.tsx"
click node_library_saved "https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/student/LibraryPage.tsx"
click node_resource_service "https://github.com/sorded/cvm-elib-demo/blob/main/src/services/resourceService.ts"
click node_manage "https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/manage/ManageResourcesPage.tsx"
click node_resource_form "https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/manage/ResourceFormPage.tsx"
click node_users "https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/admin/UsersPage.tsx"
click node_admin_ui "https://github.com/sorded/cvm-elib-demo/blob/main/src/components/admin/AdminUi.tsx"
click node_subjects_admin "https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/admin/SubjectsAdminPage.tsx"
click node_types_admin "https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/admin/ResourceTypesPage.tsx"
click node_announcements "https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/admin/AnnouncementsPage.tsx"
click node_reports "https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/admin/ReportsPage.tsx"
click node_audit "https://github.com/sorded/cvm-elib-demo/blob/main/src/services/auditService.ts"
click node_user_service "https://github.com/sorded/cvm-elib-demo/blob/main/src/services/userService.ts"
click node_auth_service "https://github.com/sorded/cvm-elib-demo/blob/main/src/services/authService.ts"
click node_store "https://github.com/sorded/cvm-elib-demo/blob/main/src/services/store.ts"
click node_live "https://github.com/sorded/cvm-elib-demo/blob/main/src/hooks/useLive.ts"
click node_navigation "https://github.com/sorded/cvm-elib-demo/blob/main/src/config/navigation.ts"

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_router,node_login,node_sessions,node_auth_service,node_navigation,node_visitor toneBlue
class node_home,node_search,node_subjects,node_resource,node_reader,node_library_saved toneAmber
class node_manage,node_resource_form toneMint
class node_resource_service,node_users,node_admin_ui,node_subjects_admin,node_types_admin,node_announcements,node_reports,node_audit,node_user_service,node_store,node_live toneRose
```

## Components

### App and access

- [Route and guard layer](https://github.com/sorded/cvm-elib-demo/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in](https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/auth/LoginPage.tsx): `src/pages/auth/LoginPage.tsx`
- [Session state](https://github.com/sorded/cvm-elib-demo/blob/main/src/hooks/useSession.ts): `src/hooks/useSession.ts`
- [Authentication service](https://github.com/sorded/cvm-elib-demo/blob/main/src/services/authService.ts): `src/services/authService.ts`
- [Navigation configuration](https://github.com/sorded/cvm-elib-demo/blob/main/src/config/navigation.ts): `src/config/navigation.ts`

### Student library

- [Library home](https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/student/HomePage.tsx): `src/pages/student/HomePage.tsx`
- [Resource search](https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/student/SearchPage.tsx): `src/pages/student/SearchPage.tsx`
- [Subject catalog](https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/student/SubjectsPage.tsx): `src/pages/student/SubjectsPage.tsx`
- [Resource details](https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/student/ResourcePage.tsx): `src/pages/student/ResourcePage.tsx`
- [Reader and watch](https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/student/ReaderPage.tsx): `src/pages/student/ReaderPage.tsx`
- [Saved library](https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/student/LibraryPage.tsx): `src/pages/student/LibraryPage.tsx`

### Publishing

- [Resource management](https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/manage/ManageResourcesPage.tsx): `src/pages/manage/ManageResourcesPage.tsx`
- [Resource publishing form](https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/manage/ResourceFormPage.tsx): `src/pages/manage/ResourceFormPage.tsx`

### Administration and data

- [Resource catalog service](https://github.com/sorded/cvm-elib-demo/blob/main/src/services/resourceService.ts): `src/services/resourceService.ts`
- [User administration](https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/admin/UsersPage.tsx): `src/pages/admin/UsersPage.tsx`
- [Admin interface parts](https://github.com/sorded/cvm-elib-demo/blob/main/src/components/admin/AdminUi.tsx): `src/components/admin/AdminUi.tsx`
- [Subject administration](https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/admin/SubjectsAdminPage.tsx): `src/pages/admin/SubjectsAdminPage.tsx`
- [Resource type administration](https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/admin/ResourceTypesPage.tsx): `src/pages/admin/ResourceTypesPage.tsx`
- [Announcements](https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/admin/AnnouncementsPage.tsx): `src/pages/admin/AnnouncementsPage.tsx`
- [Reports](https://github.com/sorded/cvm-elib-demo/blob/main/src/pages/admin/ReportsPage.tsx): `src/pages/admin/ReportsPage.tsx`
- [Audit service](https://github.com/sorded/cvm-elib-demo/blob/main/src/services/auditService.ts): `src/services/auditService.ts`
- [User service](https://github.com/sorded/cvm-elib-demo/blob/main/src/services/userService.ts): `src/services/userService.ts`
- [Local data store](https://github.com/sorded/cvm-elib-demo/blob/main/src/services/store.ts): `src/services/store.ts`
- [Live update hook](https://github.com/sorded/cvm-elib-demo/blob/main/src/hooks/useLive.ts): `src/hooks/useLive.ts`

### Other components

- **Library user**

## Connections

- Library user → Route and guard layer: opens app
- Route and guard layer → Sign-in: routes to (evidence: `src/App.tsx`)
- Route and guard layer → Library home: routes to (evidence: `src/App.tsx`)
- Route and guard layer → Resource search: routes to (evidence: `src/App.tsx`)
- Route and guard layer → Subject catalog: routes to (evidence: `src/App.tsx`)
- Route and guard layer → Resource details: routes to (evidence: `src/App.tsx`)
- Route and guard layer → Reader and watch: routes to (evidence: `src/App.tsx`)
- Route and guard layer → Saved library: routes to (evidence: `src/App.tsx`)
- Route and guard layer → Resource management: routes to (evidence: `src/App.tsx`)
- Route and guard layer → Resource publishing form: routes to (evidence: `src/App.tsx`)
- Route and guard layer → User administration: routes to (evidence: `src/App.tsx`)
- Route and guard layer → Subject administration: routes to (evidence: `src/App.tsx`)
- Route and guard layer → Resource type administration: routes to (evidence: `src/App.tsx`)
- Route and guard layer → Announcements: routes to (evidence: `src/App.tsx`)
- Route and guard layer → Reports: routes to (evidence: `src/App.tsx`)
- Route and guard layer → Navigation configuration: uses roles (evidence: `src/App.tsx`)
- Sign-in → Authentication service: authenticates with
- Session state → Authentication service: reads session (evidence: `src/hooks/useSession.ts`)
- Authentication service → User service: checks account (evidence: `src/services/authService.ts`)
- Authentication service → Local data store: reads and updates (evidence: `src/services/authService.ts`)
- Resource management → Resource catalog service: lists and changes (evidence: `src/pages/manage/ManageResourcesPage.tsx`)
- Resource catalog service → Local data store: reads and commits (evidence: `src/services/resourceService.ts`)
- Resource catalog service → Audit service: logs actions (evidence: `src/services/resourceService.ts`)
- User service → Local data store: reads and commits (evidence: `src/services/userService.ts`)
- User service → Audit service: logs actions (evidence: `src/services/userService.ts`)
- User administration → Admin interface parts: uses controls (evidence: `src/pages/admin/UsersPage.tsx`)
- User administration → User service: manages accounts (evidence: `src/pages/admin/UsersPage.tsx`)
- Audit service → Local data store: reads and commits (evidence: `src/services/auditService.ts`)
- Live update hook → Local data store: subscribes to changes (evidence: `src/hooks/useLive.ts`)
- Library home → Resource catalog service: loads resources
- Resource search → Resource catalog service: searches catalog (evidence: `src/pages/student/SearchPage.tsx`)
- Resource details → Resource catalog service: loads resource
- Reader and watch → Resource catalog service: loads content
- Announcements → Local data store: uses data
- Reports → Local data store: uses data
