# tylspiegel/scn architecture

> Architecture diagram of the GitHub repository tylspiegel/scn, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tylspiegel/scn
- Repository: https://github.com/tylspiegel/scn

## Overview

##### Main Components and Architecture

a) Frontend Layer (Top)
- HTML Templates (in scn_website/templates/)
- Static Assets (CSS/JS in scn_website/static/)
- PDF.js Integration (for score viewing)
- Audio Player Component

b) CMS Layer (Middle)
- Wagtail Admin Interface
- Content Management Components
- User Management
- Media Management

c) Backend Layer (Bottom)
- Django Core
- Database
- Media Storage
- Authentication System

##### Key Relationships and Data Flow

**User Request → Django URL Router → Wagtail Pages → Templates → Response**
**Content Editor → Wagtail Admin → Database → Frontend Display**
**Media Upload → Media Storage → Frontend Display**

##### Component Details

- Choir Event Management System
- Score/Audio Content Repository
- User Authentication & Authorization
- Media File Handling
- Template System
- Static Asset Pipeline

##### Specialized Features

Unique aspects:
- Musical Content Management
- Event Calendar System
- Score Viewer Integration
- Audio Player Implementation
- Archive System

##### Security Layer

Include:
- Authentication Flow
- Password Protection
- Media Access Control
- Admin Rights Management

##### Development Phases

- Current MVP Features (solid)

##### Integration Points

Connections with:
- PDF.js for score viewing
- Audio processing system
- Media storage system
- User management system

##### Security implementations

Remember to indicate the scalability points and potential expansion areas as mentioned in the development phases from the README.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and classes
    classDef frontend fill:#a8d1ff,stroke:#333
    classDef cms fill:#98ff98,stroke:#333
    classDef backend fill:#ffb366,stroke:#333
    classDef storage fill:#d3d3d3,stroke:#333
    classDef security fill:#ff9999,stroke:#333
    classDef integration fill:#e6b3ff,stroke:#333

    %% Frontend Layer
    subgraph Frontend
        Templates["HTML Templates"]
        StaticAssets["Static Assets"]
        PDFViewer["PDF.js Viewer"]
        AudioPlayer["Audio Player"]
        FrontendJS["Frontend JavaScript"]
        FrontendCSS["Frontend Styling"]
    end

    %% CMS Layer
    subgraph ContentManagement
        WagtailAdmin["Wagtail Admin Interface"]
        ContentComponents["Content Management"]
        UserManagement["User Management"]
        MediaManagement["Media Management"]
        Calendar["Event Calendar"]
    end

    %% Backend Layer
    subgraph Backend
        DjangoCore["Django Core"]
        Database[(Database)]
        MediaStorage["Media Storage"]
        AuthSystem["Authentication System"]
        SearchSystem["Search System"]
        URLRouter["URL Router"]
        AppSettings["Application Settings"]
    end

    %% Relationships
    Templates --> WagtailAdmin
    WagtailAdmin --> Database
    MediaManagement --> MediaStorage
    DjangoCore --> Database
    URLRouter --> DjangoCore
    AuthSystem --> Database
    ContentComponents --> Database
    Calendar --> Database
    PDFViewer --> MediaStorage
    AudioPlayer --> MediaStorage
    SearchSystem --> Database
    StaticAssets --> Templates
    FrontendJS --> Templates
    FrontendCSS --> Templates

    %% Click events for component mapping
    click Templates "https://github.com/TylSpiegel/scn/tree/master/scn_website/templates/"
    click StaticAssets "https://github.com/TylSpiegel/scn/tree/master/scn_website/static/"
    click PDFViewer "https://github.com/TylSpiegel/scn/tree/master/scn_website/static/pdfjs/"
    click MediaStorage "https://github.com/TylSpiegel/scn/tree/master/media/"
    click DjangoCore "https://github.com/TylSpiegel/scn/tree/master/choristes/"
    click Database "https://github.com/TylSpiegel/scn/blob/master/choristes/models.py"
    click ContentComponents "https://github.com/TylSpiegel/scn/blob/master/choristes/wagtail_hooks.py"
    click Calendar "https://github.com/TylSpiegel/scn/tree/master/choristes/migrations/"
    click FrontendJS "https://github.com/TylSpiegel/scn/blob/master/scn_website/static/js/scn_website.js"
    click FrontendCSS "https://github.com/TylSpiegel/scn/blob/master/scn_website/static/css/scn_website.css"
    click AppSettings "https://github.com/TylSpiegel/scn/tree/master/scn_website/settings/"
    click URLRouter "https://github.com/TylSpiegel/scn/blob/master/scn_website/urls.py"
    click SearchSystem "https://github.com/TylSpiegel/scn/tree/master/search/"

    %% Style applications
    class Templates,StaticAssets,PDFViewer,AudioPlayer,FrontendJS,FrontendCSS frontend
    class WagtailAdmin,ContentComponents,UserManagement,MediaManagement,Calendar cms
    class DjangoCore,Database,MediaStorage,AuthSystem,SearchSystem,URLRouter,AppSettings backend

    %% Legend
    subgraph Legend
        Frontend_L["Frontend Components"]:::frontend
        CMS_L["CMS Components"]:::cms
        Backend_L["Backend Components"]:::backend
    end
```
