# trinhcong1120/khaosat_client_for_springboot architecture

> Architecture diagram of the GitHub repository trinhcong1120/khaosat_client_for_springboot, 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/trinhcong1120/khaosat_client_for_springboot
- Repository: https://github.com/trinhcong1120/khaosat_client_for_springboot

## Overview

This is a Next.js survey-management frontend. Respondents enter a survey and submit answers; administrators manage survey definitions and review responses, while also administering users, roles, menus, API keys, and functions. The tree establishes these product areas, and sampled code confirms question editing, dashboard loading, menu retrieval, and failed-submission file operations. Most page-to-component wiring and the backend implementation were not sampled, so those relationships are not inferred.

Main entry points: [`src/app/admin`](https://github.com/trinhcong1120/khaosat_client_for_springboot/tree/main/src/app/admin) (Admin pages), [`src/components/surveys/QuestionEditor.tsx`](https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/components/surveys/QuestionEditor.tsx) (Question editor), [`src/lib/failedSurveyStorage.ts`](https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/lib/failedSurveyStorage.ts) (Failed-file client), [`src/app/admin/survey`](https://github.com/trinhcong1120/khaosat_client_for_springboot/tree/main/src/app/admin/survey) (Survey management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_respond["Survey experience"]
  node_survey_pages["Survey pages"]
end

subgraph group_admin["Administration"]
  node_survey_editor["Survey authoring"]
  node_survey_admin["Survey management"]
  node_question_editor["Question editor<br/>[QuestionEditor.tsx]"]
  node_admin_pages["Admin pages"]
  node_admin_sidebar["Admin navigation<br/>[AdminSidebar.tsx]"]
  node_signin["Sign-in<br/>[SignInForm.tsx]"]
end

subgraph group_insights["Reporting and recovery"]
  node_admin_dashboard["Dashboard<br/>[AdminDashboard.tsx]"]
  node_results["Response results"]
  node_failed_panel["Failed submissions"]
end

subgraph group_services["Client services"]
  node_auth_lib["Auth utilities<br/>[auth.ts]"]
  node_dashboard_lib["Dashboard client<br/>[dashboard.ts]"]
  node_api_lib["API configuration<br/>[api.ts]"]
  node_failed_storage["Failed-file client"]
end

node_respondent(("Respondent"))
node_backend{{"Application API"}}
node_menus_api{{"Menu service"}}

node_respondent -->|"opens survey"| node_survey_pages
node_admin_pages -->|"renders dashboard"| node_admin_dashboard
node_admin_pages -->|"manages surveys"| node_survey_admin
node_survey_admin -->|"edits questions"| node_question_editor
node_admin_pages -->|"reviews responses"| node_results
node_admin_pages -->|"reviews failures"| node_failed_panel
node_admin_pages -->|"shows navigation"| node_admin_sidebar
node_admin_pages -->|"offers sign-in"| node_signin
node_signin -->|"uses auth state"| node_auth_lib
node_admin_dashboard -->|"loads metrics"| node_dashboard_lib
node_dashboard_lib -->|"requests metrics"| node_backend
node_question_editor -->|"uses endpoints"| node_api_lib
node_question_editor -->|"saves questions"| node_backend
node_admin_sidebar -->|"fetches menu"| node_menus_api
node_failed_panel -->|"manages files"| node_failed_storage
node_failed_storage -->|"uses endpoint"| node_api_lib
node_failed_storage -->|"uploads and retrieves"| node_backend

click node_survey_pages "https://github.com/trinhcong1120/khaosat_client_for_springboot/tree/main/src/app/survey"
click node_survey_editor "https://github.com/trinhcong1120/khaosat_client_for_springboot/tree/main/src/components/surveys"
click node_survey_admin "https://github.com/trinhcong1120/khaosat_client_for_springboot/tree/main/src/app/admin/survey"
click node_question_editor "https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/components/surveys/QuestionEditor.tsx"
click node_admin_pages "https://github.com/trinhcong1120/khaosat_client_for_springboot/tree/main/src/app/admin"
click node_admin_dashboard "https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/components/admin/AdminDashboard.tsx"
click node_results "https://github.com/trinhcong1120/khaosat_client_for_springboot/tree/main/src/components/result"
click node_failed_panel "https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/components/result/FailedSurveysPanel.tsx"
click node_admin_sidebar "https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/layout/AdminSidebar.tsx"
click node_signin "https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/components/auth/SignInForm.tsx"
click node_auth_lib "https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/lib/auth.ts"
click node_dashboard_lib "https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/lib/dashboard.ts"
click node_api_lib "https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/lib/api.ts"
click node_failed_storage "https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/lib/failedSurveyStorage.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_survey_pages toneBlue
class node_survey_editor,node_survey_admin,node_question_editor,node_admin_pages,node_admin_sidebar,node_signin toneAmber
class node_admin_dashboard,node_results,node_failed_panel,node_backend toneMint
class node_auth_lib,node_dashboard_lib,node_api_lib,node_failed_storage toneRose
class node_respondent,node_menus_api toneIndigo
```

## Components

### Survey experience

- [Survey pages](https://github.com/trinhcong1120/khaosat_client_for_springboot/tree/main/src/app/survey): `src/app/survey`

### Administration

- [Survey authoring](https://github.com/trinhcong1120/khaosat_client_for_springboot/tree/main/src/components/surveys): `src/components/surveys`
- [Survey management](https://github.com/trinhcong1120/khaosat_client_for_springboot/tree/main/src/app/admin/survey): `src/app/admin/survey`
- [Question editor](https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/components/surveys/QuestionEditor.tsx): `src/components/surveys/QuestionEditor.tsx`
- [Admin pages](https://github.com/trinhcong1120/khaosat_client_for_springboot/tree/main/src/app/admin): `src/app/admin`
- [Admin navigation](https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/layout/AdminSidebar.tsx): `src/layout/AdminSidebar.tsx`
- [Sign-in](https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/components/auth/SignInForm.tsx): `src/components/auth/SignInForm.tsx`

### Reporting and recovery

- [Dashboard](https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/components/admin/AdminDashboard.tsx): `src/components/admin/AdminDashboard.tsx`
- [Response results](https://github.com/trinhcong1120/khaosat_client_for_springboot/tree/main/src/components/result): `src/components/result`
- [Failed submissions](https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/components/result/FailedSurveysPanel.tsx): `src/components/result/FailedSurveysPanel.tsx`

### Client services

- [Auth utilities](https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Dashboard client](https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/lib/dashboard.ts): `src/lib/dashboard.ts`
- [API configuration](https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [Failed-file client](https://github.com/trinhcong1120/khaosat_client_for_springboot/blob/main/src/lib/failedSurveyStorage.ts): `src/lib/failedSurveyStorage.ts`

### Other components

- **Respondent**
- **Application API**
- **Menu service**

## Connections

- Respondent → Survey pages: opens survey
- Admin pages → Dashboard: renders dashboard
- Admin pages → Survey management: manages surveys
- Survey management → Question editor: edits questions
- Admin pages → Response results: reviews responses
- Admin pages → Failed submissions: reviews failures
- Admin pages → Admin navigation: shows navigation
- Admin pages → Sign-in: offers sign-in
- Sign-in → Auth utilities: uses auth state
- Dashboard → Dashboard client: loads metrics
- Dashboard client → Application API: requests metrics
- Question editor → API configuration: uses endpoints
- Question editor → Application API: saves questions
- Admin navigation → Menu service: fetches menu
- Failed submissions → Failed-file client: manages files
- Failed-file client → API configuration: uses endpoint
- Failed-file client → Application API: uploads and retrieves
