How kea-renov8/befly-fe works
Project type and purpose
• This is a front-end web application (ReNov8-FE) built with React and Vite.
• It provides a multi-page user interface: login/signup, home, chat, posts, profile, error handling.
• It uses React Router for navigation, React Query for data fetching, and a theme provider for styling. Storybook is included for isolated component development.
File structure
• Top-level tooling/config:
• vite.config.js, package.json, tsconfig/jsconfig, eslint.config.js, .prettierrc, .github/workflows.
• index.html (app shell) in the public folder.
• Source code (src):
• src/main.jsx: application entrypoint that mounts <App />.
• src/app: core of the application.
– App.jsx/App.css: root component and global styles.
– providers/: context providers (router, theme, query).
– layout/: page wrappers (RootLayout).
– routes/: route definitions and protected routes.
– styles/: design tokens and global-style.
• src/pages: feature folders (chat, home, login, post, profile, report, my, error). Each contains UI components, hooks (query/mutate), stores, and styles.
• src/shared: reusable assets, hooks, stores, components, utilities, plus Storybook stories in .storybook and src/shared/stories for isolated component development.
• No backend code here; this is purely a client that communicates with external APIs.
Extract insights from README
• Stacks: Git, Notion; implicit tech stack: React, Vite, React Router, React Query, Storybook.
a. Main components
• Build & Dev Environment: Vite (Dev Server, HMR, Production Build)
• Browser (Client)
• React Application
– Entry Point (main.jsx)
– App Component
– Context Providers (Router, Query, Theme)
– Routing Layer (React Router)
– Feature Modules (pages/*)
· UI Components
· Business Logic Hooks (useQuery/useMutation)
· Local Stores (zustand or context)
– Shared Components & Utilities
– Style System (global-style, design tokens)
– Storybook (isolated component dev)
• External Services (REST or GraphQL API endpoints)
• Static Assets (public folder)
b. Relationships & interactions
• Vite bundles sources → serves to Browser
• Browser loads index.html → initializes React via main.jsx
• App component wraps children in Providers → provides routing, theming, data-fetching contexts
• React Router resolves URL → renders specific Page module
• Page modules invoke hooks (React Query) to fetch/update data from External API
• Local Stores hold transient UI state
• Shared components imported by pages for consistency
• Storybook reads components in isolation (no API)
c. Architectural patterns/design principles
• Component-based UI (React)
• Context/API-driven state management (React Query, custom Providers)
• Domain-driven folder structure (group by feature/page)
• Single Page Application with client-side routing
• Separation of concerns: UI, styles, data fetching, routing
• Reusability via shared modules and Storybook
d. Key technologies/frameworks
• Vite (build & dev server)
• React 18
• React Router v6
• React Query
• Storybook
• CSS modules / styled components pattern via global-style and tokens