How legnoo/cms-ticket-sales works
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: Setting.js Settings · Routing.js Routing · store.js Redux store · TicketList.js Ticket list
Components 23
App core
Entry, routing, and global state boundaries.
- Entry point · Bootstraps the SPA and mounts the React tree.
src/index.js - Routing · Defines navigation and screen selection.
src/Routing.js - Redux 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 · Persistent admin chrome around the routed content.
src/components/Layout/DefaultLayout/index.js - Header · Top navigation and page framing.
src/components/Layout/components/Header/index.js - Sidebar · Primary section navigation.
src/components/Layout/components/Sidebar/index.js - Modal wrapper · Shared modal container for ticket workflows.
src/components/Layout/components/Modal/ModalWrapper.js - Ticket filter · Filter controls for ticket browsing.
src/components/Layout/components/Modal/TicketFilter/index.js - Ticket update · Overlay form for editing ticket data.
src/components/Layout/components/Modal/TicketUpdate/index.js - Button · Reusable action button component.
src/components/Button/index.js - Input · Reusable text and date input building block.
src/components/Input/Input.js - Search · Reusable search field component.
src/components/Search/index.js
Feature pages
Top-level ticket management screens.
- Dashboard · Overview screen for the admin experience.
src/Pages/Home/Home.js - Ticket list · Browse, search, and filter tickets.
src/Pages/TicketList/TicketList.js - Settings · Ticket configuration and editing workflows.
src/Pages/Setting/Setting.js - Add ticket · Creates new ticket entries.
src/Pages/Setting/AddTicket.js - Update ticket · Edits existing ticket entries.
src/Pages/Setting/UpdateTicket.js - Ticket control · Operational control screen for ticket handling.
src/Pages/TicketControl/index.js
Data and helpers
Server integration, Firebase, and pure utilities.
- API service · Main custom server communication layer.
src/services/api.js - Firebase · Firebase integration surface for app services.
src/firebase.js - Ticket slice · Central ticket domain state and actions.
src/features/ticketSlice.js - Package slice · Shared package-related domain state.
src/features/packageSlice.js - Utilities · Formatting, search, truncation, and export helpers.
src/util/dateFormat.js
Connections 28
- 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.