# tobby888/photolib architecture

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

- Interactive diagram: https://gitdiagram.com/tobby888/photolib
- Repository: https://github.com/tobby888/photolib
- Video tour (about a minute): https://gitdiagram.com/tobby888/photolib/video

## Overview

PhotoLib is a campus photography operations platform: users create projects and photo requests, contributors accept requests and upload images, and managers organize and adopt photos before confirming work hours and exporting statistics. The README also documents recruitment, featured collections, surveys, messaging, administration, backups, and MCP access, so these appear as distinct capability branches. The tree and excerpts establish component boundaries, while some subsystem links rely on documented behavior rather than sampled implementation; uncertain internal calls are omitted.

Main entry points: [`src/App.tsx`](https://github.com/tobby888/photolib/blob/master/src/App.tsx) (Web application), [`backend/src/main/java/cn/photolib/photo/PhotoController.java`](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/photo/PhotoController.java) (Photo management), [`backend/src/main/java/cn/photolib/photo/PhotoProcessingService.java`](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/photo/PhotoProcessingService.java) (Image processing), [`backend/src/main/java/cn/photolib/storage/ObjectStorageService.java`](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/storage/ObjectStorageService.java) (Object storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_work["Photo workflow"]
  node_projects["Projects and requests"]
  node_requests["Request fulfillment"]
  node_photo["Photo management"]
  node_batch["Batch upload"]
  node_processing["Image processing"]
  node_native["Native image engine<br/>[vips_bridge.c]"]
  node_adoption["Adoption records"]
  node_worklogs["Work hours"]
end

subgraph group_people["People and collaboration"]
  node_campus["Campus directory"]
  node_messaging["Notifications"]
end

subgraph group_operations["Operations"]
  node_statistics["Statistics and export"]
  node_recruitment["Member recruitment"]
  node_featured["Featured collections"]
  node_survey["Surveys"]
  node_admin["Administration"]
  node_backup["Database backup"]
end

subgraph group_platform["Platform services"]
  node_storage["Object storage"]
  node_auth["Authentication and MFA"]
end

subgraph group_integration["AI integration"]
  node_mcp["MCP service<br/>[server.py]"]
  node_mcp_auth["MCP authorization"]
end

node_user(("Department users"))
node_web["Web application<br/>[App.tsx]"]
node_oss[("Aliyun OSS")]

node_user -->|"uses"| node_web
node_web -->|"manages projects"| node_projects
node_web -->|"fulfills requests"| node_requests
node_web -->|"manages photos"| node_photo
node_requests -->|"submits images"| node_photo
node_web -->|"uploads batches"| node_batch
node_batch -->|"dispatches uploads"| node_processing
node_photo -->|"processes images"| node_processing
node_processing -->|"decodes and encodes"| node_native
node_photo -->|"stores objects"| node_storage
node_processing -->|"writes previews"| node_storage
node_storage -.->|"stores objects"| node_oss
node_web -->|"uses directory"| node_campus
node_web -->|"records adoption"| node_adoption
node_web -->|"submits hours"| node_worklogs
node_web -->|"requests exports"| node_statistics
node_web -->|"publishes applications"| node_recruitment
node_web -->|"manages collections"| node_featured
node_web -->|"manages surveys"| node_survey
node_web -->|"sends messages"| node_messaging
node_messaging -.->|"delivers via"| node_oss
node_web -->|"authenticates"| node_auth
node_web -->|"administers system"| node_admin
node_admin -->|"manages backups"| node_backup
node_user -.->|"requests AI actions"| node_mcp
node_mcp -.->|"requests authorization"| node_mcp_auth
node_mcp_auth -->|"uses identity"| node_auth

click node_web "https://github.com/tobby888/photolib/blob/master/src/App.tsx"
click node_projects "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/project/ProjectController.java"
click node_requests "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/request/RequestController.java"
click node_photo "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/photo/PhotoController.java"
click node_batch "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/photo/batch/BatchUploadController.java"
click node_processing "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/photo/PhotoProcessingService.java"
click node_native "https://github.com/tobby888/photolib/blob/master/backend/native/src/vips_bridge.c"
click node_storage "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/storage/ObjectStorageService.java"
click node_campus "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/campus/CampusController.java"
click node_adoption "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/adoption/AdoptionController.java"
click node_worklogs "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/worklog/WorklogController.java"
click node_statistics "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/statistics/StatisticsController.java"
click node_recruitment "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/recruitment/RecruitmentPublicController.java"
click node_featured "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/featured/FeaturedCollectionController.java"
click node_survey "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/survey/SurveyController.java"
click node_messaging "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/notification/NotificationController.java"
click node_auth "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/auth/AuthController.java"
click node_admin "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/admin/AdminController.java"
click node_backup "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/backup/DatabaseBackupController.java"
click node_mcp "https://github.com/tobby888/photolib/blob/master/mcp/photolib_mcp/server.py"
click node_mcp_auth "https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/mcp/McpAuthorizationService.java"

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_projects,node_requests,node_photo,node_batch,node_processing,node_native,node_adoption,node_worklogs,node_user toneBlue
class node_campus,node_messaging,node_oss toneAmber
class node_statistics,node_recruitment,node_featured,node_survey,node_admin,node_backup toneMint
class node_storage,node_auth toneRose
class node_mcp,node_mcp_auth toneIndigo
class node_web toneTeal
```

## Components

### Photo workflow

- [Projects and requests](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/project/ProjectController.java): `backend/src/main/java/cn/photolib/project/ProjectController.java`
- [Request fulfillment](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/request/RequestController.java): `backend/src/main/java/cn/photolib/request/RequestController.java`
- [Photo management](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/photo/PhotoController.java): `backend/src/main/java/cn/photolib/photo/PhotoController.java`
- [Batch upload](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/photo/batch/BatchUploadController.java): `backend/src/main/java/cn/photolib/photo/batch/BatchUploadController.java`
- [Image processing](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/photo/PhotoProcessingService.java): `backend/src/main/java/cn/photolib/photo/PhotoProcessingService.java`
- [Native image engine](https://github.com/tobby888/photolib/blob/master/backend/native/src/vips_bridge.c): `backend/native/src/vips_bridge.c`
- [Adoption records](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/adoption/AdoptionController.java): `backend/src/main/java/cn/photolib/adoption/AdoptionController.java`
- [Work hours](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/worklog/WorklogController.java): `backend/src/main/java/cn/photolib/worklog/WorklogController.java`

### People and collaboration

- [Campus directory](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/campus/CampusController.java): `backend/src/main/java/cn/photolib/campus/CampusController.java`
- [Notifications](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/notification/NotificationController.java): `backend/src/main/java/cn/photolib/notification/NotificationController.java`

### Operations

- [Statistics and export](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/statistics/StatisticsController.java): `backend/src/main/java/cn/photolib/statistics/StatisticsController.java`
- [Member recruitment](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/recruitment/RecruitmentPublicController.java): `backend/src/main/java/cn/photolib/recruitment/RecruitmentPublicController.java`
- [Featured collections](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/featured/FeaturedCollectionController.java): `backend/src/main/java/cn/photolib/featured/FeaturedCollectionController.java`
- [Surveys](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/survey/SurveyController.java): `backend/src/main/java/cn/photolib/survey/SurveyController.java`
- [Administration](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/admin/AdminController.java): `backend/src/main/java/cn/photolib/admin/AdminController.java`
- [Database backup](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/backup/DatabaseBackupController.java): `backend/src/main/java/cn/photolib/backup/DatabaseBackupController.java`

### Platform services

- [Object storage](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/storage/ObjectStorageService.java): `backend/src/main/java/cn/photolib/storage/ObjectStorageService.java`
- [Authentication and MFA](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/auth/AuthController.java): `backend/src/main/java/cn/photolib/auth/AuthController.java`

### AI integration

- [MCP service](https://github.com/tobby888/photolib/blob/master/mcp/photolib_mcp/server.py): `mcp/photolib_mcp/server.py`
- [MCP authorization](https://github.com/tobby888/photolib/blob/master/backend/src/main/java/cn/photolib/mcp/McpAuthorizationService.java): `backend/src/main/java/cn/photolib/mcp/McpAuthorizationService.java`

### Other components

- **Department users**
- [Web application](https://github.com/tobby888/photolib/blob/master/src/App.tsx): `src/App.tsx`
- **Aliyun OSS**

## Connections

- Department users → Web application: uses
- Web application → Projects and requests: manages projects
- Web application → Request fulfillment: fulfills requests
- Web application → Photo management: manages photos
- Request fulfillment → Photo management: submits images
- Web application → Batch upload: uploads batches
- Batch upload → Image processing: dispatches uploads
- Photo management → Image processing: processes images
- Image processing → Native image engine: decodes and encodes
- Photo management → Object storage: stores objects
- Image processing → Object storage: writes previews
- Object storage → Aliyun OSS: stores objects
- Web application → Campus directory: uses directory
- Web application → Adoption records: records adoption
- Web application → Work hours: submits hours
- Web application → Statistics and export: requests exports
- Web application → Member recruitment: publishes applications
- Web application → Featured collections: manages collections
- Web application → Surveys: manages surveys
- Web application → Notifications: sends messages
- Notifications → Aliyun OSS: delivers via
- Web application → Authentication and MFA: authenticates
- Web application → Administration: administers system
- Administration → Database backup: manages backups
- Department users → MCP service: requests AI actions
- MCP service → MCP authorization: requests authorization
- MCP authorization → Authentication and MFA: uses identity
