# abu-0-rayhan/fibernook architecture

> Architecture diagram of the GitHub repository abu-0-rayhan/fibernook, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abu-0-rayhan/fibernook
- Repository: https://github.com/abu-0-rayhan/fibernook

## Overview

##### Project type and purpose
- Fibernook is a full-stack e-commerce application for sustainable clothing.
- Frontend: ReactJS SPA, styled with Tailwind CSS, state managed by Redux.
- Backend: Django + Django REST Framework (DRF) serving JSON APIs.
- Data store: SQLite (for development), models organized into two Django apps: “authentication” and “shop.”

##### File structure
- Top-level “backend” and “frontend” directories.
- Backend:
- manage.py, settings.py, wsgi/asgi for Django project orchestration
- “authentication” app (user models, serializers, views, URLs)
- “shop” app (product models, serializers, views, URLs)
- db.sqlite3 for development persistence
- requirements.txt listing Django, DRF, others
- Frontend:
- index.html, main.jsx, App.jsx as SPA entry points
- src/components for presentation components (Navbar, Footer, Pages)
- src/features (Redux slices: authSlice, userSlice, titleSlice)
- src/services (shopApi, userAuthApi, LocalStorageService)
- Vite and Tailwind config files for build and styling

##### README for additional insights
- Confirms key features: RESTful authentication endpoints, product catalog endpoints, responsive UI, efficient state management, Tailwind styling.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend" 
        direction TB
        Browser["User Browser"]:::external
        ReactSPA["React SPA"]:::frontend
        subgraph "Entry Points"
            direction TB
            IDX["index.html"]:::frontend
            MAIN["main.jsx"]:::frontend
            APP["App.jsx"]:::frontend
        end
        subgraph "State Management"
            direction TB
            Store["Redux Store"]:::frontend
            AuthSlice["authSlice.js"]:::frontend
            UserSlice["userSlice.js"]:::frontend
            TitleSlice["titleSlice.js"]:::frontend
        end
        subgraph "Service Layer"
            direction TB
            ShopAPI["shopApi.js"]:::frontend
            UserAuthAPI["userAuthApi.js"]:::frontend
            LocalStorage["LocalStorageService.js"]:::frontend
        end
        TailwindConf["tailwind.config.js"]:::frontend
        PostCSS["postcss.config.js"]:::frontend
        ViteConf["vite.config.js"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend" 
        direction TB
        Manage["manage.py"]:::backend
        subgraph "Project Config"
            direction TB
            Settings["settings.py"]:::backend
            URLs["urls.py"]:::backend
            ASGI["asgi.py"]:::backend
            WSGI["wsgi.py"]:::backend
            APIURLs["api/urls.py"]:::backend
        end
        subgraph "Authentication App"
            direction TB
            AuthModels["models.py"]:::backend
            AuthSerializers["serializers.py"]:::backend
            AuthViews["views.py"]:::backend
            AuthURLs["urls.py"]:::backend
            AuthUtils["utils.py"]:::backend
            AuthRenderers["renderers.py"]:::backend
        end
        subgraph "Shop App"
            direction TB
            ShopModels["models.py"]:::backend
            ShopSerializers["serializers.py"]:::backend
            ShopViews["views.py"]:::backend
            ShopURLs["urls.py"]:::backend
        end
    end

    %% Data Stores
    subgraph "Data & Storage"
        direction TB
        DB["SQLite Database"]:::datastore
        StaticStore["Product Images\nstatic/product_images"]:::datastore
    end

    %% Connections
    Browser -->|opens| ReactSPA
    ReactSPA -->|renders UI| IDX
    ReactSPA -->|renders UI| MAIN
    ReactSPA -->|renders UI| APP
    ReactSPA -->|dispatches actions| Store
    Store -->|uses slices| AuthSlice
    Store -->|uses slices| UserSlice
    Store -->|uses slices| TitleSlice
    Store -->|calls| ShopAPI
    Store -->|calls| UserAuthAPI
    Store -->|persists| LocalStorage
    ShopAPI -->|HTTP requests| APIURLs
    UserAuthAPI -->|HTTP requests| APIURLs
    APIURLs -->|routes| AuthURLs
    APIURLs -->|routes| ShopURLs
    AuthViews -->|ORM operations| AuthModels
    ShopViews -->|ORM operations| ShopModels
    AuthModels -->|reads/writes| DB
    ShopModels -->|reads/writes| DB
    StaticStore -->|serves via| ASGI

    %% Click Events
    click IDX "https://github.com/abu-0-rayhan/fibernook/blob/main/frontend/index.html"
    click MAIN "https://github.com/abu-0-rayhan/fibernook/blob/main/frontend/src/main.jsx"
    click APP "https://github.com/abu-0-rayhan/fibernook/blob/main/frontend/src/App.jsx"
    click TailwindConf "https://github.com/abu-0-rayhan/fibernook/blob/main/frontend/tailwind.config.js"
    click PostCSS "https://github.com/abu-0-rayhan/fibernook/blob/main/frontend/postcss.config.js"
    click ViteConf "https://github.com/abu-0-rayhan/fibernook/blob/main/frontend/vite.config.js"
    click Store "https://github.com/abu-0-rayhan/fibernook/blob/main/frontend/src/app/store.js"
    click AuthSlice "https://github.com/abu-0-rayhan/fibernook/blob/main/frontend/src/features/authSlice.js"
    click UserSlice "https://github.com/abu-0-rayhan/fibernook/blob/main/frontend/src/features/userSlice.js"
    click TitleSlice "https://github.com/abu-0-rayhan/fibernook/blob/main/frontend/src/features/titleSlice.js"
    click ShopAPI "https://github.com/abu-0-rayhan/fibernook/blob/main/frontend/src/services/shopApi.js"
    click UserAuthAPI "https://github.com/abu-0-rayhan/fibernook/blob/main/frontend/src/services/userAuthApi.js"
    click LocalStorage "https://github.com/abu-0-rayhan/fibernook/blob/main/frontend/src/services/LocalStorageService.js"
    click Manage "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/manage.py"
    click Settings "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/backend/settings.py"
    click URLs "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/backend/urls.py"
    click ASGI "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/backend/asgi.py"
    click WSGI "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/backend/wsgi.py"
    click APIURLs "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/backend/api/urls.py"
    click AuthModels "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/authentication/models.py"
    click AuthSerializers "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/authentication/serializers.py"
    click AuthViews "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/authentication/views.py"
    click AuthURLs "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/authentication/urls.py"
    click AuthUtils "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/authentication/utils.py"
    click AuthRenderers "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/authentication/renderers.py"
    click ShopModels "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/shop/models.py"
    click ShopSerializers "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/shop/serializers.py"
    click ShopViews "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/shop/views.py"
    click ShopURLs "https://github.com/abu-0-rayhan/fibernook/blob/main/backend/shop/urls.py"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#0366d6,color:#000
    classDef backend fill:#d4edda,stroke:#28a745,color:#000
    classDef datastore fill:#fff3cd,stroke:#e4a11b,color:#000
    classDef external fill:#e2e3e5,stroke:#6c757d,color:#000
```
