How rishi-269/blogweave works
1. This is a client-side React SPA built with Vite. The repository is frontend-only: src/main.jsx bootstraps the app, and the UI is composed from page components plus shared layout/controls.
2. The application is organized around route-level screens in src/pages: Home, Login, Signup, Post, Profile, MyPosts, AddPost, and EditPost. These are the main entry points for user flows and are what you would place as top-level boxes in an architecture diagram.
3. Authentication is handled through Appwrite, with a thin service boundary in src/appwrite/auth.js. The app uses src/store/authSlice.js and src/store/store.js as the local client-side auth state layer, so login/session state is not managed directly inside individual pages.
4. Content/data access is also abstracted behind Appwrite in src/appwrite/db.js. That file is the likely boundary for CRUD operations against the backend database, and the post-related pages depend on it rather than talking to Appwrite directly.
5. src/conf/conf.js centralizes environment-specific configuration, likely including Appwrite project/database identifiers loaded from .env. This is the repo’s main configuration boundary between local code and external services.
6. The post creation/editing workflow is concentrated in src/components/PostForm/PostForm.jsx, with RTE.jsx for rich-text input and Select.jsx/Input.jsx for form controls. AddPost and EditPost likely share this form component, which is an important reuse boundary in the UI.
7. App chrome is split into reusable layout components: Header, Footer, Container, Logo, LogoutBtn, and AuthLayout. AuthLayout is especially important because it likely wraps protected or auth-related screens and enforces the login/session boundary.
8. The component library in src/components also includes generic primitives like Button, Card, and Input. These keep styling and behavior consistent across pages and reduce direct markup duplication in the route screens.
9. The main data flow is: user interacts with a page → page calls Appwrite service helpers → backend state changes → Redux auth state updates where relevant → UI re-renders through route and layout components. For post views, the flow is similar but centered on database reads/writes rather than auth state.
10. The likely protected areas are AddPost, EditPost, MyPosts, and Profile, while Home, Post, Login, and Signup are more public-facing. In a diagram, separate “public routes” from “authenticated routes” and show AuthLayout as the guard.
11. Styling and build tooling are standard frontend infrastructure: Tailwind CSS with PostCSS, plus Vite and ESLint. src/index.css and src/App.css define the base/global styling layer, while public and src/assets hold static resources.
12. src/pages/index.js and src/components/index.js are barrel exports that simplify imports across the app. This is a small but useful structural detail: the codebase is organized for clean module boundaries rather than deep relative import chains.
Main entry points: App.jsx App · auth.js Auth API · db.js DB API · AuthLayout.jsx AuthLayout
Components 24
Runtime
Frontend bootstrap and app shell
Routes
Top-level screens and route-level flows
- Home · Landing and feed entry point
src/pages/Home.jsx - Login · Sign-in flow
src/pages/Login.jsx - Signup · Account creation flow
src/pages/Signup.jsx - Post · Single post view
src/pages/Post.jsx - Profile · User profile and account view
src/pages/Profile.jsx - My Posts · User-owned posts listing
src/pages/MyPosts.jsx - Add Post · Create-post flow
src/pages/AddPost.jsx - Edit Post · Update-post flow
src/pages/EditPost.jsx
Services
Appwrite-backed data and auth boundaries
State
Client-side auth state management
- Auth Slice · Client-side auth/session state
src/store/authSlice.js - Store · Redux store wiring
src/store/store.js
UI
Reusable layout and form components
- AuthLayout · Wraps protected or auth-related screens
src/components/AuthLayout.jsx - Header · Top navigation and session actions
src/components/Header/Header.jsx - Footer · App footer
src/components/Footer/Footer.jsx - Container · Shared page width and spacing wrapper
src/components/Container/Container.jsx - PostForm · Shared create/edit post form
src/components/PostForm/PostForm.jsx - RTE · Rich-text editor field
src/components/RTE.jsx - Controls · Shared buttons, inputs, selects, and card UI
src/components/index.js
Config
Environment and app configuration
- Config · Environment and Appwrite configuration
src/conf/conf.js
Styling
Global styles and build-time CSS setup
- Global CSS · Base application styling
src/index.css - App CSS · App-level styling overrides
src/App.css
Connections 38
- main.jsx → App: mounts · Entry point renders the application
- App → Home: routes · Defines the public landing route
- App → Login: routes · Defines the login route
- App → Signup: routes · Defines the signup route
- App → Post: routes · Defines the single post route
- App → Profile: routes · Defines the profile route
- App → My Posts: routes · Defines the user posts route
- App → Add Post: routes · Defines the create post route
- App → Edit Post: routes · Defines the edit post route
- Add Post → AuthLayout: guarded by · Create flow is protected
- Edit Post → AuthLayout: guarded by · Edit flow is protected
- My Posts → AuthLayout: guarded by · User posts view is protected
- Profile → AuthLayout: guarded by · Profile view is protected
- Home → Header: uses · Shares global chrome
- Home → Footer: uses · Shares global chrome
- Login → AuthLayout: uses · Uses auth-specific layout
- Signup → AuthLayout: uses · Uses auth-specific layout
- Add Post → PostForm: uses · Create flow reuses post form
- Edit Post → PostForm: uses · Edit flow reuses post form
- PostForm → RTE: composes · Embeds rich-text editor
- PostForm → Controls: composes · Uses shared form primitives
- Header → Controls: composes · Uses shared UI primitives
- Header → Auth API: session · Supports login/logout actions
- Auth API → Config: config · Reads Appwrite environment settings
- DB API → Config: config · Reads Appwrite environment settings
- Login → Auth API: auth · Authenticates users
- Signup → Auth API: auth · Registers users
- Profile → Auth API: session · Reads current session context
- My Posts → DB API: reads · Loads user posts
- Home → DB API: reads · Loads post data
- Post → DB API: reads · Loads a single post
- Add Post → DB API: writes · Creates posts
- Edit Post → DB API: writes · Updates posts
- App → Store: wires · Connects app to client state
- Store → Auth Slice: contains · Registers auth slice
- Auth API → Auth Slice: updates · Auth actions feed local state
- Global CSS → App: styles · Global base styles apply to app shell
- App CSS → App: styles · App-level styles apply to app shell