# b20dccn624/base-fe architecture

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

- Interactive diagram: https://gitdiagram.com/b20dccn624/base-fe
- Repository: https://github.com/b20dccn624/base-fe

## Overview

Behavior Analysis is a React-based administration app with login and protected navigation to dashboard, device, account, and event-management screens. The main workflow is to enter through login, reach a permission-checked page, then inspect or manage events—including filtering, paging, status changes, create/update/detail dialogs, and spreadsheet import. Redux persists authentication state, while shared layout and notification services support the screens. The README describes run modes, not product behavior; some feature and API implementations were not sampled, so uncertain links are omitted.

Main entry points: [`src/App.tsx`](https://github.com/b20dccn624/base-fe/blob/main/src/App.tsx) (App Routing), [`src/features/event/EventList.tsx`](https://github.com/b20dccn624/base-fe/blob/main/src/features/event/EventList.tsx) (Event List), [`src/routes/index.tsx`](https://github.com/b20dccn624/base-fe/blob/main/src/routes/index.tsx) (Route Registry), [`src/routes/ProtectedRoute.tsx`](https://github.com/b20dccn624/base-fe/blob/main/src/routes/ProtectedRoute.tsx) (Protected Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_app["App Routing<br/>[App.tsx]"]
  node_routes["Route Registry<br/>[index.tsx]"]
  node_layout["Admin Layout<br/>[LayoutPage.tsx]"]
end

subgraph group_identity["Identity and Access"]
  node_login["Login Screen<br/>[LoginPage.tsx]"]
  node_callback["Login Callback<br/>[LoginCallback.tsx]"]
  node_guard["Protected Routes<br/>[ProtectedRoute.tsx]"]
  node_permissions["Permission Checks"]
  node_auth[("Auth State<br/>[authSlice.ts]")]
end

subgraph group_features["Admin Features"]
  node_dashboard["Dashboard"]
  node_devices["Device Management"]
  node_accounts["Account Management"]
  node_events["Event List<br/>[EventList.tsx]"]
  node_eventforms["Event Dialogs<br/>[EvenForm.tsx]"]
  node_eventapi["Event API<br/>[api.ts]"]
end

subgraph group_shared["Shared UI and State"]
  node_store[("Persisted Store<br/>[store.ts]")]
  node_table["Table and Paging<br/>[index.tsx]"]
  node_notifications["Notifications"]
end

node_user(("Administrator"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_callback
node_app -->|"wraps pages"| node_layout
node_app -->|"protects pages"| node_guard
node_app -->|"uses routes"| node_routes
node_routes -->|"registers"| node_dashboard
node_routes -->|"registers"| node_devices
node_routes -->|"registers"| node_accounts
node_layout -->|"uses navigation"| node_routes
node_guard -->|"checks access"| node_permissions
node_guard -->|"reads auth"| node_store
node_store -->|"persists reducer"| node_auth
node_user -.->|"manages events"| node_events
node_events -->|"fetches and mutates"| node_eventapi
node_events -->|"opens dialogs"| node_eventforms
node_events -->|"renders results"| node_table
node_events -->|"reports upload status"| node_notifications
node_user -.->|"signs in"| node_login

click node_app "https://github.com/b20dccn624/base-fe/blob/main/src/App.tsx"
click node_routes "https://github.com/b20dccn624/base-fe/blob/main/src/routes/index.tsx"
click node_layout "https://github.com/b20dccn624/base-fe/blob/main/src/components/layout/LayoutPage.tsx"
click node_login "https://github.com/b20dccn624/base-fe/blob/main/src/features/login/LoginPage.tsx"
click node_callback "https://github.com/b20dccn624/base-fe/blob/main/src/features/login/LoginCallback.tsx"
click node_guard "https://github.com/b20dccn624/base-fe/blob/main/src/routes/ProtectedRoute.tsx"
click node_permissions "https://github.com/b20dccn624/base-fe/blob/main/src/components/Authorized/CheckPermissions.tsx"
click node_auth "https://github.com/b20dccn624/base-fe/blob/main/src/features/login/authSlice.ts"
click node_store "https://github.com/b20dccn624/base-fe/blob/main/src/app/store.ts"
click node_dashboard "https://github.com/b20dccn624/base-fe/tree/main/src/features/dashboard"
click node_devices "https://github.com/b20dccn624/base-fe/tree/main/src/features/device"
click node_accounts "https://github.com/b20dccn624/base-fe/tree/main/src/features/account"
click node_events "https://github.com/b20dccn624/base-fe/blob/main/src/features/event/EventList.tsx"
click node_eventforms "https://github.com/b20dccn624/base-fe/blob/main/src/features/event/EvenForm.tsx"
click node_eventapi "https://github.com/b20dccn624/base-fe/blob/main/src/features/event/api.ts"
click node_table "https://github.com/b20dccn624/base-fe/blob/main/src/common/Table/index.tsx"
click node_notifications "https://github.com/b20dccn624/base-fe/blob/main/src/hooks/NotificationProvider.tsx"

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_app,node_routes,node_layout toneBlue
class node_login,node_callback,node_guard,node_permissions,node_auth toneAmber
class node_dashboard,node_devices,node_accounts,node_events,node_eventforms,node_eventapi toneMint
class node_store,node_table,node_notifications toneRose
class node_user toneIndigo
```

## Components

### Application Shell

- [App Routing](https://github.com/b20dccn624/base-fe/blob/main/src/App.tsx): `src/App.tsx`
- [Route Registry](https://github.com/b20dccn624/base-fe/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Admin Layout](https://github.com/b20dccn624/base-fe/blob/main/src/components/layout/LayoutPage.tsx): `src/components/layout/LayoutPage.tsx`

### Identity and Access

- [Login Screen](https://github.com/b20dccn624/base-fe/blob/main/src/features/login/LoginPage.tsx): `src/features/login/LoginPage.tsx`
- [Login Callback](https://github.com/b20dccn624/base-fe/blob/main/src/features/login/LoginCallback.tsx): `src/features/login/LoginCallback.tsx`
- [Protected Routes](https://github.com/b20dccn624/base-fe/blob/main/src/routes/ProtectedRoute.tsx): `src/routes/ProtectedRoute.tsx`
- [Permission Checks](https://github.com/b20dccn624/base-fe/blob/main/src/components/Authorized/CheckPermissions.tsx): `src/components/Authorized/CheckPermissions.tsx`
- [Auth State](https://github.com/b20dccn624/base-fe/blob/main/src/features/login/authSlice.ts): `src/features/login/authSlice.ts`

### Admin Features

- [Dashboard](https://github.com/b20dccn624/base-fe/tree/main/src/features/dashboard): `src/features/dashboard`
- [Device Management](https://github.com/b20dccn624/base-fe/tree/main/src/features/device): `src/features/device`
- [Account Management](https://github.com/b20dccn624/base-fe/tree/main/src/features/account): `src/features/account`
- [Event List](https://github.com/b20dccn624/base-fe/blob/main/src/features/event/EventList.tsx): `src/features/event/EventList.tsx`
- [Event Dialogs](https://github.com/b20dccn624/base-fe/blob/main/src/features/event/EvenForm.tsx): `src/features/event/EvenForm.tsx`
- [Event API](https://github.com/b20dccn624/base-fe/blob/main/src/features/event/api.ts): `src/features/event/api.ts`

### Shared UI and State

- [Persisted Store](https://github.com/b20dccn624/base-fe/blob/main/src/app/store.ts): `src/app/store.ts`
- [Table and Paging](https://github.com/b20dccn624/base-fe/blob/main/src/common/Table/index.tsx): `src/common/Table/index.tsx`
- [Notifications](https://github.com/b20dccn624/base-fe/blob/main/src/hooks/NotificationProvider.tsx): `src/hooks/NotificationProvider.tsx`

### Other components

- **Administrator**

## Connections

- Administrator → App Routing: opens (evidence: `src/App.tsx`)
- App Routing → Login Screen: routes to (evidence: `src/App.tsx`)
- App Routing → Login Callback: routes to (evidence: `src/App.tsx`)
- App Routing → Admin Layout: wraps pages (evidence: `src/App.tsx`)
- App Routing → Protected Routes: protects pages (evidence: `src/App.tsx`)
- App Routing → Route Registry: uses routes (evidence: `src/App.tsx`)
- Route Registry → Dashboard: registers (evidence: `src/routes/index.tsx`)
- Route Registry → Device Management: registers (evidence: `src/routes/index.tsx`)
- Route Registry → Account Management: registers (evidence: `src/routes/index.tsx`)
- Admin Layout → Route Registry: uses navigation (evidence: `src/components/layout/LayoutPage.tsx`)
- Protected Routes → Permission Checks: checks access
- Protected Routes → Persisted Store: reads auth (evidence: `src/routes/ProtectedRoute.tsx`)
- Persisted Store → Auth State: persists reducer
- Administrator → Event List: manages events
- Event List → Event API: fetches and mutates (evidence: `src/features/event/EventList.tsx`)
- Event List → Event Dialogs: opens dialogs (evidence: `src/features/event/EventList.tsx`)
- Event List → Table and Paging: renders results (evidence: `src/features/event/EventList.tsx`)
- Event List → Notifications: reports upload status (evidence: `src/features/event/EventList.tsx`)
- Administrator → Login Screen: signs in
