# vlikcc/mebtoplantitakip architecture

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

- Interactive diagram: https://gitdiagram.com/vlikcc/mebtoplantitakip
- Repository: https://github.com/vlikcc/mebtoplantitakip

## Overview

##### Project Type and Purpose
- This is a full-stack meeting-tracking application for the Turkish Ministry of Education.
- Backend: ASP.NET Core RESTful API, Entity Framework Core, SQL Server.
- Frontend: React single-page app built with Create React App.

##### Main Components
a. Presentation Layer
- Web Client (Browser) running React SPA (`meb-toplanti-takip/src`)
- UI Components, Routes, Contexts (AuthContext, ProtectedRoute)
b. API Layer
- ASP.NET Core Web API (`Controllers/`)
- Endpoints: MeetingsController, AttendeesController, LocationsController, UsersController, QrCodeController
c. Business Logic Layer
- Services (`Services/`): MeetingService, AttendeeService, LocationService, UserService, QrCodeService, FileService
d. Data Access Layer
- Entity Framework Core DbContext (`DbContexts/MebToplantiTakipContext`)
- Migrations (`Migrations/`), Entities (`Entities/`), DTOs (`Dtos/`)
e. Persistence
- SQL Server Database
- File storage on disk under `wwwroot/Uploads` for meeting documents and generated QR codes
f. External/Infrastructure
- Docker (Dockerfile, .dockerignore)
- Configuration: appsettings.json (including connection string), launchSettings.json
- Development tools: .vscode, dotnet-tools.json

##### Relationships and Data Flows
- Browser → HTTP(S) calls → React SPA → Axios or fetch calls → API endpoints
- API Controller receives request → injects appropriate Service → Service uses DbContext → EF Core queries SQL Server → returns Entities → mapped to DTOs → returned as JSON
- File upload/download flows through FileService → saves to/reads from `wwwroot/Uploads`
- QrCodeService generates codes on demand, stored or streamed to client
- Authentication state handled in React (AuthContext) and ASP.NET Core middleware (e.g., JWT or cookie auth)

##### Architectural Patterns and Principles
- Layered architecture (Presentation → API → Business → Data)
- Separation of concerns (Controllers only handle HTTP, Services only implement business logic, DbContext for persistence)
- Dependency injection for Services and DbContext in Program.cs
- DTOs to decouple internal Entities from API contracts
- Code-first migrations for database schema evolution

##### Technologies and Frameworks to Annotate
- Frontend: React, Context API, React Router, Axios (or fetch), Create React App
- Backend: ASP.NET Core 6.0, Entity Framework Core, SQL Server, Docker
- Infrastructure: Dockerfile, .dockerignore, appsettings.json

## Diagram (Mermaid)

```mermaid
graph TB
    %% Client Layer
    subgraph "Client Layer"
        Browser["Web Browser"]:::external
    end

    %% Frontend Layer
    subgraph "Frontend Layer"
        ReactSPA["React SPA"]:::frontend
        UIComponents["UI Components"]:::frontend
        ProtectedRoute["ProtectedRoute"]:::frontend
        Header["Header"]:::frontend
        LayoutComp["Layout"]:::frontend
        Sidebar["Sidebar"]:::frontend
        AuthContext["AuthContext"]:::frontend
        AppJS["App.js"]:::frontend
        IndexJS["index.js"]:::frontend
    end

    %% API Layer
    subgraph "API Layer"
        MeetingsController["MeetingsController"]:::api
        AttendeesController["AttendeesController"]:::api
        LocationsController["LocationsController"]:::api
        UsersController["UsersController"]:::api
        QrCodeController["QrCodeController"]:::api
    end

    %% Service Layer
    subgraph "Service Layer"
        MeetingService["MeetingService"]:::service
        AttendeeService["AttendeeService"]:::service
        LocationService["LocationService"]:::service
        UserService["UserService"]:::service
        QrCodeService["QrCodeService"]:::service
        FileService["FileService"]:::service
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        DbContext["MebToplantiTakipContext"]:::data
        subgraph "Entities"
            EntityMeeting["Meeting"]:::data
            EntityAttendee["Attendee"]:::data
            EntityLocation["Location"]:::data
            EntityUser["User"]:::data
            EntityDocument["MeetingDocument"]:::data
        end
        subgraph "DTOs"
            DtoMeeting["MeetingDto"]:::data
            DtoAttendee["AttendeeDto"]:::data
            DtoLocation["LocationDto"]:::data
            DtoUser["UserDto"]:::data
        end
        Migrations["Migrations"]:::data
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        SQLServer["SQL Server"]:::persistence
        FileStorage["File Storage"]:::infra
    end

    %% Infrastructure
    subgraph "Infrastructure"
        DockerfileNode["Dockerfile"]:::infra
        Dockerignore[".dockerignore"]:::infra
        AppSettings["appsettings.json / appsettings.Development.json"]:::infra
        LaunchSettings["launchSettings.json"]:::infra
        ProgramCS["Program.cs"]:::infra
    end

    %% Relationships
    Browser -->|"loads"| ReactSPA
    ReactSPA -->|"renders"| UIComponents
    UIComponents -->|"uses"| ProtectedRoute
    UIComponents -->|"uses"| Header
    UIComponents -->|"uses"| LayoutComp
    UIComponents -->|"uses"| Sidebar
    ReactSPA -->|"provides"| AuthContext
    ReactSPA -->|"routes via"| AppJS
    AppJS -->|"bootstrap"| IndexJS

    ReactSPA -->|"HTTP/HTTPS"| MeetingsController
    ReactSPA -->|"HTTP/HTTPS"| AttendeesController
    ReactSPA -->|"HTTP/HTTPS"| LocationsController
    ReactSPA -->|"HTTP/HTTPS"| UsersController
    ReactSPA -->|"HTTP/HTTPS"| QrCodeController

    MeetingsController -->|"injects"| MeetingService
    AttendeesController -->|"injects"| AttendeeService
    LocationsController -->|"injects"| LocationService
    UsersController -->|"injects"| UserService
    QrCodeController -->|"injects"| QrCodeService

    MeetingService -->|"uses DbContext"| DbContext
    AttendeeService -->|"uses DbContext"| DbContext
    LocationService -->|"uses DbContext"| DbContext
    UserService -->|"uses DbContext"| DbContext
    QrCodeService -->|"uses FileService"| FileService
    FileService -->|"reads/writes"| FileStorage

    DbContext -->|"maps Entities"| EntityMeeting
    DbContext -->|"maps Entities"| EntityAttendee
    DbContext -->|"maps Entities"| EntityLocation
    DbContext -->|"maps Entities"| EntityUser
    DbContext -->|"maps Entities"| EntityDocument
    DbContext -->|"uses DTOs"| DtoMeeting
    DbContext -->|"uses DTOs"| DtoAttendee
    DbContext -->|"uses DTOs"| DtoLocation
    DbContext -->|"uses DTOs"| DtoUser
    DbContext -->|"migrations"| Migrations

    DbContext -->|"connects to"| SQLServer

    %% Click Events
    click ReactSPA "https://github.com/vlikcc/mebtoplantitakip/tree/master/meb-toplanti-takip/src"
    click UIComponents "https://github.com/vlikcc/mebtoplantitakip/tree/master/meb-toplanti-takip/src/components"
    click ProtectedRoute "https://github.com/vlikcc/mebtoplantitakip/blob/master/meb-toplanti-takip/src/components/auth/ProtectedRoute.js"
    click Header "https://github.com/vlikcc/mebtoplantitakip/blob/master/meb-toplanti-takip/src/components/layout/Header.js"
    click LayoutComp "https://github.com/vlikcc/mebtoplantitakip/blob/master/meb-toplanti-takip/src/components/layout/Layout.js"
    click Sidebar "https://github.com/vlikcc/mebtoplantitakip/blob/master/meb-toplanti-takip/src/components/layout/Sidebar.js"
    click AuthContext "https://github.com/vlikcc/mebtoplantitakip/blob/master/meb-toplanti-takip/src/contexts/AuthContext.js"
    click AppJS "https://github.com/vlikcc/mebtoplantitakip/blob/master/meb-toplanti-takip/src/App.js"
    click IndexJS "https://github.com/vlikcc/mebtoplantitakip/blob/master/meb-toplanti-takip/src/index.js"
    click MeetingsController "https://github.com/vlikcc/mebtoplantitakip/blob/master/Controllers/MeetingsController.cs"
    click AttendeesController "https://github.com/vlikcc/mebtoplantitakip/blob/master/Controllers/AttendeesController.cs"
    click LocationsController "https://github.com/vlikcc/mebtoplantitakip/blob/master/Controllers/LocationsController.cs"
    click UsersController "https://github.com/vlikcc/mebtoplantitakip/blob/master/Controllers/UsersController.cs"
    click QrCodeController "https://github.com/vlikcc/mebtoplantitakip/blob/master/Controllers/QrCodeController.cs"
    click MeetingService "https://github.com/vlikcc/mebtoplantitakip/blob/master/Services/MeetingService.cs"
    click AttendeeService "https://github.com/vlikcc/mebtoplantitakip/blob/master/Services/AttendeeService.cs"
    click LocationService "https://github.com/vlikcc/mebtoplantitakip/blob/master/Services/LocationService.cs"
    click UserService "https://github.com/vlikcc/mebtoplantitakip/blob/master/Services/UserService.cs"
    click QrCodeService "https://github.com/vlikcc/mebtoplantitakip/blob/master/Services/QrCodeService.cs"
    click FileService "https://github.com/vlikcc/mebtoplantitakip/blob/master/Services/FileService.cs"
    click DbContext "https://github.com/vlikcc/mebtoplantitakip/blob/master/DbContexts/MebToplantiTakipContext.cs"
    click EntityMeeting "https://github.com/vlikcc/mebtoplantitakip/blob/master/Entities/Meeting.cs"
    click EntityAttendee "https://github.com/vlikcc/mebtoplantitakip/blob/master/Entities/Attendee.cs"
    click EntityLocation "https://github.com/vlikcc/mebtoplantitakip/blob/master/Entities/Location.cs"
    click EntityUser "https://github.com/vlikcc/mebtoplantitakip/blob/master/Entities/User.cs"
    click EntityDocument "https://github.com/vlikcc/mebtoplantitakip/blob/master/Entities/MeetingDocument.cs"
    click DtoMeeting "https://github.com/vlikcc/mebtoplantitakip/blob/master/Dtos/MeetingDto.cs"
    click DtoAttendee "https://github.com/vlikcc/mebtoplantitakip/blob/master/Dtos/Attendee.cs"
    click DtoLocation "https://github.com/vlikcc/mebtoplantitakip/blob/master/Dtos/Location.cs"
    click DtoUser "https://github.com/vlikcc/mebtoplantitakip/blob/master/Dtos/UserDto.cs"
    click Migrations "https://github.com/vlikcc/mebtoplantitakip/tree/master/Migrations/"
    click FileStorage "https://github.com/vlikcc/mebtoplantitakip/tree/master/wwwroot/Uploads"
    click DockerfileNode "https://github.com/vlikcc/mebtoplantitakip/tree/master/Dockerfile"
    click Dockerignore "https://github.com/vlikcc/mebtoplantitakip/blob/master/.dockerignore"
    click AppSettings "https://github.com/vlikcc/mebtoplantitakip/blob/master/appsettings.json"
    click LaunchSettings "https://github.com/vlikcc/mebtoplantitakip/blob/master/Properties/launchSettings.json"
    click ProgramCS "https://github.com/vlikcc/mebtoplantitakip/blob/master/Program.cs"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366D6,color:#0366D6
    classDef api fill:#E0F8E0,stroke:#228B22,color:#228B22
    classDef service fill:#E0F8E0,stroke:#006400,color:#006400
    classDef data fill:#FFF4D0,stroke:#DAA520,color:#DAA520
    classDef persistence fill:#FFE0B2,stroke:#FF8C00,color:#FF8C00
    classDef infra fill:#E0E0E0,stroke:#A9A9A9,color:#555555
    classDef external fill:#F0F0F0,stroke:#888888,color:#000000
```
