# ndumisobuthelezi/aaplayground architecture

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

- Interactive diagram: https://gitdiagram.com/ndumisobuthelezi/aaplayground
- Repository: https://github.com/ndumisobuthelezi/aaplayground

## Overview

##### Project Type and Purpose
- The project is a full-stack web application built using ASP.NET MVC.
- Its primary goal is to calculate daily camp fees including VAT based on attendance time.
- Key functionality is split into computing fees (business logic) and presenting views to end users.

##### And Map the Main Components
- Controllers: Include components such as HomeController and CampController. These manage incoming requests and interact with the business logic.
- Models: Highlight the CampFeesModel, which encapsulates the pricing and fee calculations.
- Views: Include folders for Camp, Home, and Shared. These cshtml files render the user interface using the Layout view (_Layout.cshtml) and specific views (like Index.cshtml, DisplayCampFees.cshtml, etc.).
- Application Startup: Represent the Global.asax and the App_Start folder (which holds routing configuration, bundle configuration, and filter configuration). This shows how the application is bootstrapped and how requests are routed.
- Static Assets: Represent the Content folder (with CSS files) and Scripts folder (with JavaScript libraries like jQuery, Bootstrap, and Modernizr) that support the UI/UX.

##### Relationships and Interactions
- Client makes HTTP requests that hit the Controllers.
- Controllers process the request and interact with the Models (for data/calculation logic).
- Controllers then render Views which are returned as HTML to the client.

##### Important Architectural Patterns
- Layered Architecture: Identify how static file serving, configuration, and dynamic page rendering form the layered structure.
- Convention over Configuration: Mention that the naming conventions in controllers, models, and views streamline request routing and rendering in ASP.NET MVC.

##### Relevant Technologies and Frameworks
- ASP.NET MVC (.NET 5.0 or later recommended as per the README).
- Razor Views (the cshtml files) for dynamic HTML.
- Bootstrap and jQuery to drive the front-end user experience.
- Visual Studio as the IDE, which underpins the solution file (AAPlayground.sln) and project file (AAPlayground.csproj).

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% Client Layer
    Client["Client (Browser)"]:::client

    %% Application Startup Layer
    subgraph "Application Startup"
        GlobalApplication["Global.asax & Global.asax.cs"]:::startup
        AppStart["App_Start (Routing, Bundling, Filters)"]:::startup
    end

    %% MVC Framework Layer
    subgraph "MVC Framework"
        subgraph "Controllers"
            HomeController["HomeController"]:::controller
            CampController["CampController"]:::controller
        end
        subgraph "Models"
            CampFeesModel["CampFeesModel"]:::model
        end
        subgraph "Views"
            CampViews["Camp Views (cshtml)"]:::view
            HomeViews["Home Views (cshtml)"]:::view
            SharedViews["Shared Views (cshtml)"]:::view
            ViewStart["_ViewStart.cshtml"]:::view
        end
    end

    %% Static Assets Layer
    subgraph "Static Assets"
        Content["Content (CSS & Assets)"]:::asset
        Scripts["Scripts (JS Libraries)"]:::asset
    end

    %% Configuration Layer
    subgraph "Configuration"
        WebConfig["Web.config"]:::config
        WebDebug["Web.Debug.config"]:::config
        WebRelease["Web.Release.config"]:::config
    end

    %% Project Metadata Layer
    subgraph "Project Metadata"
        Solution["AAPlayground.sln"]:::metadata
        ProjectFile["AAPlayground.csproj"]:::metadata
    end

    %% Arrows / Data Flow
    Client -->|"HTTPRequest"| GlobalApplication
    GlobalApplication -->|"Setup"| AppStart
    AppStart -->|"RouteRequest"| HomeController
    AppStart -->|"RouteRequest"| CampController

    HomeController -->|"ComputeFee"| CampFeesModel
    CampController -->|"ComputeFee"| CampFeesModel

    HomeController -->|"RenderView"| HomeViews
    CampController -->|"RenderView"| CampViews
    HomeController -->|"RenderShared"| SharedViews

    HomeViews -->|"ReturnHTML"| Client
    CampViews -->|"ReturnHTML"| Client
    SharedViews -->|"ReturnHTML"| Client
    ViewStart -->|"SetLayout"| SharedViews

    %% Views loading Static Assets
    HomeViews -->|"LoadCSS"| Content
    HomeViews -->|"LoadJS"| Scripts
    CampViews -->|"LoadCSS"| Content
    CampViews -->|"LoadJS"| Scripts

    %% Configuration influences Startup
    WebConfig -->|"Configures"| AppStart
    WebDebug -->|"Configures"| AppStart
    WebRelease -->|"Configures"| AppStart

    %% Project Metadata bootstrap
    Solution -->|"Bootstrap"| GlobalApplication
    ProjectFile -->|"Build"| AppStart

    %% Click Events
    click HomeController "https://github.com/ndumisobuthelezi/aaplayground/blob/master/AAPlayground/Controllers/HomeController.cs"
    click CampController "https://github.com/ndumisobuthelezi/aaplayground/blob/master/AAPlayground/Controllers/CampController.cs"
    click CampFeesModel "https://github.com/ndumisobuthelezi/aaplayground/blob/master/AAPlayground/Models/CampFeesModel.cs"
    click CampViews "https://github.com/ndumisobuthelezi/aaplayground/tree/master/AAPlayground/Views/Camp"
    click HomeViews "https://github.com/ndumisobuthelezi/aaplayground/tree/master/AAPlayground/Views/Home"
    click SharedViews "https://github.com/ndumisobuthelezi/aaplayground/tree/master/AAPlayground/Views/Shared"
    click ViewStart "https://github.com/ndumisobuthelezi/aaplayground/blob/master/AAPlayground/Views/_ViewStart.cshtml"
    click GlobalApplication "https://github.com/ndumisobuthelezi/aaplayground/blob/master/AAPlayground/Global.asax"
    click AppStart "https://github.com/ndumisobuthelezi/aaplayground/tree/master/AAPlayground/App_Start"
    click Content "https://github.com/ndumisobuthelezi/aaplayground/tree/master/AAPlayground/Content"
    click Scripts "https://github.com/ndumisobuthelezi/aaplayground/tree/master/AAPlayground/Scripts"
    click WebConfig "https://github.com/ndumisobuthelezi/aaplayground/blob/master/AAPlayground/Web.config"
    click WebDebug "https://github.com/ndumisobuthelezi/aaplayground/blob/master/AAPlayground/Web.Debug.config"
    click WebRelease "https://github.com/ndumisobuthelezi/aaplayground/blob/master/AAPlayground/Web.Release.config"
    click Solution "https://github.com/ndumisobuthelezi/aaplayground/blob/master/AAPlayground.sln"
    click ProjectFile "https://github.com/ndumisobuthelezi/aaplayground/blob/master/AAPlayground/AAPlayground.csproj"

    %% Styles
    classDef client fill:#9cf,stroke:#333,stroke-width:2px;
    classDef startup fill:#fc9,stroke:#333,stroke-width:2px;
    classDef controller fill:#f9c,stroke:#333,stroke-width:2px;
    classDef model fill:#ccf,stroke:#333,stroke-width:2px;
    classDef view fill:#cfc,stroke:#333,stroke-width:2px;
    classDef asset fill:#cff,stroke:#333,stroke-width:2px;
    classDef config fill:#c9f,stroke:#333,stroke-width:2px;
    classDef metadata fill:#fcf,stroke:#333,stroke-width:2px;
```
