# 666666999999666/proxy architecture

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

- Interactive diagram: https://gitdiagram.com/666666999999666/proxy
- Repository: https://github.com/666666999999666/proxy

## Overview

JChatMind Proxy combines a Vue management console with a Spring service that authenticates users and forwards client API requests to configured LLM providers. The main serving path is an API client calling an LLM or generic proxy endpoint, which forwards upstream and records call results; the console separately supports authentication, monitoring, and administration. The README documents credential encryption, temporary proxy tokens, fallback, and header filtering, but credential implementation files are absent from the supplied tree, so their internal wiring is not shown.

Main entry points: [`frontend/src/views`](https://github.com/666666999999666/proxy/tree/main/frontend/src/views) (Console pages), [`src/main/java/com/jchatmind/proxy/proxy/LlmProxyController.java`](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/proxy/LlmProxyController.java) (LLM endpoint), [`src/main/java/com/jchatmind/proxy/proxy/GenericProxyService.java`](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/proxy/GenericProxyService.java) (Generic forwarding), [`src/main/java/com/jchatmind/proxy/audit/DashboardApiController.java`](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/audit/DashboardApiController.java) (Dashboard API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Management console"]
  node_console_app["Vue application<br/>[main.js]"]
  node_views["Console pages"]
  node_frontend_api["API clients"]
  node_api_util["HTTP utility<br/>[api.js]"]
end

subgraph group_identity["Identity and access"]
  node_auth_controller["Auth endpoints"]
  node_auth_service["Auth service<br/>[AuthService.java]"]
  node_mfa_service["MFA service<br/>[MfaService.java]"]
  node_jwt_filter["JWT filter"]
  node_user_repository["User repository"]
  node_access_control["Token permissions"]
end

subgraph group_serving["Proxy serving"]
  node_llm_controller["LLM endpoint"]
  node_generic_controller["Generic endpoint"]
  node_generic_service["Generic forwarding"]
  node_properties["Proxy configuration"]
end

subgraph group_operations["Operations and audit"]
  node_dashboard_api["Dashboard API"]
  node_health_service["Provider health"]
  node_health_history["Health history"]
  node_call_log_service["Call logging"]
  node_call_log_repository["Call log store"]
  node_audit_controller["Audit endpoints"]
  node_audit_service["Audit service"]
  node_audit_repository["Audit store"]
  node_config_watch["Config reload"]
end

node_browser(("Console user"))
node_api_client(("API client"))
node_postgres[("PostgreSQL")]
node_provider{{"LLM providers"}}

node_browser -->|"uses"| node_console_app
node_console_app -->|"renders"| node_views
node_views -->|"requests"| node_frontend_api
node_frontend_api -->|"uses"| node_api_util
node_api_util -->|"HTTP calls"| node_auth_controller
node_auth_controller -->|"delegates"| node_auth_service
node_auth_service -->|"reads/writes"| node_user_repository
node_auth_service -->|"verifies MFA"| node_mfa_service
node_user_repository -->|"persists users"| node_postgres
node_api_client -->|"sends requests"| node_llm_controller
node_api_client -->|"sends requests"| node_generic_controller
node_llm_controller -->|"forwards; fallback"| node_provider
node_llm_controller -->|"records calls"| node_call_log_service
node_generic_controller -->|"delegates"| node_generic_service
node_generic_service -->|"forwards requests"| node_provider
node_generic_service -->|"records calls"| node_call_log_service
node_llm_controller -->|"reads routing"| node_properties
node_generic_service -->|"reads configuration"| node_properties
node_generic_controller -->|"checks permissions"| node_access_control
node_jwt_filter -->|"guards requests"| node_auth_controller
node_views -->|"requests status"| node_dashboard_api
node_dashboard_api -->|"reads health"| node_health_service
node_dashboard_api -->|"reads history"| node_health_history
node_dashboard_api -->|"reads models"| node_properties
node_call_log_service -->|"stores and queries"| node_call_log_repository
node_call_log_repository -->|"persists logs"| node_postgres
node_views -->|"requests audit"| node_audit_controller
node_audit_controller -->|"delegates"| node_audit_service
node_audit_service -->|"queries and writes"| node_audit_repository
node_audit_repository -->|"persists audit"| node_postgres
node_config_watch -->|"reloads configuration"| node_properties
node_config_watch -->|"refreshes dependencies"| node_health_service

click node_console_app "https://github.com/666666999999666/proxy/blob/main/frontend/src/main.js"
click node_views "https://github.com/666666999999666/proxy/tree/main/frontend/src/views"
click node_frontend_api "https://github.com/666666999999666/proxy/tree/main/frontend/src/api"
click node_api_util "https://github.com/666666999999666/proxy/blob/main/frontend/src/utils/api.js"
click node_auth_controller "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/auth/controller/AuthController.java"
click node_auth_service "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/auth/service/AuthService.java"
click node_mfa_service "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/auth/service/MfaService.java"
click node_jwt_filter "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/auth/filter/JwtAuthenticationFilter.java"
click node_user_repository "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/auth/repository/UserRepository.java"
click node_llm_controller "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/proxy/LlmProxyController.java"
click node_generic_controller "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/proxy/GenericProxyController.java"
click node_generic_service "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/proxy/GenericProxyService.java"
click node_properties "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/config/ProxyProperties.java"
click node_access_control "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/auth/AccessControlService.java"
click node_dashboard_api "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/audit/DashboardApiController.java"
click node_health_service "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/proxy/ProviderHealthService.java"
click node_health_history "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/proxy/HealthHistoryService.java"
click node_call_log_service "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/audit/service/ApiCallLogService.java"
click node_call_log_repository "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/audit/repository/ApiCallLogRepository.java"
click node_audit_controller "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/audit/controller/AuditLogController.java"
click node_audit_service "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/audit/service/AuditLogService.java"
click node_audit_repository "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/audit/repository/AuditLogRepository.java"
click node_config_watch "https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/config/ConfigWatchService.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_console_app,node_views,node_frontend_api,node_api_util,node_browser,node_api_client toneBlue
class node_auth_controller,node_auth_service,node_mfa_service,node_jwt_filter,node_user_repository,node_access_control,node_postgres toneAmber
class node_llm_controller,node_generic_controller,node_generic_service,node_properties toneMint
class node_dashboard_api,node_health_service,node_health_history,node_call_log_service,node_call_log_repository,node_audit_controller,node_audit_service,node_audit_repository,node_config_watch toneRose
class node_provider toneIndigo
```

## Components

### Management console

- [Vue application](https://github.com/666666999999666/proxy/blob/main/frontend/src/main.js): `frontend/src/main.js`
- [Console pages](https://github.com/666666999999666/proxy/tree/main/frontend/src/views): `frontend/src/views`
- [API clients](https://github.com/666666999999666/proxy/tree/main/frontend/src/api): `frontend/src/api`
- [HTTP utility](https://github.com/666666999999666/proxy/blob/main/frontend/src/utils/api.js): `frontend/src/utils/api.js`

### Identity and access

- [Auth endpoints](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/auth/controller/AuthController.java): `src/main/java/com/jchatmind/proxy/auth/controller/AuthController.java`
- [Auth service](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/auth/service/AuthService.java): `src/main/java/com/jchatmind/proxy/auth/service/AuthService.java`
- [MFA service](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/auth/service/MfaService.java): `src/main/java/com/jchatmind/proxy/auth/service/MfaService.java`
- [JWT filter](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/auth/filter/JwtAuthenticationFilter.java): `src/main/java/com/jchatmind/proxy/auth/filter/JwtAuthenticationFilter.java`
- [User repository](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/auth/repository/UserRepository.java): `src/main/java/com/jchatmind/proxy/auth/repository/UserRepository.java`
- [Token permissions](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/auth/AccessControlService.java): `src/main/java/com/jchatmind/proxy/auth/AccessControlService.java`

### Proxy serving

- [LLM endpoint](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/proxy/LlmProxyController.java): `src/main/java/com/jchatmind/proxy/proxy/LlmProxyController.java`
- [Generic endpoint](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/proxy/GenericProxyController.java): `src/main/java/com/jchatmind/proxy/proxy/GenericProxyController.java`
- [Generic forwarding](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/proxy/GenericProxyService.java): `src/main/java/com/jchatmind/proxy/proxy/GenericProxyService.java`
- [Proxy configuration](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/config/ProxyProperties.java): `src/main/java/com/jchatmind/proxy/config/ProxyProperties.java`

### Operations and audit

- [Dashboard API](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/audit/DashboardApiController.java): `src/main/java/com/jchatmind/proxy/audit/DashboardApiController.java`
- [Provider health](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/proxy/ProviderHealthService.java): `src/main/java/com/jchatmind/proxy/proxy/ProviderHealthService.java`
- [Health history](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/proxy/HealthHistoryService.java): `src/main/java/com/jchatmind/proxy/proxy/HealthHistoryService.java`
- [Call logging](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/audit/service/ApiCallLogService.java): `src/main/java/com/jchatmind/proxy/audit/service/ApiCallLogService.java`
- [Call log store](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/audit/repository/ApiCallLogRepository.java): `src/main/java/com/jchatmind/proxy/audit/repository/ApiCallLogRepository.java`
- [Audit endpoints](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/audit/controller/AuditLogController.java): `src/main/java/com/jchatmind/proxy/audit/controller/AuditLogController.java`
- [Audit service](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/audit/service/AuditLogService.java): `src/main/java/com/jchatmind/proxy/audit/service/AuditLogService.java`
- [Audit store](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/audit/repository/AuditLogRepository.java): `src/main/java/com/jchatmind/proxy/audit/repository/AuditLogRepository.java`
- [Config reload](https://github.com/666666999999666/proxy/blob/main/src/main/java/com/jchatmind/proxy/config/ConfigWatchService.java): `src/main/java/com/jchatmind/proxy/config/ConfigWatchService.java`

### Other components

- **Console user**
- **API client**
- **PostgreSQL**
- **LLM providers**

## Connections

- Console user → Vue application: uses
- Vue application → Console pages: renders
- Console pages → API clients: requests
- API clients → HTTP utility: uses
- HTTP utility → Auth endpoints: HTTP calls
- Auth endpoints → Auth service: delegates
- Auth service → User repository: reads/writes
- Auth service → MFA service: verifies MFA
- User repository → PostgreSQL: persists users
- API client → LLM endpoint: sends requests
- API client → Generic endpoint: sends requests
- LLM endpoint → LLM providers: forwards; fallback
- LLM endpoint → Call logging: records calls
- Generic endpoint → Generic forwarding: delegates
- Generic forwarding → LLM providers: forwards requests
- Generic forwarding → Call logging: records calls
- LLM endpoint → Proxy configuration: reads routing
- Generic forwarding → Proxy configuration: reads configuration
- Generic endpoint → Token permissions: checks permissions
- JWT filter → Auth endpoints: guards requests
- Console pages → Dashboard API: requests status
- Dashboard API → Provider health: reads health
- Dashboard API → Health history: reads history
- Dashboard API → Proxy configuration: reads models
- Call logging → Call log store: stores and queries
- Call log store → PostgreSQL: persists logs
- Console pages → Audit endpoints: requests audit
- Audit endpoints → Audit service: delegates
- Audit service → Audit store: queries and writes
- Audit store → PostgreSQL: persists audit
- Config reload → Proxy configuration: reloads configuration
- Config reload → Provider health: refreshes dependencies
