# nikhil-4404/trustshare architecture

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

- Interactive diagram: https://gitdiagram.com/nikhil-4404/trustshare
- Repository: https://github.com/nikhil-4404/trustshare

## Overview

TrustShare is a secure file-sharing platform with a React client and FastAPI server. Users authenticate, organize and upload files, share them directly or through public links, and access shared files; the server also provides search, summaries, assistant chat, analytics, audit activity, and administration. The graph shows documented product capabilities and sampled controller responsibilities. Some backend service-to-storage wiring and several feature implementations were not included in the excerpts, so those relationships are left unspecified.

Main entry points: [`project-root/client/src/App.js`](https://github.com/nikhil-4404/trustshare/blob/main/project-root/client/src/App.js) (React app), [`project-root/server/src/analytics/controller.py`](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/analytics/controller.py) (Analytics endpoints), [`project-root/server/src/api.py`](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/api.py) (FastAPI application), [`project-root/client/src/features/sharing/SharingHub.js`](https://github.com/nikhil-4404/trustshare/blob/main/project-root/client/src/features/sharing/SharingHub.js) (Sharing hub)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["React app<br/>[App.js]"]
  node_workspace["File workspace<br/>[MyFiles.js]"]
  node_shareui["Sharing hub<br/>[SharingHub.js]"]
  node_analyticsui["Analytics UI<br/>[Analytics.js]"]
  node_assistantui["Assistant UI<br/>[AssistantPage.js]"]
end

subgraph group_identity["Identity and access"]
  node_authcontroller["Auth endpoints<br/>[controller.py]"]
  node_authservice["Auth service<br/>[service.py]"]
end

subgraph group_files["Files and sharing"]
  node_filecontroller["File endpoints<br/>[controller.py]"]
  node_fileservice["File service<br/>[service.py]"]
  node_sharecontroller["Shared files<br/>[controller.py]"]
  node_sharelinks["Share links<br/>[controller.py]"]
  node_foldercontroller["Folders<br/>[controller.py]"]
  node_search["Content search<br/>[controller.py]"]
end

subgraph group_insights["Insights and assistant"]
  node_summary["File summaries<br/>[controller.py]"]
  node_analyticscontroller["Analytics endpoints<br/>[controller.py]"]
  node_analyticsservice["Analytics service<br/>[service.py]"]
  node_activity["Activity stream<br/>[controller.py]"]
  node_chatcontroller["Assistant chat<br/>[controller.py]"]
  node_chatservice["Chat service<br/>[chat_service.py]"]
end

subgraph group_server["API and persistence"]
  node_admin["Admin controls<br/>[controller.py]"]
  node_database[("PostgreSQL<br/>[core.py]")]
  node_securestorage[("Encrypted storage<br/>[secure_storage.py]")]
  node_api["FastAPI application<br/>[api.py]"]
end

node_user(("User"))
node_llm{{"LLM provider"}}

node_user -->|"uses"| node_webapp
node_webapp -->|"opens"| node_workspace
node_webapp -->|"opens"| node_shareui
node_webapp -->|"opens"| node_analyticsui
node_webapp -->|"opens"| node_assistantui
node_workspace -->|"file requests"| node_filecontroller
node_shareui -->|"share requests"| node_sharelinks
node_shareui -->|"shared-file requests"| node_sharecontroller
node_analyticsui -->|"analytics requests"| node_analyticscontroller
node_assistantui -->|"chat requests"| node_chatcontroller
node_authcontroller -->|"calls"| node_authservice
node_filecontroller -->|"calls"| node_fileservice
node_sharecontroller -->|"retrieves file"| node_fileservice
node_chatcontroller -->|"calls"| node_chatservice
node_chatservice -.->|"sends prompts"| node_llm
node_analyticscontroller -->|"requests metrics"| node_analyticsservice
node_analyticscontroller -->|"queries"| node_database
node_authcontroller -->|"reads and writes"| node_database
node_admin -->|"queries and updates"| node_database
node_api -->|"serves routes"| node_authcontroller
node_api -->|"serves routes"| node_filecontroller
node_api -->|"serves routes"| node_analyticscontroller

click node_webapp "https://github.com/nikhil-4404/trustshare/blob/main/project-root/client/src/App.js"
click node_workspace "https://github.com/nikhil-4404/trustshare/blob/main/project-root/client/src/features/myFiles/MyFiles.js"
click node_shareui "https://github.com/nikhil-4404/trustshare/blob/main/project-root/client/src/features/sharing/SharingHub.js"
click node_analyticsui "https://github.com/nikhil-4404/trustshare/blob/main/project-root/client/src/features/analytics/Analytics.js"
click node_assistantui "https://github.com/nikhil-4404/trustshare/blob/main/project-root/client/src/features/assistant/AssistantPage.js"
click node_authcontroller "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/auth/controller.py"
click node_authservice "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/auth/service.py"
click node_filecontroller "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/files/controller.py"
click node_fileservice "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/files/service.py"
click node_sharecontroller "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/shared_with_me/controller.py"
click node_sharelinks "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/shares/controller.py"
click node_foldercontroller "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/folders/controller.py"
click node_search "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/search/controller.py"
click node_summary "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/file_summaries/controller.py"
click node_analyticscontroller "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/analytics/controller.py"
click node_analyticsservice "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/analytics/service.py"
click node_activity "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/activity/controller.py"
click node_chatcontroller "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/assistant/controller.py"
click node_chatservice "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/assistant/chat_service.py"
click node_admin "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/admin/controller.py"
click node_database "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/database/core.py"
click node_securestorage "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/security/secure_storage.py"
click node_api "https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/api.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_webapp,node_workspace,node_shareui,node_analyticsui,node_assistantui,node_user toneBlue
class node_authcontroller,node_authservice toneAmber
class node_filecontroller,node_fileservice,node_sharecontroller,node_sharelinks,node_foldercontroller,node_search toneMint
class node_summary,node_analyticscontroller,node_analyticsservice,node_activity,node_chatcontroller,node_chatservice toneRose
class node_admin,node_database,node_securestorage,node_api,node_llm toneIndigo
```

## Components

### Web client

- [React app](https://github.com/nikhil-4404/trustshare/blob/main/project-root/client/src/App.js): `project-root/client/src/App.js`
- [File workspace](https://github.com/nikhil-4404/trustshare/blob/main/project-root/client/src/features/myFiles/MyFiles.js): `project-root/client/src/features/myFiles/MyFiles.js`
- [Sharing hub](https://github.com/nikhil-4404/trustshare/blob/main/project-root/client/src/features/sharing/SharingHub.js): `project-root/client/src/features/sharing/SharingHub.js`
- [Analytics UI](https://github.com/nikhil-4404/trustshare/blob/main/project-root/client/src/features/analytics/Analytics.js): `project-root/client/src/features/analytics/Analytics.js`
- [Assistant UI](https://github.com/nikhil-4404/trustshare/blob/main/project-root/client/src/features/assistant/AssistantPage.js): `project-root/client/src/features/assistant/AssistantPage.js`

### Identity and access

- [Auth endpoints](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/auth/controller.py): `project-root/server/src/auth/controller.py`
- [Auth service](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/auth/service.py): `project-root/server/src/auth/service.py`

### Files and sharing

- [File endpoints](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/files/controller.py): `project-root/server/src/files/controller.py`
- [File service](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/files/service.py): `project-root/server/src/files/service.py`
- [Shared files](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/shared_with_me/controller.py): `project-root/server/src/shared_with_me/controller.py`
- [Share links](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/shares/controller.py): `project-root/server/src/shares/controller.py`
- [Folders](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/folders/controller.py): `project-root/server/src/folders/controller.py`
- [Content search](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/search/controller.py): `project-root/server/src/search/controller.py`

### Insights and assistant

- [File summaries](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/file_summaries/controller.py): `project-root/server/src/file_summaries/controller.py`
- [Analytics endpoints](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/analytics/controller.py): `project-root/server/src/analytics/controller.py`
- [Analytics service](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/analytics/service.py): `project-root/server/src/analytics/service.py`
- [Activity stream](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/activity/controller.py): `project-root/server/src/activity/controller.py`
- [Assistant chat](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/assistant/controller.py): `project-root/server/src/assistant/controller.py`
- [Chat service](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/assistant/chat_service.py): `project-root/server/src/assistant/chat_service.py`

### API and persistence

- [Admin controls](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/admin/controller.py): `project-root/server/src/admin/controller.py`
- [PostgreSQL](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/database/core.py): `project-root/server/src/database/core.py`
- [Encrypted storage](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/security/secure_storage.py): `project-root/server/src/security/secure_storage.py`
- [FastAPI application](https://github.com/nikhil-4404/trustshare/blob/main/project-root/server/src/api.py): `project-root/server/src/api.py`

### Other components

- **User**
- **LLM provider**

## Connections

- User → React app: uses
- React app → File workspace: opens
- React app → Sharing hub: opens
- React app → Analytics UI: opens
- React app → Assistant UI: opens
- File workspace → File endpoints: file requests
- Sharing hub → Share links: share requests
- Sharing hub → Shared files: shared-file requests
- Analytics UI → Analytics endpoints: analytics requests
- Assistant UI → Assistant chat: chat requests
- Auth endpoints → Auth service: calls
- File endpoints → File service: calls
- Shared files → File service: retrieves file
- Assistant chat → Chat service: calls
- Chat service → LLM provider: sends prompts
- Analytics endpoints → Analytics service: requests metrics
- Analytics endpoints → PostgreSQL: queries
- Auth endpoints → PostgreSQL: reads and writes
- Admin controls → PostgreSQL: queries and updates
- FastAPI application → Auth endpoints: serves routes
- FastAPI application → File endpoints: serves routes
- FastAPI application → Analytics endpoints: serves routes
