# abhisheksakhare1000/blog-website-using-flask architecture

> Architecture diagram of the GitHub repository abhisheksakhare1000/blog-website-using-flask, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhisheksakhare1000/blog-website-using-flask
- Repository: https://github.com/abhisheksakhare1000/blog-website-using-flask

## Overview

##### Main Components

A. Frontend Layer:
- Static Assets (CSS, JavaScript, Images)
- Templates (Jinja2 HTML templates)
- Client-side interactions

B. Backend Layer:
- Flask Application Server
- Route Controllers
- Authentication System
- Template Engine (Jinja2)

C. Database Layer:
- MySQL Database (indicated by codingthunder.sql)
- Data Models (Posts, Users, Contacts)

**[Client Browser] → [Frontend Layer] → [Backend Layer] → [Database Layer]**

##### Detailed Component Breakdown

Frontend Layer (Top):
- Static Assets (CSS/JS/Images)
- HTML Templates
- User Interface Components
- Home Page
- Dashboard
- Contact Form
- About Page
- Login Page
- Post View

Middle Tier (Center):
- Route Controllers
- Authentication Manager
- Template Engine
- Configuration Handler (config.json)

Database Layer (Bottom):
- Posts Table
- Users Table
- Contacts Table

##### Connection and Flow Indicators

- HTTP/HTTPS requests between Client and Server
- Template rendering flow
- Database queries and responses
- Authentication flows
- CRUD operations for posts

##### Additional Elements

Notes showing:
- Configuration management (config.json)
- Static file serving
- Template inheritance (layout.html as base)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph "Frontend Layer"
        UI["User Interface"]
        StaticAssets["Static Assets"]:::static
        Templates["Templates"]:::templates
        
        subgraph "Public Pages"
            Home["Home Page"]:::template
            About["About Page"]:::template
            Contact["Contact Form"]:::template
            PostView["Post View"]:::template
        end
        
        subgraph "Admin Pages"
            Login["Login Page"]:::template
            Dashboard["Dashboard"]:::template
            EditPost["Edit Post"]:::template
        end
    end

    subgraph "Backend Layer"
        Flask["Flask Application Server"]:::backend
        RouteController["Route Controllers"]:::backend
        AuthManager["Authentication Manager"]:::backend
        TemplateEngine["Template Engine"]:::backend
        Config["Configuration Handler"]:::config
    end

    subgraph "Database Layer"
        MySQL["MySQL Database"]:::database
        Posts["Posts Table"]:::database
        Users["Users Table"]:::database
        Contacts["Contacts Table"]:::database
    end

    Browser --> UI
    UI --> StaticAssets
    UI --> Templates

    Templates --> Home
    Templates --> About
    Templates --> Contact
    Templates --> PostView
    Templates --> Login
    Templates --> Dashboard
    Templates --> EditPost

    UI --> Flask
    Flask --> RouteController
    Flask --> AuthManager
    Flask --> TemplateEngine
    Flask --> Config

    RouteController --> MySQL
    MySQL --> Posts
    MySQL --> Users
    MySQL --> Contacts

    %% Click Events
    click StaticAssets "https://github.com/abhisheksakhare1000/Blog-website-using-flask/tree/master/static"
    click Templates "https://github.com/abhisheksakhare1000/Blog-website-using-flask/tree/master/templates"
    click Home "https://github.com/abhisheksakhare1000/Blog-website-using-flask/blob/master/templates/index.html"
    click About "https://github.com/abhisheksakhare1000/Blog-website-using-flask/blob/master/templates/about.html"
    click Contact "https://github.com/abhisheksakhare1000/Blog-website-using-flask/blob/master/templates/contact.html"
    click PostView "https://github.com/abhisheksakhare1000/Blog-website-using-flask/blob/master/templates/post.html"
    click Login "https://github.com/abhisheksakhare1000/Blog-website-using-flask/blob/master/templates/login.html"
    click Dashboard "https://github.com/abhisheksakhare1000/Blog-website-using-flask/blob/master/templates/dashboard.html"
    click EditPost "https://github.com/abhisheksakhare1000/Blog-website-using-flask/blob/master/templates/edit.html"
    click Flask "https://github.com/abhisheksakhare1000/Blog-website-using-flask/blob/master/main.py"
    click Config "https://github.com/abhisheksakhare1000/Blog-website-using-flask/blob/master/config.json"
    click MySQL "https://github.com/abhisheksakhare1000/Blog-website-using-flask/blob/master/codingthunder.sql"

    %% Styles
    classDef static fill:#B8B8B8
    classDef templates fill:#A0D8EF
    classDef template fill:#D4F1F4
    classDef backend fill:#90EE90
    classDef database fill:#FFB347
    classDef config fill:#E6E6FA

    %% Legend
    subgraph Legend
        L1["Frontend Components"]:::templates
        L2["Backend Components"]:::backend
        L3["Database Components"]:::database
        L4["Configuration"]:::config
        L5["Static Assets"]:::static
    end
```
