# seakyy/eventfeedbackapp architecture

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

- Interactive diagram: https://gitdiagram.com/seakyy/eventfeedbackapp
- Repository: https://github.com/seakyy/eventfeedbackapp

## Overview

##### Project type and purpose
- This is a full-stack, web-based feedback platform built with ASP.NET Core Razor Pages.
- Purpose: Allow admins to create “sessions” and questions (CRUD), let participants join via QR or session ID, submit responses in real time, and let admins view live charts (via Chart.js) updated over SignalR.

##### File structure
- Frontend (Razor Pages UI):
- src/Pages/Admin – admin workflows (CreateSession, CreateQuestion, Results, etc.)
- src/Pages/Feedback – participant workflows (JoinSession, Questions)
- src/Pages/Shared – layout and partial views (_Layout, validation scripts)
- wwwroot – static assets (css, js, Bootstrap, jQuery)
- Backend services & API:
- Program.cs & Startup pipeline (middleware, routing)
- src/Middleware/AdminAuthMiddleware.cs – custom auth guard for admin endpoints
- src/Hubs/FeedbackHub.cs – SignalR hub for push updates
- Data layer:
- src/Data/AppDbContext.cs – EF Core DbContext
- src/Models/*.cs – domain entities (Session, Question, Option, Response)
- src/Migrations – EF migrations for schema
- feedback.db – SQLite database file
- Configuration & build:
- appsettings.json / appsettings.Development.json
- launchSettings.json
- .csproj/.sln files

##### README for additional insights
- Core features: dynamic question engine, mobile-first UX (QR code), real-time dashboard.
- Endpoints of interest: /Admin/CreateSession, /Feedback/JoinSession, /Feedback/Questions/{id}, /Admin/Results/{id}.

##### Detailed breakdown to capture all architectural elements
- Middleware (AdminAuth)
- Page Handlers (Admin vs. Feedback folders)
- Hubs (FeedbackHub)
- Data (AppDbContext + Migrations + Models)
- Two feedback modes: polling vs. SignalR (admin can choose either ResultsPolling or ResultsSignalR).
- Asset pipeline: Browser ← static files (wwwroot)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Tier
    subgraph "Client Tier"
        AdminClient["Admin Browser\n(Razor Admin Pages + Chart.js)"]:::frontend
        ParticipantClient["Participant Browser\n(Razor Feedback Pages + QR Module)"]:::frontend
    end

    %% Static Assets
    Assets["Static Assets (wwwroot)"]:::frontend

    %% Web Server
    subgraph "Web Server (ASP.NET Core)"
        Middleware["AdminAuthMiddleware"]:::backend
        subgraph "Razor Page Handlers"
            AdminHandlers["Admin Pages\n(src/Pages/Admin)"]:::backend
            FeedbackHandlers["Feedback Pages\n(src/Pages/Feedback)"]:::backend
            Shared["Shared Pages\n(src/Pages/Shared)"]:::backend
            ErrorPages["Common Pages\n(src/Pages)"]:::backend
        end
        Hub["FeedbackHub (SignalR)\n(src/Hubs/FeedbackHub.cs)"]:::backend
        subgraph "Data Access Layer"
            DbContext["AppDbContext\n(src/Data/AppDbContext.cs)"]:::backend
            Migrations["Migrations\n(src/Migrations)"]:::backend
            Models["Domain Models\n(src/Models)"]:::backend
        end
        subgraph "Host & Configuration"
            Program["Program.cs\n(src/Program.cs)"]:::backend
            LaunchSettings["launchSettings.json\n(src/Properties/launchSettings.json)"]:::backend
            AppSettings["appsettings.json\n(src/appsettings.json)"]:::backend
        end
    end

    %% Database
    DB["SQLite Database\nfeedback.db"]:::database

    %% Project Files
    ProjectFile["EventFeedbackApp.csproj\n(src/EventFeedbackApp.csproj)"]:::backend
    Solution["Solution File\n(src/EventFeedbackApp.sln)"]:::backend

    %% Connections
    AdminClient -->|HTTP Requests| Middleware
    ParticipantClient -->|HTTP Requests| Middleware
    Middleware --> AdminHandlers
    Middleware -.-> FeedbackHandlers
    AdminHandlers --> DbContext
    FeedbackHandlers --> DbContext
    Shared --> AdminHandlers
    Shared --> FeedbackHandlers
    ErrorPages --> Middleware
    DbContext --> DB
    Migrations --> DbContext
    Models --> DbContext
    AdminHandlers --> Hub
    FeedbackHandlers --> Hub
    Hub -->|real-time updates| AdminClient
    Hub -->|real-time updates| ParticipantClient
    AdminClient -->|load assets| Assets
    ParticipantClient -->|load assets| Assets
    Program --> Middleware
    Program --> AdminHandlers
    Program --> FeedbackHandlers

    ProjectFile --> Program
    Solution --> ProjectFile

    %% Click Events
    click AdminHandlers "https://github.com/seakyy/eventfeedbackapp/tree/main/src/Pages/Admin"
    click FeedbackHandlers "https://github.com/seakyy/eventfeedbackapp/tree/main/src/Pages/Feedback"
    click Shared "https://github.com/seakyy/eventfeedbackapp/tree/main/src/Pages/Shared"
    click ErrorPages "https://github.com/seakyy/eventfeedbackapp/tree/main/src/Pages"
    click Middleware "https://github.com/seakyy/eventfeedbackapp/blob/main/src/Middleware/AdminAuthMiddleware.cs"
    click Hub "https://github.com/seakyy/eventfeedbackapp/blob/main/src/Hubs/FeedbackHub.cs"
    click DbContext "https://github.com/seakyy/eventfeedbackapp/blob/main/src/Data/AppDbContext.cs"
    click Migrations "https://github.com/seakyy/eventfeedbackapp/tree/main/src/Migrations"
    click Models "https://github.com/seakyy/eventfeedbackapp/tree/main/src/Models"
    click DB "https://github.com/seakyy/eventfeedbackapp/blob/main/src/feedback.db"
    click Assets "https://github.com/seakyy/eventfeedbackapp/tree/main/src/wwwroot"
    click Program "https://github.com/seakyy/eventfeedbackapp/blob/main/src/Program.cs"
    click LaunchSettings "https://github.com/seakyy/eventfeedbackapp/blob/main/src/Properties/launchSettings.json"
    click AppSettings "https://github.com/seakyy/eventfeedbackapp/blob/main/src/appsettings.json"
    click ProjectFile "https://github.com/seakyy/eventfeedbackapp/blob/main/src/EventFeedbackApp.csproj"
    click Solution "https://github.com/seakyy/eventfeedbackapp/blob/main/src/EventFeedbackApp.sln"

    %% Styles
    classDef frontend fill:#e0ffe0,stroke:#2d8f2d,stroke-width:1px
    classDef backend fill:#e0e0ff,stroke:#1f4e78,stroke-width:1px
    classDef database fill:#ffe0b3,stroke:#b36b00,stroke-width:1px
    classDef external stroke-dasharray: 5 5,stroke:#888;color:#555
```
