# kaimmrt/tiko-event-management-system architecture

> Architecture diagram of the GitHub repository kaimmrt/tiko-event-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kaimmrt/tiko-event-management-system
- Repository: https://github.com/kaimmrt/tiko-event-management-system

## Overview

##### Main Components
- Frontend Application:
- React UI: Comprises the main App.tsx, page components (HomePage, AddVisitor, Dashboard, SignIn, SignUp, Visitors), reusable components (Loader, Pagination, SearchInput, Toast) and layout sections (Header, etc.).
- Routing & Authentication: Utilize auth components like PrivateRoute.tsx and PublicRoute.tsx to control access to pages.
- Styling: SCSS files (App.scss, Header.scss) and antd components for consistent design.
- State Management:
- Redux Store: Includes actions (authActions.ts, visitorActions.ts), reducers (authReducer.ts, visitorReducer.ts), and store configuration files.
- Firebase Integration:
- Firebase Configuration: Located in src/firebase/config.ts, which handles connection and authentication with Firebase (authorization, possibly database interactions).
- Public Assets:
- Static files served from the public directory (index.html, manifest.json, robots.txt).

- UI/Frontend as a single block detailing components:
- App Container: The entry point (src/App.tsx) that integrates the Router and global styling.
- Page Components: Illustrate each page (Dashboard, SignIn, etc.) as sub-components, indicating that they plug into the routing system.
- Reusable Components: Group components like Loader, Pagination, SearchInput, Toast which are used across pages.
- Authentication Flow:
- Redux Flow:
- Redux Store block connected to components that dispatch actions and receive state updates.
- Firebase Backend:
- Public Directory:
- Static file serving layer that delivers the application shell and asset files to the browser.

##### Architectural Patterns and Design Principles
- Component-Based Architecture: Demonstrated in how React divides the UI into smaller, reusable units.
- Separation of Concerns: Clear division between UI (components/pages), state management (Redux store), and backend services (Firebase).
- Routing for Authentication: Use of PrivateRoute and PublicRoute components for secure navigation.
- Responsive and Modular Styling: Use of SCSS and antd to maintain a consistent UI.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend (React)"
        A["App Container (React UI)"]:::frontend
        subgraph "Reusable Components"
            L["Loader"]:::frontend
            PAG["Pagination"]:::frontend
            SI["Search Input"]:::frontend
            T["Toast"]:::frontend
        end
        P["Page Components (Various Pages)"]:::frontend
        H["Layout (Header)"]:::frontend
        subgraph "Routing & Authentication"
            PR["PrivateRoute"]:::auth
            PUBR["PublicRoute"]:::auth
        end
    end

    %% State Management Layer
    subgraph "State Management (Redux)"
        RS["Redux Store"]:::state
        AA["Auth Actions"]:::state
        VA["Visitor Actions"]:::state
        AR["Auth Reducer"]:::state
        VR["Visitor Reducer"]:::state
    end

    %% Backend Services
    subgraph "Backend Services"
        FB["Firebase Config"]:::backend
    end

    %% Public Assets Layer
    subgraph "Public Assets"
        PA["Static Assets"]:::public
    end

    %% Connections
    PA -->|"loads"| A
    A -->|"renders"| P
    A -->|"includes"| H
    A -->|"integrates"| L
    A -->|"integrates"| PAG
    A -->|"integrates"| SI
    A -->|"integrates"| T
    A -->|"controls routing"| PR
    A -->|"controls routing"| PUBR
    PR -->|"protects"| P
    PUBR -->|"allows access"| P

    %% Redux connections
    A -->|"dispatches actions to"| RS
    P -->|"reads state from"| RS
    AA --> RS
    VA --> RS
    RS --> AR
    RS --> VR
    RS -->|"syncs with"| FB

    %% Firebase connections with Routing
    PR -->|"validates auth with"| FB
    PUBR -->|"checks auth with"| FB

    %% Class Definitions for styling
    classDef frontend fill:#f9e79f,stroke:#d35400,stroke-width:2px;
    classDef state fill:#aed6f1,stroke:#2e86c1,stroke-width:2px;
    classDef backend fill:#abebc6,stroke:#1abc9c,stroke-width:2px;
    classDef public fill:#fad7a0,stroke:#e67e22,stroke-width:2px;
    classDef auth fill:#fadbd8,stroke:#e74c3c,stroke-width:2px;

    %% Click Events
    click A "https://github.com/kaimmrt/tiko-event-management-system/blob/master/src/App.tsx"
    click P "https://github.com/kaimmrt/tiko-event-management-system/tree/master/src/pages"
    click L "https://github.com/kaimmrt/tiko-event-management-system/blob/master/src/components/Loader.tsx"
    click PAG "https://github.com/kaimmrt/tiko-event-management-system/blob/master/src/components/Pagination.tsx"
    click SI "https://github.com/kaimmrt/tiko-event-management-system/blob/master/src/components/SearchInput.tsx"
    click T "https://github.com/kaimmrt/tiko-event-management-system/blob/master/src/components/Toast.ts"
    click H "https://github.com/kaimmrt/tiko-event-management-system/blob/master/src/components/sections/Header.tsx"
    click PR "https://github.com/kaimmrt/tiko-event-management-system/blob/master/src/components/auth/PrivateRoute.tsx"
    click PUBR "https://github.com/kaimmrt/tiko-event-management-system/blob/master/src/components/auth/PublicRoute.tsx"
    click AA "https://github.com/kaimmrt/tiko-event-management-system/blob/master/src/store/actions/authActions.ts"
    click VA "https://github.com/kaimmrt/tiko-event-management-system/blob/master/src/store/actions/visitorActions.ts"
    click AR "https://github.com/kaimmrt/tiko-event-management-system/blob/master/src/store/reducers/authReducer.ts"
    click VR "https://github.com/kaimmrt/tiko-event-management-system/blob/master/src/store/reducers/visitorReducer.ts"
    click FB "https://github.com/kaimmrt/tiko-event-management-system/blob/master/src/firebase/config.ts"
    click PA "https://github.com/kaimmrt/tiko-event-management-system/tree/master/public"
```
