How yashbitcode/react-blog-app works
Project Type & Purpose
• This is a client-heavy full-stack blogging platform built in React/TypeScript that delegates backend responsibilities (auth, database, storage) to Appwrite.
• Users sign up, verify their email, log in, and perform CRUD operations on blog posts via a rich-text editor.
File Structure Analysis
• src/appwrite: thin SDK wrapper modules (auth.ts, database.ts, storage.ts).
• src/components & src/pages: React UI components, organized by feature (Auth, Post, Protected, Header, Verification, RTE).
• src/store: Redux Toolkit slices for application state (authSlice.ts, store.ts).
• src/utils, src/types, src/conf: helper functions, type definitions, configuration constants.
• Root config: Vite (vite.config.ts), TS (tsconfig.json), ESLint, Tailwind.
Key Architecture Insights from README
• Tech stack: React + TypeScript + TailwindCSS + TinyMCE + htmlparser2 + Appwrite.
• Environment drives Appwrite endpoints and project/database/collection IDs.
• No custom backend code—Appwrite services provide serverless API surface.
a. Main Components
• Client Browser (React SPA)
• UI Layer
• Pages & Components (Login, Signup, Home, PostForm, RTE, Protected)
• State Management
• Redux Store (authSlice, postSlice if any)
• Appwrite SDK Layer
• Auth Service
• Database Service
• Storage Service
• External Services
• Appwrite Backend (Authentication, Database, Storage microservices)
• TinyMCE (Rich Text Editor API)
b. Relationships & Data Flows
• User interacts with UI → dispatches Redux actions → Appwrite SDK calls → HTTP requests to Appwrite Auth/DB/Storage → responses back to SDK → Redux state updates → UI re-renders.
• RTE component issues API calls to TinyMCE’s cloud editor (for plugin/license).
• htmlparser2 used client-side to parse/render HTML content.
c. Architectural Patterns & Principles
• Separation of concerns:
• Presentation (components/pages)
• State (Redux)
• Service abstraction (src/appwrite wrappers)
• Serverless backend: leverages Appwrite microservices instead of custom Node/Express.
• Component-driven UI: reusable custom-components folder.
• React + TypeScript (UI/logic)
• Redux Toolkit (state)
• TailwindCSS (styling)
• Appwrite (auth, db, storage)
• TinyMCE & htmlparser2 (rich text + parsing)