# sanchitasan/atomquest_frontend architecture

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

- Interactive diagram: https://gitdiagram.com/sanchitasan/atomquest_frontend
- Repository: https://github.com/sanchitasan/atomquest_frontend

## Overview

1. **Overall shape**
   - This is a **React single-page application** built with **Vite**. The repo is a frontend client, not a backend service.
   - The architecture is centered on **route-based pages**, a **shared layout**, and a small **API client layer** that talks to an external backend.

2. **Primary user flows**
   - The app appears to support an **auth + role-based performance management workflow**: users can land on a public marketing page, sign up or log in, then access dashboards and operational pages for goals, check-ins, reports, and audits.
   - The presence of separate dashboard pages for **Admin**, **Manager**, and **Employee** indicates the UI is segmented by role rather than being one generic dashboard.

3. **Routing and access control**
   - `src/routes/ProtectedRoute.jsx` is the key boundary for authenticated access.
   - Public pages include `Landing`, `Login`, and `Signup`; protected pages include dashboard and workbench views such as `Goals`, `Checkins`, `Reports`, `AuditLogs`, and the role-specific dashboard pages.
   - This suggests the router is the main control point for deciding what can be seen before and after authentication.

4. **Layout and navigation shell**
   - `src/layouts/MainLayout.jsx` and `src/components/Sidebar.jsx` provide the persistent app chrome.
   - The sidebar is likely the main navigation structure for authenticated users, while the layout wraps page content and keeps navigation consistent across the internal app.
   - This is an important architectural boundary: page components render business content, while the layout handles cross-cutting navigation structure.

5. **API layer as backend integration boundary**
   - The `src/api` folder is a clean separation point for external communication.
   - There are dedicated clients for `authApi`, `goalApi`, `checkinApi`, `reportApi`, and `auditApi`, with shared configuration in `config.js`.
   - This implies the frontend communicates with a backend over HTTP and keeps endpoint-specific logic isolated by domain.

6. **Domain modules reflected in the UI**
   - The app is organized around several functional domains:
     - **Authentication**: `Login`, `Signup`, `authApi`
     - **Goals/KPIs**: `Goals`, `AssignKPI`, `AssignedKPI`, `SharedGoalOverview`, `goalApi`
     - **Check-ins**: `Checkins`, `checkinApi`
     - **Reports**: `Reports`, `reportApi`
     - **Auditing**: `AuditLogs`, `auditApi`
   - This structure suggests the backend data model likely revolves around users, goals/KPIs, review activity, and reporting events.

7. **Dashboard subsystem**
   - `src/pages/dashboard` contains role-specific dashboards: `AdminDashboard`, `ManagerDashboard`, and `EmployeeDashboard`.
   - Supporting components in `src/components/dashboard` include `MetricCard`, `GoalProgressCard`, `ActivityTimeline`, and `SectionHeader`.
   - This indicates the dashboards are composed from reusable analytical widgets rather than being monolithic pages.

8. **Data presentation pattern**
   - The dashboard components suggest the UI is oriented around **summary metrics, progress tracking, and recent activity**.
   - `ActivityTimeline` and `GoalProgressCard` imply a workflow where user actions and goal status are shown over time, which is likely fed by backend API responses.
   - `SectionHeader` and `MetricCard` point to a consistent design system for internal views.

9. **State and business logic distribution**
   - Most business logic likely lives inside page components, with reusable visual components kept in `components/`.
   - `src/utils/managerReviewHistory.js` is a notable utility module, likely used to derive or format review-history data for manager views.
   - This suggests the app keeps some client-side transformation logic, but the source of truth remains the backend APIs.

10. **Styling and UI system**
    - The repo includes `tailwind.config.js`, `src/index.css`, and `src/App.css`, so styling is probably a mix of **Tailwind CSS utilities** and app-level CSS.
    - The UI architecture is therefore component-driven, with styling distributed across utility classes and a small number of global styles.

11. **Build/runtime boundary**
    - `vite.config.js`, `index.html`, and `src/main.jsx` define the standard Vite React bootstrap path.
    - The app runs as a browser-delivered frontend bundle, with Vite handling local development and production builds.
    - `eslint.config.js` indicates static linting is part of the development workflow.

12. **What an architecture diagram should show**
    - A good diagram would place the **browser SPA** at the center, with:
      - public routes on one side,
      - authenticated/role-based routes behind `ProtectedRoute`,
      - a shared `MainLayout` + `Sidebar` shell around internal pages,
      - and a separate **API layer** connecting to backend services for auth, goals, check-ins, reports, and audits.
    - The dashboard subsystem should be shown as a reusable presentation layer feeding on API data, not as a separate service.

Main entry points: [`src/App.jsx`](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/App.jsx) (App), [`src/pages/dashboard/ManagerDashboard.jsx`](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/dashboard/ManagerDashboard.jsx) (Manager dashboard), [`src/api/goalApi.js`](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/api/goalApi.js) (Goal API), [`src/api/config.js`](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/api/config.js) (API config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_src_main["main.jsx<br/>bootstrap<br/>[main.jsx]"]
end

subgraph group_routing["Routing"]
  node_src_app["App<br/>router composition<br/>[App.jsx]"]
  node_protected_route["Protected route<br/>auth gate<br/>[ProtectedRoute.jsx]"]
end

subgraph group_shell["Shell"]
  node_main_layout["Main layout<br/>app shell<br/>[MainLayout.jsx]"]
  node_sidebar["Sidebar<br/>nav shell<br/>[Sidebar.jsx]"]
end

subgraph group_public["Public pages"]
  node_landing["Landing<br/>public page<br/>[Landing.jsx]"]
  node_login["Login<br/>auth page<br/>[Login.jsx]"]
  node_signup["Signup<br/>auth page<br/>[Signup.jsx]"]
end

subgraph group_workflows["Workflows"]
  node_goals_page["Goals<br/>business page<br/>[Goals.jsx]"]
  node_assign_kpi["Assign KPI<br/>business page<br/>[AssignKPI.jsx]"]
  node_assigned_kpi["Assigned KPI<br/>business page<br/>[AssignedKPI.jsx]"]
  node_shared_goal["Shared goals<br/>business page"]
  node_checkins_page["Check-ins<br/>business page<br/>[Checkins.jsx]"]
  node_reports_page["Reports<br/>business page<br/>[Reports.jsx]"]
  node_audit_page["Audit logs<br/>business page<br/>[AuditLogs.jsx]"]
end

subgraph group_dashboards["Dashboards"]
  node_dashboard_router["Dashboard<br/>role router<br/>[Dashboard.jsx]"]
  node_admin_dash["Admin dashboard<br/>role page<br/>[AdminDashboard.jsx]"]
  node_manager_dash["Manager dashboard<br/>role page"]
  node_employee_dash["Employee dashboard<br/>role page"]
end

subgraph group_dashui["Dashboard UI"]
  node_metric_card["Metric card<br/>dashboard widget<br/>[MetricCard.jsx]"]
  node_goal_progress["Goal progress<br/>dashboard widget"]
  node_activity_timeline["Activity timeline<br/>dashboard widget"]
  node_section_header["Section header<br/>dashboard widget<br/>[SectionHeader.jsx]"]
end

subgraph group_api["API layer"]
  node_goal_api["Goal API<br/>domain client<br/>[goalApi.js]"]
  node_checkin_api["Check-in API<br/>domain client<br/>[checkinApi.js]"]
  node_report_api["Report API<br/>domain client<br/>[reportApi.js]"]
  node_audit_api["Audit API<br/>domain client<br/>[auditApi.js]"]
  node_auth_api["Auth API<br/>domain client<br/>[authApi.js]"]
  node_api_config["API config<br/>shared config<br/>[config.js]"]
end

node_review_history["Review history"]

node_src_main -->|"boots"| node_src_app
node_src_app -->|"public route"| node_landing
node_src_app -->|"public route"| node_login
node_src_app -->|"public route"| node_signup
node_src_app -->|"guards"| node_protected_route
node_protected_route -->|"wraps"| node_main_layout
node_main_layout -->|"contains"| node_sidebar
node_src_app -->|"route"| node_dashboard_router
node_dashboard_router -->|"role view"| node_admin_dash
node_dashboard_router -->|"role view"| node_manager_dash
node_dashboard_router -->|"role view"| node_employee_dash
node_admin_dash -->|"uses"| node_metric_card
node_manager_dash -->|"uses"| node_metric_card
node_employee_dash -->|"uses"| node_metric_card
node_admin_dash -->|"uses"| node_goal_progress
node_manager_dash -->|"uses"| node_activity_timeline
node_manager_dash -->|"uses"| node_section_header
node_goals_page -->|"reads/writes"| node_goal_api
node_assign_kpi -->|"reads/writes"| node_goal_api
node_assigned_kpi -->|"reads"| node_goal_api
node_shared_goal -->|"reads"| node_goal_api
node_checkins_page -->|"reads/writes"| node_checkin_api
node_reports_page -->|"reads"| node_report_api
node_audit_page -->|"reads"| node_audit_api
node_login -->|"auth"| node_auth_api
node_signup -->|"auth"| node_auth_api
node_auth_api -->|"configures"| node_api_config
node_goal_api -->|"configures"| node_api_config
node_checkin_api -->|"configures"| node_api_config
node_report_api -->|"configures"| node_api_config
node_audit_api -->|"configures"| node_api_config
node_manager_dash -.->|"derives"| node_review_history

click node_src_main "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/main.jsx"
click node_src_app "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/App.jsx"
click node_protected_route "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/routes/ProtectedRoute.jsx"
click node_main_layout "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/layouts/MainLayout.jsx"
click node_sidebar "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/components/Sidebar.jsx"
click node_landing "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/Landing.jsx"
click node_login "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/Login.jsx"
click node_signup "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/Signup.jsx"
click node_dashboard_router "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/Dashboard.jsx"
click node_admin_dash "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/dashboard/AdminDashboard.jsx"
click node_manager_dash "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/dashboard/ManagerDashboard.jsx"
click node_employee_dash "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/dashboard/EmployeeDashboard.jsx"
click node_metric_card "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/components/dashboard/MetricCard.jsx"
click node_goal_progress "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/components/dashboard/GoalProgressCard.jsx"
click node_activity_timeline "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/components/dashboard/ActivityTimeline.jsx"
click node_section_header "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/components/dashboard/SectionHeader.jsx"
click node_goal_api "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/api/goalApi.js"
click node_checkin_api "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/api/checkinApi.js"
click node_report_api "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/api/reportApi.js"
click node_audit_api "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/api/auditApi.js"
click node_auth_api "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/api/authApi.js"
click node_api_config "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/api/config.js"
click node_goals_page "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/Goals.jsx"
click node_assign_kpi "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/AssignKPI.jsx"
click node_assigned_kpi "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/AssignedKPI.jsx"
click node_shared_goal "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/SharedGoalOverview.jsx"
click node_checkins_page "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/Checkins.jsx"
click node_reports_page "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/Reports.jsx"
click node_audit_page "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/AuditLogs.jsx"
click node_review_history "https://github.com/sanchitasan/atomquest_frontend/blob/main/src/utils/managerReviewHistory.js"

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_src_main,node_metric_card,node_goal_progress,node_activity_timeline,node_section_header toneBlue
class node_src_app,node_protected_route,node_goal_api,node_checkin_api,node_report_api,node_audit_api,node_auth_api,node_api_config toneAmber
class node_main_layout,node_sidebar toneMint
class node_landing,node_login,node_signup toneRose
class node_goals_page,node_assign_kpi,node_assigned_kpi,node_shared_goal,node_checkins_page,node_reports_page,node_audit_page toneIndigo
class node_dashboard_router,node_admin_dash,node_manager_dash,node_employee_dash toneTeal
class node_review_history toneNeutral
```

## Components

### Runtime

Vite/React bootstrap and app composition

- [main.jsx](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/main.jsx): bootstrap · Vite React entry point. · `src/main.jsx`

### Routing

Route gating and page composition

- [App](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/App.jsx): router composition · Top-level app wiring for routes, layout, and global UI. · `src/App.jsx`
- [Protected route](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/routes/ProtectedRoute.jsx): auth gate · Restricts access to authenticated sections. · `src/routes/ProtectedRoute.jsx`

### Shell

Persistent layout and navigation chrome

- [Main layout](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/layouts/MainLayout.jsx): app shell · Wraps authenticated pages with shared structure. · `src/layouts/MainLayout.jsx`
- [Sidebar](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/components/Sidebar.jsx): nav shell · Primary navigation for internal users. · `src/components/Sidebar.jsx`

### Public pages

Unauthenticated entry pages

- [Landing](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/Landing.jsx): public page · Public marketing or entry page. · `src/pages/Landing.jsx`
- [Login](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/Login.jsx): auth page · User sign-in page. · `src/pages/Login.jsx`
- [Signup](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/Signup.jsx): auth page · User registration page. · `src/pages/Signup.jsx`

### Workflows

Authenticated business pages

- [Goals](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/Goals.jsx): business page · Goal and KPI management page. · `src/pages/Goals.jsx`
- [Assign KPI](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/AssignKPI.jsx): business page · Page for assigning KPIs. · `src/pages/AssignKPI.jsx`
- [Assigned KPI](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/AssignedKPI.jsx): business page · Page showing assigned KPIs. · `src/pages/AssignedKPI.jsx`
- [Shared goals](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/SharedGoalOverview.jsx): business page · Overview of shared goal status. · `src/pages/SharedGoalOverview.jsx`
- [Check-ins](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/Checkins.jsx): business page · Check-in workflow page. · `src/pages/Checkins.jsx`
- [Reports](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/Reports.jsx): business page · Reporting and analytics page. · `src/pages/Reports.jsx`
- [Audit logs](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/AuditLogs.jsx): business page · Audit and traceability page. · `src/pages/AuditLogs.jsx`

### Dashboards

Role-specific dashboard pages

- [Dashboard](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/Dashboard.jsx): role router · Entry page that likely redirects into role-specific dashboards. · `src/pages/Dashboard.jsx`
- [Admin dashboard](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/dashboard/AdminDashboard.jsx): role page · Admin-focused summary and controls. · `src/pages/dashboard/AdminDashboard.jsx`
- [Manager dashboard](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/dashboard/ManagerDashboard.jsx): role page · Manager-focused summary and team views. · `src/pages/dashboard/ManagerDashboard.jsx`
- [Employee dashboard](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/pages/dashboard/EmployeeDashboard.jsx): role page · Employee-focused summary and personal views. · `src/pages/dashboard/EmployeeDashboard.jsx`

### Dashboard UI

Reusable dashboard presentation components

- [Metric card](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/components/dashboard/MetricCard.jsx): dashboard widget · Reusable KPI summary card. · `src/components/dashboard/MetricCard.jsx`
- [Goal progress](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/components/dashboard/GoalProgressCard.jsx): dashboard widget · Reusable progress visualization for goals. · `src/components/dashboard/GoalProgressCard.jsx`
- [Activity timeline](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/components/dashboard/ActivityTimeline.jsx): dashboard widget · Reusable recent activity view. · `src/components/dashboard/ActivityTimeline.jsx`
- [Section header](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/components/dashboard/SectionHeader.jsx): dashboard widget · Reusable section title and framing component. · `src/components/dashboard/SectionHeader.jsx`

### API layer

HTTP client boundary to backend domains

- [Goal API](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/api/goalApi.js): domain client · HTTP client for goals, KPI assignment, and shared goal data. · `src/api/goalApi.js`
- [Check-in API](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/api/checkinApi.js): domain client · HTTP client for check-in operations. · `src/api/checkinApi.js`
- [Report API](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/api/reportApi.js): domain client · HTTP client for reporting data. · `src/api/reportApi.js`
- [Audit API](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/api/auditApi.js): domain client · HTTP client for audit log data. · `src/api/auditApi.js`
- [Auth API](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/api/authApi.js): domain client · HTTP client for authentication and session flow. · `src/api/authApi.js`
- [API config](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/api/config.js): shared config · Shared API base configuration. · `src/api/config.js`

### Other components

- [Review history](https://github.com/sanchitasan/atomquest_frontend/blob/main/src/utils/managerReviewHistory.js): utility · Client-side helper for manager review history shaping. · `src/utils/managerReviewHistory.js`

## Connections

- main.jsx → App: boots · Browser entry mounts the React app.
- App → Landing: public route · App exposes the public landing page.
- App → Login: public route · App exposes login.
- App → Signup: public route · App exposes signup.
- App → Protected route: guards · Authenticated routes flow through the access boundary.
- Protected route → Main layout: wraps · Protected content is rendered inside the shared shell.
- Main layout → Sidebar: contains · Layout includes persistent navigation.
- App → Dashboard: route · App routes authenticated users to the dashboard entry.
- Dashboard → Admin dashboard: role view · Dashboard entry can lead to admin view.
- Dashboard → Manager dashboard: role view · Dashboard entry can lead to manager view.
- Dashboard → Employee dashboard: role view · Dashboard entry can lead to employee view.
- Admin dashboard → Metric card: uses · Admin dashboards compose summary cards.
- Manager dashboard → Metric card: uses · Manager dashboards compose summary cards.
- Employee dashboard → Metric card: uses · Employee dashboards compose summary cards.
- Admin dashboard → Goal progress: uses · Dashboard progress widgets visualize goals.
- Manager dashboard → Activity timeline: uses · Manager dashboard shows recent activity.
- Manager dashboard → Section header: uses · Dashboard sections are framed consistently.
- Goals → Goal API: reads/writes · Goals page talks to the goal domain client.
- Assign KPI → Goal API: reads/writes · KPI assignment uses goal API.
- Assigned KPI → Goal API: reads · Assigned KPIs are fetched from the goal API.
- Shared goals → Goal API: reads · Shared goal view uses goal API data.
- Check-ins → Check-in API: reads/writes · Check-ins page talks to check-in API.
- Reports → Report API: reads · Reports page pulls reporting data.
- Audit logs → Audit API: reads · Audit logs page pulls audit data.
- Login → Auth API: auth · Login uses authentication API.
- Signup → Auth API: auth · Signup uses authentication API.
- Auth API → API config: configures · Auth client uses shared HTTP configuration.
- Goal API → API config: configures · Goal client uses shared HTTP configuration.
- Check-in API → API config: configures · Check-in client uses shared HTTP configuration.
- Report API → API config: configures · Report client uses shared HTTP configuration.
- Audit API → API config: configures · Audit client uses shared HTTP configuration.
- Manager dashboard → Review history: derives · Manager view likely formats review-history data locally.
