# legnoo/cms-ticket-sales architecture

> Architecture diagram of the GitHub repository legnoo/cms-ticket-sales, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/legnoo/cms-ticket-sales
- Repository: https://github.com/legnoo/cms-ticket-sales

## Overview

1. **Project type and runtime**
   - This is a **React single-page application** bootstrapped with **Create React App**.
   - The app is organized as a CMS for **ticket sales / ticket management**, likely an internal admin UI rather than a public consumer site.

2. **Top-level composition**
   - `src/index.js` is the entry point that mounts the React app.
   - `src/Routing.js` appears to define the route map and is the main navigation boundary between screens.
   - `src/app/store.js` and the slice files indicate a **Redux-based client state layer**.

3. **Main feature areas**
   - The UI is split into three primary page domains under `src/Pages`:
     - `Home` for dashboard/overview
     - `TicketList` for browsing and searching tickets
     - `Setting` for ticket configuration actions such as add/update
     - `TicketControl` for operational control of tickets
   - These page folders are the highest-level feature boundaries in the app.

4. **Layout and shell**
   - `src/components/Layout` contains the structural chrome used across pages:
     - `DefaultLayout`
     - `Header`
     - `Sidebar`
     - modal wrappers and specialized modal content
   - This suggests the app uses a persistent admin shell with navigation plus page content rendered inside it.

5. **Modal-driven workflows**
   - Ticket-related CRUD and filtering actions are encapsulated in modal components:
     - `TicketFilter`
     - `TicketUpdate`
     - `ModalWrapper`
   - The presence of dedicated modal subtrees suggests key workflows happen in overlays rather than separate pages.

6. **State management boundary**
   - `src/features/ticketSlice.js` and `src/features/packageSlice.js` are the central Redux feature slices.
   - These likely hold shared domain state such as ticket records, package data, selected filters, and edit state.
   - The architecture implies page components dispatch actions and read from the store, rather than managing all ticket state locally.

7. **Backend / external service layer**
   - `src/services/api.js` is the application’s main API boundary for server communication.
   - `src/firebase.js` indicates Firebase is also part of the integration surface, likely for authentication, database, storage, or messaging.
   - Architecturally, the app appears to combine a custom API layer with Firebase-backed services.

8. **Shared form and interaction components**
   - Reusable UI controls live under `src/components`:
     - `Button`
     - `Input`
     - `InputDate`
     - `Search`
   - These are cross-cutting building blocks used by pages and modal forms, keeping form behavior and styling consistent.

9. **Presentation and styling**
   - Styling is heavily modularized with `*.module.scss` files, plus shared global styles in `src/components/GlobalStyles`.
   - There are also feature-specific stylesheet files like `datePicker.css`, indicating some third-party UI elements are customized at the feature boundary.
   - The styling approach suggests a component-scoped UI with selective global overrides.

10. **Data transformation utilities**
    - `src/util` contains pure helper functions for formatting and export:
      - date formatting
      - currency formatting
      - string truncation
      - search term handling
      - Excel export
    - This implies the app does not just display data; it also supports reporting/export and presentation normalization.

11. **Asset management**
    - Static images are centralized in `src/assets/images`, with an index file for grouped imports.
    - This supports a conventional component-driven asset pipeline rather than asset loading from an external CDN.

12. **Likely data flow**
    - User interaction starts in a page or modal.
    - Components dispatch Redux actions and/or call `services/api.js`.
    - Backend/Firebase responses update feature slices in the store.
    - State changes flow back into page components for rendering, filtering, and editing.
    - Shared utilities format data before it reaches the UI or export layer.

13. **Architectural boundaries to draw**
    - A clear separation exists between:
      - **routing/page orchestration**
      - **layout/chrome**
      - **feature screens**
      - **shared UI components**
      - **Redux state**
      - **API/Firebase integration**
      - **pure utilities**
    - For an architecture diagram, these are the primary boxes and interaction lines worth showing.

Main entry points: [`src/Pages/Setting/Setting.js`](https://github.com/legnoo/cms-ticket-sales/blob/main/src/Pages/Setting/Setting.js) (Settings), [`src/Routing.js`](https://github.com/legnoo/cms-ticket-sales/blob/main/src/Routing.js) (Routing), [`src/app/store.js`](https://github.com/legnoo/cms-ticket-sales/blob/main/src/app/store.js) (Redux store), [`src/Pages/TicketList/TicketList.js`](https://github.com/legnoo/cms-ticket-sales/blob/main/src/Pages/TicketList/TicketList.js) (Ticket list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_app["App core"]
  node_node_index(("Entry point<br/>react entry<br/>[index.js]"))
  node_node_routing["Routing<br/>route map<br/>[Routing.js]"]
  node_node_store[("Redux store<br/>state store<br/>[store.js]")]
end

subgraph group_group_shell["Shell and UI"]
  node_node_layout["Default layout<br/>shell<br/>[index.js]"]
  node_node_header["Header<br/>layout part<br/>[index.js]"]
  node_node_sidebar["Sidebar<br/>nav panel<br/>[index.js]"]
  node_node_modalwrap["Modal wrapper<br/>overlay shell<br/>[ModalWrapper.js]"]
  node_node_ticketfilter["Ticket filter<br/>modal<br/>[index.js]"]
  node_node_ticketupdate["Ticket update<br/>modal<br/>[index.js]"]
  node_node_button["Button<br/>ui control<br/>[index.js]"]
  node_node_input["Input<br/>ui control<br/>[Input.js]"]
  node_node_search["Search<br/>ui control<br/>[index.js]"]
end

subgraph group_group_pages["Feature pages"]
  node_node_home["Dashboard<br/>page<br/>[Home.js]"]
  node_node_ticketlist["Ticket list<br/>page<br/>[TicketList.js]"]
  node_node_setting["Settings<br/>page<br/>[Setting.js]"]
  node_node_addticket["Add ticket<br/>page form<br/>[AddTicket.js]"]
  node_node_updateticket["Update ticket<br/>page form<br/>[UpdateTicket.js]"]
  node_node_ticketcontrol["Ticket control<br/>page<br/>[index.js]"]
end

subgraph group_group_data["Data and helpers"]
  node_node_api[("API service<br/>backend client<br/>[api.js]")]
  node_node_firebase[("Firebase<br/>external service<br/>[firebase.js]")]
  node_node_ticketslice{{"Ticket slice<br/>redux slice<br/>[ticketSlice.js]"}}
  node_node_packageslice{{"Package slice<br/>redux slice<br/>[packageSlice.js]"}}
  node_node_utils["Utilities<br/>pure helpers<br/>[dateFormat.js]"]
end

node_node_index -->|"renders"| node_node_routing
node_node_routing -->|"wraps"| node_node_layout
node_node_routing -->|"routes to"| node_node_home
node_node_routing -->|"routes to"| node_node_ticketlist
node_node_routing -->|"routes to"| node_node_setting
node_node_routing -->|"routes to"| node_node_ticketcontrol
node_node_layout -->|"contains"| node_node_header
node_node_layout -->|"contains"| node_node_sidebar
node_node_layout -->|"hosts"| node_node_modalwrap
node_node_ticketlist -->|"opens"| node_node_ticketfilter
node_node_setting -->|"contains"| node_node_addticket
node_node_setting -->|"contains"| node_node_updateticket
node_node_ticketupdate -->|"uses"| node_node_modalwrap
node_node_ticketfilter -->|"uses"| node_node_modalwrap
node_node_home -->|"reads state"| node_node_store
node_node_ticketlist -->|"reads state"| node_node_store
node_node_setting -->|"updates state"| node_node_store
node_node_ticketcontrol -->|"reads state"| node_node_store
node_node_store -->|"includes"| node_node_ticketslice
node_node_store -->|"includes"| node_node_packageslice
node_node_ticketslice -->|"calls"| node_node_api
node_node_ticketslice -->|"calls"| node_node_firebase
node_node_packageslice -->|"calls"| node_node_api
node_node_ticketlist -->|"uses"| node_node_search
node_node_setting -->|"uses"| node_node_input
node_node_setting -->|"uses"| node_node_button
node_node_ticketlist -->|"formats with"| node_node_utils
node_node_setting -->|"formats with"| node_node_utils

click node_node_index "https://github.com/legnoo/cms-ticket-sales/blob/main/src/index.js"
click node_node_routing "https://github.com/legnoo/cms-ticket-sales/blob/main/src/Routing.js"
click node_node_store "https://github.com/legnoo/cms-ticket-sales/blob/main/src/app/store.js"
click node_node_home "https://github.com/legnoo/cms-ticket-sales/blob/main/src/Pages/Home/Home.js"
click node_node_ticketlist "https://github.com/legnoo/cms-ticket-sales/blob/main/src/Pages/TicketList/TicketList.js"
click node_node_setting "https://github.com/legnoo/cms-ticket-sales/blob/main/src/Pages/Setting/Setting.js"
click node_node_addticket "https://github.com/legnoo/cms-ticket-sales/blob/main/src/Pages/Setting/AddTicket.js"
click node_node_updateticket "https://github.com/legnoo/cms-ticket-sales/blob/main/src/Pages/Setting/UpdateTicket.js"
click node_node_ticketcontrol "https://github.com/legnoo/cms-ticket-sales/blob/main/src/Pages/TicketControl/index.js"
click node_node_layout "https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Layout/DefaultLayout/index.js"
click node_node_header "https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Layout/components/Header/index.js"
click node_node_sidebar "https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Layout/components/Sidebar/index.js"
click node_node_modalwrap "https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Layout/components/Modal/ModalWrapper.js"
click node_node_ticketfilter "https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Layout/components/Modal/TicketFilter/index.js"
click node_node_ticketupdate "https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Layout/components/Modal/TicketUpdate/index.js"
click node_node_button "https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Button/index.js"
click node_node_input "https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Input/Input.js"
click node_node_search "https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Search/index.js"
click node_node_api "https://github.com/legnoo/cms-ticket-sales/blob/main/src/services/api.js"
click node_node_firebase "https://github.com/legnoo/cms-ticket-sales/blob/main/src/firebase.js"
click node_node_ticketslice "https://github.com/legnoo/cms-ticket-sales/blob/main/src/features/ticketSlice.js"
click node_node_packageslice "https://github.com/legnoo/cms-ticket-sales/blob/main/src/features/packageSlice.js"
click node_node_utils "https://github.com/legnoo/cms-ticket-sales/blob/main/src/util/dateFormat.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_node_index,node_node_routing,node_node_store toneBlue
class node_node_layout,node_node_header,node_node_sidebar,node_node_modalwrap,node_node_ticketfilter,node_node_ticketupdate,node_node_button,node_node_input,node_node_search toneAmber
class node_node_home,node_node_ticketlist,node_node_setting,node_node_addticket,node_node_updateticket,node_node_ticketcontrol toneMint
class node_node_api,node_node_firebase,node_node_ticketslice,node_node_packageslice,node_node_utils toneRose
```

## Components

### App core

Entry, routing, and global state boundaries.

- [Entry point](https://github.com/legnoo/cms-ticket-sales/blob/main/src/index.js): react entry · Bootstraps the SPA and mounts the React tree. · `src/index.js`
- [Routing](https://github.com/legnoo/cms-ticket-sales/blob/main/src/Routing.js): route map · Defines navigation and screen selection. · `src/Routing.js`
- [Redux store](https://github.com/legnoo/cms-ticket-sales/blob/main/src/app/store.js): state store · Global client state container for ticket and package data. · `src/app/store.js`

### Shell and UI

Persistent layout and reusable interface components.

- [Default layout](https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Layout/DefaultLayout/index.js): shell · Persistent admin chrome around the routed content. · `src/components/Layout/DefaultLayout/index.js`
- [Header](https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Layout/components/Header/index.js): layout part · Top navigation and page framing. · `src/components/Layout/components/Header/index.js`
- [Sidebar](https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Layout/components/Sidebar/index.js): nav panel · Primary section navigation. · `src/components/Layout/components/Sidebar/index.js`
- [Modal wrapper](https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Layout/components/Modal/ModalWrapper.js): overlay shell · Shared modal container for ticket workflows. · `src/components/Layout/components/Modal/ModalWrapper.js`
- [Ticket filter](https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Layout/components/Modal/TicketFilter/index.js): modal · Filter controls for ticket browsing. · `src/components/Layout/components/Modal/TicketFilter/index.js`
- [Ticket update](https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Layout/components/Modal/TicketUpdate/index.js): modal · Overlay form for editing ticket data. · `src/components/Layout/components/Modal/TicketUpdate/index.js`
- [Button](https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Button/index.js): ui control · Reusable action button component. · `src/components/Button/index.js`
- [Input](https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Input/Input.js): ui control · Reusable text and date input building block. · `src/components/Input/Input.js`
- [Search](https://github.com/legnoo/cms-ticket-sales/blob/main/src/components/Search/index.js): ui control · Reusable search field component. · `src/components/Search/index.js`

### Feature pages

Top-level ticket management screens.

- [Dashboard](https://github.com/legnoo/cms-ticket-sales/blob/main/src/Pages/Home/Home.js): page · Overview screen for the admin experience. · `src/Pages/Home/Home.js`
- [Ticket list](https://github.com/legnoo/cms-ticket-sales/blob/main/src/Pages/TicketList/TicketList.js): page · Browse, search, and filter tickets. · `src/Pages/TicketList/TicketList.js`
- [Settings](https://github.com/legnoo/cms-ticket-sales/blob/main/src/Pages/Setting/Setting.js): page · Ticket configuration and editing workflows. · `src/Pages/Setting/Setting.js`
- [Add ticket](https://github.com/legnoo/cms-ticket-sales/blob/main/src/Pages/Setting/AddTicket.js): page form · Creates new ticket entries. · `src/Pages/Setting/AddTicket.js`
- [Update ticket](https://github.com/legnoo/cms-ticket-sales/blob/main/src/Pages/Setting/UpdateTicket.js): page form · Edits existing ticket entries. · `src/Pages/Setting/UpdateTicket.js`
- [Ticket control](https://github.com/legnoo/cms-ticket-sales/blob/main/src/Pages/TicketControl/index.js): page · Operational control screen for ticket handling. · `src/Pages/TicketControl/index.js`

### Data and helpers

Server integration, Firebase, and pure utilities.

- [API service](https://github.com/legnoo/cms-ticket-sales/blob/main/src/services/api.js): backend client · Main custom server communication layer. · `src/services/api.js`
- [Firebase](https://github.com/legnoo/cms-ticket-sales/blob/main/src/firebase.js): external service · Firebase integration surface for app services. · `src/firebase.js`
- [Ticket slice](https://github.com/legnoo/cms-ticket-sales/blob/main/src/features/ticketSlice.js): redux slice · Central ticket domain state and actions. · `src/features/ticketSlice.js`
- [Package slice](https://github.com/legnoo/cms-ticket-sales/blob/main/src/features/packageSlice.js): redux slice · Shared package-related domain state. · `src/features/packageSlice.js`
- [Utilities](https://github.com/legnoo/cms-ticket-sales/blob/main/src/util/dateFormat.js): pure helpers · Formatting, search, truncation, and export helpers. · `src/util/dateFormat.js`

## Connections

- Entry point → Routing: renders · The app entry hands control to routing.
- Routing → Default layout: wraps · Routes are presented inside the persistent layout.
- Routing → Dashboard: routes to · Navigation can land on the dashboard.
- Routing → Ticket list: routes to · Navigation can land on ticket browsing.
- Routing → Settings: routes to · Navigation can land on ticket configuration.
- Routing → Ticket control: routes to · Navigation can land on operational control.
- Default layout → Header: contains · The shell includes the top header.
- Default layout → Sidebar: contains · The shell includes the navigation sidebar.
- Default layout → Modal wrapper: hosts · The shell provides shared modal mounting.
- Ticket list → Ticket filter: opens · The list screen uses filtering overlays.
- Settings → Add ticket: contains · Settings includes ticket creation workflow.
- Settings → Update ticket: contains · Settings includes ticket editing workflow.
- Ticket update → Modal wrapper: uses · Update forms appear inside the shared modal container.
- Ticket filter → Modal wrapper: uses · Filter UI appears inside the shared modal container.
- Dashboard → Redux store: reads state · Dashboard reads from global Redux state.
- Ticket list → Redux store: reads state · Listing and search depend on Redux data.
- Settings → Redux store: updates state · Settings dispatches edits into global state.
- Ticket control → Redux store: reads state · Operational controls use shared store data.
- Redux store → Ticket slice: includes · Ticket domain state is a core store slice.
- Redux store → Package slice: includes · Package domain state is a core store slice.
- Ticket slice → API service: calls · Ticket actions coordinate with the API service.
- Ticket slice → Firebase: calls · Ticket domain may also depend on Firebase-backed services.
- Package slice → API service: calls · Package state may be synchronized through the API.
- Ticket list → Search: uses · Search input is reused in list filtering.
- Settings → Input: uses · Forms are built from shared input controls.
- Settings → Button: uses · Actions are triggered through shared buttons.
- Ticket list → Utilities: formats with · Dates, currency, search, and export helpers support the list UI.
- Settings → Utilities: formats with · Helpers normalize values for editing and display.
