# devabhio88/blogging_website architecture

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

- Interactive diagram: https://gitdiagram.com/devabhio88/blogging_website
- Repository: https://github.com/devabhio88/blogging_website

## Overview

##### Project type and purpose
- From the file tree and README, this is a modern, full-stack blogging web application (“PeniVerse”) whose frontend is a React/Vite SPA and whose backend services (authentication, database, file storage) are all provided via Appwrite.

##### File structure
- Top-level files:
- package.json, vite.config.js, tailwind.config.js → build and styling tools (Vite, Tailwind).
- index.html, public/ → static assets and entry HTML.
- src/ directory:
- appwrite/ (auth.js, config.js) → wrapper around Appwrite SDK.
- store/ (authSlice.js, postSlice.js, store.js, storage.js) → Redux state management.
- components/ → a design-system of reusable UI components (buttons, inputs, form layouts, headers, footers, cards, RTE wrapper).
- pages/ → top-level routes (Home, Login, Signup, Add/Edit/Post details, AllPosts).
- main.jsx, App.jsx → SPA entry point, router setup, Redux provider.
- Build & config files: eslint.config.js, postcss.config.js, .env*.

##### README for additional insights
- Stack: React, Vite, Appwrite (Auth, DB, Storage), Redux, React Hook Form, TinyMCE.
- Flow: Appwrite config → Redux store → UI components → form/auth/CRUD → routing & protection.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer" 
        Browser["User Agent (Browser)"]:::frontend
        ReactApp["React/Vite Application"]:::frontend
        UIComponents["UI Component Library"]:::frontend
        Pages["Pages (Routes)"]:::frontend
    end

    %% State Layer
    subgraph "Client State Layer"
        ReduxStore["Redux Store"]:::state
        AuthSlice["authSlice"]:::state
        PostSlice["postSlice"]:::state
        StorageMW["storage.js"]:::state
    end

    %% API Layer
    subgraph "API Layer (Appwrite SDK Wrapper)"
        AppwriteConfig["config.js"]:::api
        AppwriteAuth["auth.js"]:::api
    end

    %% External Libraries
    subgraph "External Libraries" 
        TinyMCE["TinyMCE (RTE)"]:::external
        ReactHookForm["React Hook Form"]:::external
    end

    %% Build & Config
    subgraph "Build & Config"
        ViteConfig["vite.config.js"]:::config
        TailwindConfig["tailwind.config.js"]:::config
        PostCSSConfig["postcss.config.js"]:::config
        IndexCSS["src/index.css"]:::config
        Env[".env / .env.sample"]:::config
        ESLint["eslint.config.js"]:::config
    end

    %% Data Layer
    subgraph "Data Layer (Appwrite Cloud Services)" 
        AuthService["Auth Service"]:::backend
        DBService["Database Service"]:::backend
        StorageService["File Storage Service"]:::backend
    end

    %% Connections
    Browser -->|interacts with| ReactApp
    ReactApp -->|uses UI library| UIComponents
    ReactApp -->|renders pages| Pages
    ReactApp -->|dispatches actions| ReduxStore
    Pages -->|uses ReactHookForm| ReactHookForm
    UIComponents -->|includes RTE| TinyMCE

    ReduxStore -->|contains| AuthSlice
    ReduxStore -->|contains| PostSlice
    ReduxStore -->|uses| StorageMW

    AuthSlice -->|calls via SDK| AppwriteAuth
    PostSlice -->|calls via SDK| AppwriteConfig
    PostSlice -->|calls via SDK| AppwriteAuth
    StorageMW -->|persists state| ReduxStore

    AppwriteConfig -->|configures| AppwriteAuth
    AppwriteConfig -->|configures| AuthService
    AppwriteConfig -->|configures| DBService
    AppwriteConfig -->|configures| StorageService

    AppwriteAuth -->|auth calls| AuthService
    PostSlice -->|"DB CRUD calls"| DBService
    PostSlice -->|"storage calls"| StorageService

    AuthService -->|responses| AuthSlice
    DBService -->|responses| PostSlice
    StorageService -->|responses| PostSlice

    %% Build & Config usage
    ReactApp --> ViteConfig
    ReactApp --> TailwindConfig
    ReactApp --> PostCSSConfig
    ReactApp --> IndexCSS
    ReactApp --> Env
    ReactApp --> ESLint

    %% Click Events
    click ReactApp "https://github.com/devabhio88/blogging_website/blob/main/src/main.jsx"
    click ReduxStore "https://github.com/devabhio88/blogging_website/blob/main/src/store/store.js"
    click AuthSlice "https://github.com/devabhio88/blogging_website/blob/main/src/store/authSlice.js"
    click PostSlice "https://github.com/devabhio88/blogging_website/blob/main/src/store/postSlice.js"
    click StorageMW "https://github.com/devabhio88/blogging_website/blob/main/src/store/storage.js"
    click AppwriteConfig "https://github.com/devabhio88/blogging_website/blob/main/src/appwrite/config.js"
    click AppwriteAuth "https://github.com/devabhio88/blogging_website/blob/main/src/appwrite/auth.js"
    click UIComponents "https://github.com/devabhio88/blogging_website/tree/main/src/components/"
    click ViteConfig "https://github.com/devabhio88/blogging_website/blob/main/vite.config.js"
    click TailwindConfig "https://github.com/devabhio88/blogging_website/blob/main/tailwind.config.js"
    click PostCSSConfig "https://github.com/devabhio88/blogging_website/blob/main/postcss.config.js"
    click IndexCSS "https://github.com/devabhio88/blogging_website/blob/main/src/index.css"
    click Env "https://github.com/devabhio88/blogging_website/blob/main/.env"
    click ESLint "https://github.com/devabhio88/blogging_website/blob/main/eslint.config.js"

    %% Styles
    classDef frontend fill:#D6E4FF,stroke:#4B6EF5,color:#000
    classDef state fill:#CCE7FF,stroke:#336699,color:#000
    classDef api fill:#D5F5E3,stroke:#2E8B57,color:#000
    classDef external fill:#FFE5CC,stroke:#FF8C00,color:#000
    classDef config fill:#F0F0F0,stroke:#888,color:#000
    classDef backend fill:#D4FECD,stroke:#2E8B57,color:#000
```
