How shlok-vertex/quickblog-frontend works
Project Type and Purpose
• This is a single-page frontend application (“QuickBlog-Frontend”) built with React and Vite.
• It provides both a public blog interface (listing posts, individual blog pages, newsletter signup) and an admin interface (login, dashboard, manage blogs and comments).
High-Level Architectural Components
A. Client / Browser
• Loads index.html
• Runs the React SPA (App.jsx)
B. Build & Assets
• Vite (vite.config.js) bundles JS/JSX, CSS, static assets from /public and /src/assets
• Outputs optimized static files for deployment
C. UI Modules
1. Core Layout & Routing
– main.jsx initializes React root and router
– App.jsx defines top-level <Routes> for public vs. admin
2. Public Pages
– Home.jsx, Vlog.jsx
– Shared components: Header, Footer, Navbar, BlogList, BlogCard, Loader, NewsLetter
3. Admin Pages
– Layout.jsx wraps admin UI
– Login.jsx, DashBoard.jsx, AddBlog.jsx, ListBlog.jsx, Comments.jsx
– Admin components: Sidebar, BlogTableItem, ComentTableItem
D. External Services (to be shown as placeholders)
• Blog API Backend (REST endpoints for posts, comments, auth)
• Authentication Service / JWT provider
• CDN or Static Hosting (e.g., Netlify, Vercel)
E. Configuration & Tooling
• eslint.config.js for lint rules
• package.json declares dependencies (React, React-Router, Vite, etc.)
Component Interactions & Data Flow
• The browser requests index.html from the hosting server → Vite-generated JS/CSS assets are loaded
• App.jsx router dispatches users to public or admin sub-applications
• Page components call a network layer (e.g., fetch/axios) to communicate with the Blog API
• API responses populate UI state in components (useState/useEffect or a global store)
• Admin actions (create/edit post, approve comments) POST/PUT to secured API endpoints
Architectural Patterns & Design Principles
• SPA with client-side routing (React Router)
• Separation of concerns:
• “Pages” for route-level logic and data fetching
• “Components” for reusable UI pieces
• “Assets” directory for static resources and styles
• Layered data flow: View → Router → Page → Component → API service
• Build pipeline: Source (JSX + CSS + assets) → Vite bundler → Static bundle → CDN