# alperensamurlu/community-todo-website architecture

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

- Interactive diagram: https://gitdiagram.com/alperensamurlu/community-todo-website
- Repository: https://github.com/alperensamurlu/community-todo-website

## Overview

##### Project type and purpose
- Community To-Do is a full-stack, community-centric task management web application.
- Frontend: static HTML pages + Bootstrap 5 + custom JavaScript.
- Backend: ASP.NET Core MVC Web API using EF Core and MSSQL.
- External service: SMTP email service for verification and notifications.

##### File structure
- Top-level directories:
- /frontend: HTML views (index, login, signup, dashboard, password reset, verification) + /scripts (config, login, signup, dashboard, verification).
- /backend/ToDoBackend: .NET solution and project folders.
– Controllers: CommunitiesController, TasksController, UsersController, UserCommunitiesController, NotificationController
– DTOs: data-transfer objects for requests/responses
– Models: EF Core entity classes (User, Community, Task, Notification, UserCommunity)
– Data: AppDbContext (DbSet<> for each model)
– Services: EmailService
– Config: appsettings.json, launchSettings.json, web.config
– Build: .csproj, ToDoBackend.http (API testing script)

##### README for additional insights
- Confirms MVC pattern, EF Core ORM, JSON over HTTP for API, Bootstrap 5 for responsive UI.
- Detailed data model relationships (Users ↔ Communities ↔ Tasks ↔ Notifications via UserCommunities join table).
- Email verification and password reset flows via EmailService.

##### Main components
a. Frontend (Browser)
- Static pages + JS modules
- Interacts over HTTP/HTTPS with backend API
b. Backend Web API
- Presentation layer: Controllers receive HTTP requests
- Service layer: business logic (EmailService, any future services)
- Data access layer: AppDbContext via EF Core
c. Database (MSSQL)
- Tables: Users, Communities, Tasks, Notifications, UserCommunities, __EFMigrationsHistory
d. External SMTP Email Service
- Sends verification codes & notifications

##### Relationships and interactions
- Browser → (HTTP JSON) → Controllers (Users, Communities, Tasks, UserCommunities, Notification)
- Controllers → (calls) → Services (e.g., EmailService) or directly → DbContext
- AppDbContext → (ORM) → MSSQL Database
- EmailService → SMTP Server → User’s inbox
- NotificationController → (push pulled by frontend or polled) → Dashboard notifications

##### Architectural patterns and design principles
- Layered MVC architecture: clear separation of concerns
- DTOs for boundary objects (incoming requests, outgoing responses)
- EF Core as repository/Unit-of-Work pattern via DbContext
- Stateless Web API controllers, scale horizontally if needed
- Single-page interactions orchestrated by JS modules, but pages are not a SPA (each page a separate HTML + script)

##### Technologies and frameworks
- Frontend: HTML5, CSS/Bootstrap 5, vanilla JS modules
- Backend: .NET 7+ (or .NET Core 3.1+), ASP.NET Core MVC, Entity Framework Core
- Database: Microsoft SQL Server
- External: SMTP (configurable via appsettings.json)

##### Detail but avoid over-modularizing
- Related controllers together under “API Controllers.”
- Essential data-flow paths (user login, community join, task CRUD, email verification, notifications).

## Diagram (Mermaid)

```mermaid
flowchart LR
    subgraph "Browser / Frontend"
        direction TB
        Pages["Static Web Assets\nHTML Pages"]:::frontend
        Scripts["JS Modules"]:::frontend
    end

    subgraph "Server"
        direction TB
        subgraph "ASP.NET Core MVC Web API"
            direction TB
            subgraph "API Controllers"
                direction TB
                UsersController["UsersController"]:::api
                CommunitiesController["CommunitiesController"]:::api
                TasksController["TasksController"]:::api
                UserCommunitiesController["UserCommunitiesController"]:::api
                NotificationController["NotificationController"]:::api
            end
            Services["Service Layer\nEmailService"]:::service
            DataAccess["Data Access\nAppDbContext"]:::data
            Config["Config & Startup"]:::config
        end
        Database["MSSQL Database"]:::db
        SMTP["SMTP Email Service"]:::external
    end

    Pages -->|"loads"| Scripts
    Scripts -->|"HTTP/HTTPS JSON"| UsersController
    UsersController -->|"calls DbContext methods"| DataAccess
    CommunitiesController -->|"calls DbContext methods"| DataAccess
    TasksController -->|"calls DbContext methods"| DataAccess
    UserCommunitiesController -->|"calls DbContext methods"| DataAccess
    NotificationController -->|"uses EmailService"| Services
    DataAccess -->|"SQL commands"| Database
    Services -->|"SMTP/TCP"| SMTP

    click UsersController "https://github.com/alperensamurlu/community-todo-website/blob/master/backend/ToDoBackend/ToDoBackend/Controllers/UsersController.cs"
    click CommunitiesController "https://github.com/alperensamurlu/community-todo-website/blob/master/backend/ToDoBackend/ToDoBackend/Controllers/CommunitiesController.cs"
    click TasksController "https://github.com/alperensamurlu/community-todo-website/blob/master/backend/ToDoBackend/ToDoBackend/Controllers/TasksController.cs"
    click UserCommunitiesController "https://github.com/alperensamurlu/community-todo-website/blob/master/backend/ToDoBackend/ToDoBackend/Controllers/UserCommunitiesController.cs"
    click NotificationController "https://github.com/alperensamurlu/community-todo-website/blob/master/backend/ToDoBackend/ToDoBackend/Controllers/NotificationController.cs"
    click Services "https://github.com/alperensamurlu/community-todo-website/blob/master/backend/ToDoBackend/ToDoBackend/Services/EmailService.cs"
    click DataAccess "https://github.com/alperensamurlu/community-todo-website/blob/master/backend/ToDoBackend/ToDoBackend/Data/AppDbContext.cs"
    click Config "https://github.com/alperensamurlu/community-todo-website/blob/master/backend/ToDoBackend/ToDoBackend/appsettings_example.json"
    click Config "https://github.com/alperensamurlu/community-todo-website/blob/master/backend/ToDoBackend/ToDoBackend/appsettings.Development.json"
    click Config "https://github.com/alperensamurlu/community-todo-website/blob/master/backend/ToDoBackend/ToDoBackend/Properties/launchSettings.json"
    click Config "https://github.com/alperensamurlu/community-todo-website/blob/master/backend/ToDoBackend/ToDoBackend/web.config"
    click Config "https://github.com/alperensamurlu/community-todo-website/blob/master/backend/ToDoBackend/ToDoBackend/Program.cs"

    click Pages "https://github.com/alperensamurlu/community-todo-website/blob/master/frontend/index.html"
    click Pages "https://github.com/alperensamurlu/community-todo-website/blob/master/frontend/login.html"
    click Pages "https://github.com/alperensamurlu/community-todo-website/blob/master/frontend/signup.html"
    click Pages "https://github.com/alperensamurlu/community-todo-website/blob/master/frontend/dashboard.html"
    click Pages "https://github.com/alperensamurlu/community-todo-website/blob/master/frontend/password-reset-request.html"
    click Pages "https://github.com/alperensamurlu/community-todo-website/blob/master/frontend/password-reset-code.html"
    click Pages "https://github.com/alperensamurlu/community-todo-website/blob/master/frontend/password-reset-form.html"
    click Pages "https://github.com/alperensamurlu/community-todo-website/blob/master/frontend/verification.html"

    click Scripts "https://github.com/alperensamurlu/community-todo-website/blob/master/frontend/scripts/config.js"
    click Scripts "https://github.com/alperensamurlu/community-todo-website/blob/master/frontend/scripts/login.js"
    click Scripts "https://github.com/alperensamurlu/community-todo-website/blob/master/frontend/scripts/signup.js"
    click Scripts "https://github.com/alperensamurlu/community-todo-website/blob/master/frontend/scripts/dashboard.js"
    click Scripts "https://github.com/alperensamurlu/community-todo-website/blob/master/frontend/scripts/verification.js"

    classDef frontend fill:#f9f,stroke:#333,stroke-width:2px
    classDef api fill:#bbf,stroke:#335,stroke-width:2px
    classDef service fill:#bfb,stroke:#353,stroke-width:2px
    classDef data fill:#fbf,stroke:#533,stroke-width:2px
    classDef config fill:#ffb,stroke:#553,stroke-width:2px
    classDef db fill:#ccf,stroke:#339,stroke-width:2px
    classDef external fill:#fcc,stroke:#933,stroke-width:2px
```
