# cdac-toppers/auctxi architecture

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

- Interactive diagram: https://gitdiagram.com/cdac-toppers/auctxi
- Repository: https://github.com/cdac-toppers/auctxi

## Overview

#### Purpose and Runtime
AuctXII is a Vite-based React frontend for managing sports-style auctions, including users, teams, players, auctions, payments, reports, and role-specific dashboards. The repository contains no backend or infrastructure definitions; service modules indicate a planned HTTP API boundary. Primary browser entry: `frontend/src/main.jsx`; application root: `frontend/src/App.jsx`.

#### Application Composition
`App.jsx` is expected to assemble routing, global providers, and top-level layouts. Page implementations are organized by actor role and domain rather than a single shared feature tree:
- Admin: `frontend/src/pages/admin/AdminDashboard.jsx`, `frontend/src/pages/admin/Auctions/Auctions.jsx`
- Manager: `frontend/src/pages/manager/ManagerDashboard.jsx`, `frontend/src/pages/manager/Players/Players.jsx`
- Client: `frontend/src/pages/client/ClientDashboard.jsx`, `frontend/src/pages/client/Payments/Payments.jsx`

Authentication screens are isolated under `frontend/src/pages/auth/Login.jsx` and `frontend/src/pages/auth/Signup.jsx`.

#### Access Control and Session State
Authentication state is centralized in `frontend/src/context/AuthContext.jsx`. Protected page access is enforced through `frontend/src/components/ProtectedRoute.jsx`, with roles and route identifiers represented as constants in `frontend/src/constants/roles.js` and `frontend/src/constants/routes.js`. The intended control flow is login → auth context session/user state → protected-route authorization → role-specific route/layout.

#### Role-Specific Shells and Navigation
Distinct layout boundaries support admin, manager, client, dashboard, and authentication experiences:
`frontend/src/layouts/AdminLayout.jsx`, `frontend/src/layouts/ManagerLayout.jsx`, and `frontend/src/layouts/ClientLayout.jsx`.
Navigation structure is centrally declared in `frontend/src/config/navigation.js`. Sidebar UI state is independently managed through `frontend/src/context/SidebarContext.jsx` and `frontend/src/hooks/useSidebar.js`, allowing layouts to coordinate navigation presentation without coupling to auth state.

#### Domain Data and API Boundary
The domain is split into service adapters for auction, payment, player, team, and user operations:
`frontend/src/services/api.js`, `frontend/src/services/auctionsService.js`, `frontend/src/services/paymentService.js`.
These services are the material integration boundary for an external backend/API. Until or alongside backend integration, feature pages can consume local fixture datasets such as `frontend/src/data/auctions.js`, `frontend/src/data/players.js`, and `frontend/src/data/payments.js`. Status vocabularies are normalized in `frontend/src/constants/auctionStatus.js` and `frontend/src/constants/paymentStatus.js`.

#### Shared UI Behavior and Presentation
Cross-feature list interaction is encapsulated in reusable hooks for search, debouncing, and pagination: `frontend/src/hooks/useSearch.js`, `frontend/src/hooks/useDebounce.js`, and `frontend/src/hooks/usePagination.js`. A centralized visual system is defined by `frontend/src/config/theme.js`, `frontend/src/index.css`, and `frontend/DESIGN_SYSTEM.md`; utility formatting supports consistent currency and date rendering via `frontend/src/utils/formatCurrency.js` and `frontend/src/utils/formatDate.js`.

#### Build Boundary
The client is built and served by Vite, configured in `frontend/vite.config.js`, with package/runtime dependencies declared in `frontend/package.json`. Static browser assets reside in `frontend/public`; no deployment, database, queue, payment-provider, or server-side implementation is present in this tree.

Main entry points: [`frontend/src/pages/admin/AdminDashboard.jsx`](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/pages/admin/AdminDashboard.jsx) (Role Dashboards & Pages), [`frontend/src/App.jsx`](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/App.jsx) (App Root), [`frontend/src/components/ProtectedRoute.jsx`](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/components/ProtectedRoute.jsx) (Protected Route), [`frontend/src/layouts/AdminLayout.jsx`](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/layouts/AdminLayout.jsx) (Role Layouts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Browser Runtime"]
  node_vite{{"Vite<br/>build runtime<br/>[vite.config.js]"}}
  node_main["Browser Entry<br/>React entry<br/>[main.jsx]"]
  node_app["App Root<br/>application composition<br/>[App.jsx]"]
end

subgraph group_access["Access Control"]
  node_auth_context["Auth Context<br/>session state<br/>[AuthContext.jsx]"]
  node_protected_route["Protected Route<br/>route guard<br/>[ProtectedRoute.jsx]"]
  node_route_roles["Routes &amp; Roles<br/>route constants<br/>[routes.js]"]
  node_login_signup["Login &amp; Signup<br/>auth pages<br/>[Login.jsx]"]
end

subgraph group_experience["Role Experiences"]
  node_navigation["Navigation Config<br/>navigation model<br/>[navigation.js]"]
  node_sidebar["Sidebar State<br/>UI context and hook<br/>[SidebarContext.jsx]"]
  node_role_layouts["Role Layouts<br/>admin, manager, client shells<br/>[AdminLayout.jsx]"]
  node_role_pages["Role Dashboards &amp; Pages<br/>domain pages<br/>[AdminDashboard.jsx]"]
  node_shared_ui["Shared List UI<br/>search and pagination hooks<br/>[useSearch.js]"]
  node_theme["Theme &amp; Styles<br/>visual system<br/>[theme.js]"]
end

subgraph group_data["Domain Data"]
  node_api_client{{"API Client<br/>HTTP integration boundary<br/>[api.js]"}}
  node_domain_services["Domain Services<br/>auction and payment adapters<br/>[auctionsService.js]"]
  node_fixtures["Local Fixtures<br/>mock datasets<br/>[auctions.js]"]
  node_status_constants["Status Vocabularies<br/>domain constants<br/>[auctionStatus.js]"]
  node_external_api{{"External Backend API<br/>planned external service"}}
end

node_vite -->|"serves"| node_main
node_main -->|"mounts"| node_app
node_app -->|"provides"| node_auth_context
node_app -->|"defines routes with"| node_protected_route
node_app -->|"routes to"| node_login_signup
node_protected_route -->|"reads session"| node_auth_context
node_protected_route -->|"checks"| node_route_roles
node_protected_route -->|"admits"| node_role_layouts
node_role_layouts -->|"uses"| node_navigation
node_role_layouts -->|"coordinates"| node_sidebar
node_role_layouts -->|"hosts"| node_role_pages
node_role_pages -->|"uses"| node_shared_ui
node_role_pages -->|"renders with"| node_theme
node_role_pages -->|"loads domain data"| node_domain_services
node_role_pages -.->|"may consume"| node_fixtures
node_role_pages -->|"uses statuses"| node_status_constants
node_domain_services -->|"uses"| node_api_client
node_api_client -.->|"HTTP requests"| node_external_api

click node_vite "https://github.com/cdac-toppers/auctxi/blob/main/frontend/vite.config.js"
click node_main "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/main.jsx"
click node_app "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/App.jsx"
click node_auth_context "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/context/AuthContext.jsx"
click node_protected_route "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/components/ProtectedRoute.jsx"
click node_route_roles "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/constants/routes.js"
click node_login_signup "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/pages/auth/Login.jsx"
click node_navigation "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/config/navigation.js"
click node_sidebar "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/context/SidebarContext.jsx"
click node_role_layouts "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/layouts/AdminLayout.jsx"
click node_role_pages "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/pages/admin/AdminDashboard.jsx"
click node_shared_ui "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/hooks/useSearch.js"
click node_theme "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/config/theme.js"
click node_api_client "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/services/api.js"
click node_domain_services "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/services/auctionsService.js"
click node_fixtures "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/data/auctions.js"
click node_status_constants "https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/constants/auctionStatus.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_vite,node_main,node_app toneBlue
class node_auth_context,node_protected_route,node_route_roles,node_login_signup toneAmber
class node_navigation,node_sidebar,node_role_layouts,node_role_pages,node_shared_ui,node_theme toneMint
class node_api_client,node_domain_services,node_fixtures,node_status_constants,node_external_api toneRose
```

## Components

### Browser Runtime

- [Vite](https://github.com/cdac-toppers/auctxi/blob/main/frontend/vite.config.js): build runtime · Builds and serves the React client. · `frontend/vite.config.js`
- [Browser Entry](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/main.jsx): React entry · `frontend/src/main.jsx`
- [App Root](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/App.jsx): application composition · Assembles providers, routing, and top-level layouts. · `frontend/src/App.jsx`

### Access Control

- [Auth Context](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/context/AuthContext.jsx): session state · Centralizes authenticated user and session state. · `frontend/src/context/AuthContext.jsx`
- [Protected Route](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/components/ProtectedRoute.jsx): route guard · Authorizes page access by session and role. · `frontend/src/components/ProtectedRoute.jsx`
- [Routes & Roles](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/constants/routes.js): route constants · `frontend/src/constants/routes.js`
- [Login & Signup](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/pages/auth/Login.jsx): auth pages · `frontend/src/pages/auth/Login.jsx`

### Role Experiences

- [Navigation Config](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/config/navigation.js): navigation model · `frontend/src/config/navigation.js`
- [Sidebar State](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/context/SidebarContext.jsx): UI context and hook · Coordinates sidebar presentation independently of authentication. · `frontend/src/context/SidebarContext.jsx`
- [Role Layouts](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/layouts/AdminLayout.jsx): admin, manager, client shells · `frontend/src/layouts/AdminLayout.jsx`
- [Role Dashboards & Pages](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/pages/admin/AdminDashboard.jsx): domain pages · Admin, manager, and client experiences for auctions, players, and payments. · `frontend/src/pages/admin/AdminDashboard.jsx`
- [Shared List UI](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/hooks/useSearch.js): search and pagination hooks · `frontend/src/hooks/useSearch.js`
- [Theme & Styles](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/config/theme.js): visual system · `frontend/src/config/theme.js`

### Domain Data

- [API Client](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/services/api.js): HTTP integration boundary · Planned external backend/API boundary. · `frontend/src/services/api.js`
- [Domain Services](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/services/auctionsService.js): auction and payment adapters · Adapters for auction, payment, player, team, and user operations. · `frontend/src/services/auctionsService.js`
- [Local Fixtures](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/data/auctions.js): mock datasets · Fallback data for feature development. · `frontend/src/data/auctions.js`
- [Status Vocabularies](https://github.com/cdac-toppers/auctxi/blob/main/frontend/src/constants/auctionStatus.js): domain constants · `frontend/src/constants/auctionStatus.js`
- **External Backend API**: planned external service · Not implemented in this repository.

## Connections

- Vite → Browser Entry: serves
- Browser Entry → App Root: mounts
- App Root → Auth Context: provides
- App Root → Protected Route: defines routes with
- App Root → Login & Signup: routes to
- Protected Route → Auth Context: reads session
- Protected Route → Routes & Roles: checks
- Protected Route → Role Layouts: admits
- Role Layouts → Navigation Config: uses
- Role Layouts → Sidebar State: coordinates
- Role Layouts → Role Dashboards & Pages: hosts
- Role Dashboards & Pages → Shared List UI: uses
- Role Dashboards & Pages → Theme & Styles: renders with
- Role Dashboards & Pages → Domain Services: loads domain data
- Role Dashboards & Pages → Local Fixtures: may consume
- Role Dashboards & Pages → Status Vocabularies: uses statuses
- Domain Services → API Client: uses
- API Client → External Backend API: HTTP requests
