From 5147209f65bda2fcda916ce8947c8b01cff90837 Mon Sep 17 00:00:00 2001 From: molathotisaiteja1267-ctrl Date: Sun, 26 Jul 2026 16:03:15 +0530 Subject: [PATCH] docs: update README with images --- README.md | 103 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 61 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 506767b..ef810e5 100644 --- a/README.md +++ b/README.md @@ -20,51 +20,11 @@ This project focuses on: --- ## πŸ—οΈ Project Structure - -``` -my-react-app/ -β”‚ -β”œβ”€β”€ public/ -β”‚ β”œβ”€β”€ index.html -β”‚ β”œβ”€β”€ favicon.ico -β”‚ └── assets/ # Static assets (images, fonts, icons) -β”‚ -β”œβ”€β”€ src/ -β”‚ β”œβ”€β”€ assets/ # App-level assets -β”‚ β”œβ”€β”€ components/ # Reusable UI components -β”‚ β”œβ”€β”€ features/ # Domain-driven modules -β”‚ β”‚ β”œβ”€β”€ FeatureName/ -β”‚ β”‚ β”‚ β”œβ”€β”€ components/ # Feature-specific UI -β”‚ β”‚ β”‚ β”œβ”€β”€ hooks/ # Feature-specific hooks -β”‚ β”‚ β”‚ β”œβ”€β”€ services/ # API + logic -β”‚ β”‚ β”‚ β”œβ”€β”€ FeatureName.tsx -β”‚ β”‚ β”‚ └── featureSlice.ts -β”‚ β”‚ └── ... -β”‚ β”‚ -β”‚ β”œβ”€β”€ hooks/ # Global reusable hooks -β”‚ β”œβ”€β”€ layouts/ # Layouts (Header, Sidebar, Footer) -β”‚ β”œβ”€β”€ pages/ # Route-based pages -β”‚ β”œβ”€β”€ routes/ # Routing & guards -β”‚ β”œβ”€β”€ services/ # API clients (Axios, Fetch) -β”‚ β”œβ”€β”€ store/ # Global state (Redux/Zustand) -β”‚ β”œβ”€β”€ styles/ # Global styles/themes -β”‚ β”œβ”€β”€ utils/ # Helper functions -β”‚ β”œβ”€β”€ App.tsx # Root component -β”‚ β”œβ”€β”€ index.tsx # Entry point -β”‚ └── setupTests.ts # Test setup -β”‚ -β”œβ”€β”€ tests/ # E2E / integration tests -β”‚ -β”œβ”€β”€ .env # Environment configs -β”œβ”€β”€ package.json -β”œβ”€β”€ tsconfig.json -β”œβ”€β”€ vite.config.ts -└── README.md ``` + --- - -## 🧠 Architecture Philosophy +##🧠 Architecture Philosophy ### 1. Feature-Based Design @@ -107,6 +67,65 @@ Each feature contains: --- + +## πŸ›οΈ Visual Architecture & Data Flow + +To make onboarding seamless for new contributors, Commdesk relies on clear, unidirectional data flows and strict modular boundaries. Here is how our system operates under the hood. + +###1. Application Architecture + +The application is structured into distinct horizontal layers. Components never bypass layers to talk directly to the backend; all communication flows cleanly through state and service abstractions. + + + +What this shows: + + - 🎨 Presentation Layer (Blue): Handles rendering and user interaction. + - ⚑ Feature Layer (Orange): Packages domain-specific business logic together. + - 🧠 State Layer (Purple): Acts as the single source of truth for app data. + - 🌐 Service Layer (Green): Manages external HTTP requests and interceptors. + +##2. Feature Module Organization + +To prevent spaghetti code, each feature module acts like its own mini-application. It exposes UI, isolates its business logic into React hooks, encapsulates API requests in services, and manages its own state slice. + + + +Why we organize this way: + + - Components remain clean and "dumb"β€”they just display data and pass events. + - Hooks handle complex calculations, validations, and state mapping. + - If an API endpoint changes, you only ever need to edit one file inside services/. + +##3. Request Flow (End-to-End Journey) + +Every user interaction follows a strict, predictable 9-step path from the browser to the backend database and back. This ensures application state stays synchronized with the server at all times. + + + +The Step-by-Step Lifecycle: + + 1.Trigger: A user clicks a button or submits a form. + 2.Logic: A custom hook validates the input and prepares the payload. + 3.Dispatch: An action is dispatched to the Redux store (triggering a loading state). + 4.Network: The service layer sends an HTTP request to the backend. + 5.Update: Once the server responds, the Redux store updates immutably. + 6.Render: React detects the state change and automatically re-renders the UI. + +##4. State Management Flow + +When an action is dispatched, Redux determines whether it is a Synchronous update (like toggling a UI menu) or an Asynchronous update (like fetching data from an API). + + + +Key State Rules: + + - Reducers must be pure: They calculate the new state without triggering side effects. + - Thunks handle async: Any code that relies on timers, promises, or network requests lives inside an Async Thunk. + - Single Source of Truth: Components never store global data in local state; they always read directly from the Redux Store using selectors. + + + ## βš™οΈ Tech Stack - βš›οΈ React (with TypeScript)