# y6-maenaka/mi-board architecture

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

- Interactive diagram: https://gitdiagram.com/y6-maenaka/mi-board
- Repository: https://github.com/y6-maenaka/mi-board

## Overview

Based on your file tree and README, Mi-Board is a Django-based full-stack web application. It houses multiple Django apps (e.g., accounts, board, discover, friend, ground, home, message, mypage, notification, personal_chat, recommend_system, room, settings, stoppo) that each handle a specific domain of functionality. The project also leverages several external technologies such as MySQL (database), Redis (for caching and possibly as a Channels layer), and is deployed on EC2 using Nginx as a reverse proxy with Gunicorn/Daphne for serving HTTP and asynchronous requests.

- Frontend Client: Represent the end user’s web browser that interacts with HTML, CSS, and JavaScript files. Note that static assets are served from the /static and /templates directories.
- Web Server (Nginx): Acts as the reverse proxy for both static content and proxied requests to the application servers.
- Application Servers:
– Gunicorn: Handles synchronous HTTP requests.
– Daphne: Supports asynchronous operations (e.g., WebSocket connections).
- Accounts Module: Manages authentication, user profiles, and account-related forms and emails.
- Board and Content Modules: Manages forums/boards, posts, and related content.
- Communication Modules: Includes modules like message, personal_chat, room, and notification—all of which hint at real-time features likely using Django Channels.
- Additional Functional Modules: Apps like friend, recommend_system, and stoppo address extended functionality such as friendships, recommendation, and perhaps file sharing.
- Data Store: MySQL, which holds persistent application data.
- Cache/Message Broker: Redis is used to support caching and probably the backend for Channels (WebSocket messaging).
- Deployment Infrastructure: EC2 is used as the host for these services.

##### Relationships and Interactions
- That static files and templates are directly served to the browser (either directly by Nginx or served with caching strategies).

##### Relevant Technologies and Frameworks
- Python-Django as the main backend framework.
- MySQL as the relational database.
- Redis for caching and channel layers.
- Nginx as the reverse proxy.
- Gunicorn/Daphne for serving synchronous/asynchronous traffic.
- Out frontend technologies: HTML, CSS, JavaScript along with jQuery.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Frontend Client Subgraph
    subgraph "Frontend Client"
        browser["Web Browser"]:::frontend
        sa["Static Assets"]:::frontend
        tmpl["Templates"]:::frontend
    end

    %% External Web Server and Application Servers
    nginx["Nginx (Web Server)"]:::web
    gunicorn["Gunicorn (Synchronous)"]:::app
    daphne["Daphne (Asynchronous)"]:::async

    %% Deployment Infrastructure
    ec2["EC2 (Deployment)"]:::infra

    %% External Data Stores
    mysql["MySQL (Database)"]:::db
    redis["Redis (Cache/Message Broker)"]:::async

    %% Django Application Subgraph
    subgraph "Django Application"
        django["Django Core"]
        accounts["Accounts"]:::app
        board["Board"]:::app
        discover["Discover"]:::app
        friend["Friend"]:::app
        ground["Ground"]:::app
        home["Home"]:::app
        message["Message"]:::async
        mypage["MyPage"]:::app
        notification["Notification"]:::async
        personal_chat["Personal Chat"]:::async
        recommend_system["Recommend System"]:::app
        room["Room"]:::async
        settings["Settings"]:::app
        stoppo["Stoppo"]:::app
    end

    %% Flow Connections between Frontend and Nginx
    browser -->|"HTTPRequest"| nginx
    nginx -->|"ServesStatic"| sa
    nginx -->|"ServesTemplates"| tmpl
    sa -->|"Delivered"| browser
    tmpl -->|"Delivered"| browser

    %% Forwarding Dynamic Requests from Nginx to Application Servers
    nginx -->|"ForwardSync"| gunicorn
    nginx -->|"ForwardAsync"| daphne

    %% Application Servers forwarding to Django Core
    gunicorn -->|"HandlesHTTP"| django
    daphne -->|"HandlesAsync"| django

    %% Django Core distributing to Modules
    django --> accounts
    django --> board
    django --> discover
    django --> friend
    django --> ground
    django --> home
    django --> message
    django --> mypage
    django --> notification
    django --> personal_chat
    django --> recommend_system
    django --> room
    django --> settings
    django --> stoppo

    %% Django Core interacting with Data Stores
    django -->|"CRUD"| mysql
    django -->|"Channels/Caching"| redis

    %% Inter-module interactions (asynchronous features)
    message -->|"sends_update"| notification
    personal_chat -->|"sends_notification"| notification
    room -->|"sends_notification"| notification

    %% Deployment: EC2 hosts the web server
    ec2 -->|"Hosts"| nginx

    %% Styles and classes
    classDef frontend fill:#e0f7fa,stroke:#333,stroke-width:2px;
    classDef web fill:#ffe0b2,stroke:#333,stroke-width:2px;
    classDef app fill:#c8e6c9,stroke:#333,stroke-width:2px;
    classDef async fill:#d1c4e9,stroke:#333,stroke-width:2px;
    classDef db fill:#ffccbc,stroke:#333,stroke-width:2px;
    classDef infra fill:#dcedc8,stroke:#333,stroke-width:2px;

    %% Click Events for Component Mapping
    click sa "https://github.com/y6-maenaka/mi-board/tree/main//static"
    click tmpl "https://github.com/y6-maenaka/mi-board/tree/main//templates"
    click accounts "https://github.com/y6-maenaka/mi-board/tree/main//accounts"
    click board "https://github.com/y6-maenaka/mi-board/tree/main//board"
    click discover "https://github.com/y6-maenaka/mi-board/tree/main//discover"
    click friend "https://github.com/y6-maenaka/mi-board/tree/main//friend"
    click ground "https://github.com/y6-maenaka/mi-board/tree/main//ground"
    click home "https://github.com/y6-maenaka/mi-board/tree/main//home"
    click message "https://github.com/y6-maenaka/mi-board/tree/main//message"
    click mypage "https://github.com/y6-maenaka/mi-board/tree/main//mypage"
    click notification "https://github.com/y6-maenaka/mi-board/tree/main//notification"
    click personal_chat "https://github.com/y6-maenaka/mi-board/tree/main//personal_chat"
    click recommend_system "https://github.com/y6-maenaka/mi-board/tree/main//recommend_system"
    click room "https://github.com/y6-maenaka/mi-board/tree/main//room"
    click settings "https://github.com/y6-maenaka/mi-board/tree/main//settings"
    click stoppo "https://github.com/y6-maenaka/mi-board/tree/main//stoppo"
```
