How saalim-km/bella-imagine-client works
Project type and purpose
• Bella Imagine is a full-stack, single-page web application built in React (with TypeScript) that serves as a photography service marketplace.
• It connects three user roles—clients, photographers (vendors), and admins—offers real-time chat, community forums, booking workflows, AI-driven recommendations, and secure payments via Stripe.
File structure
• Top-level files:
• index.html, main.tsx, App.tsx → front-end entry point
• package.json, tsconfig.json, vite.config.ts, tailwind.config.js → build/config
• src/api → axios clients per domain (admin, auth, chat, client, community, vendor)
• src/components, src/pages → React component tree organized by feature (User, Admin, Community, Chat, etc.)
• src/hooks, src/services → data-fetch/service layer, encapsulating API calls and TanStack Query hooks
• src/context, src/store → global state (Redux slices) and React Context (Theme, Socket)
• src/config/socket.ts → WebSocket URL for real-time chat
• src/assets, src/utils, src/lib → static assets, utility functions, and formatters
• Deployment file: vercel.json
README for additional insights
• Frontend tech: React+TS, TanStack Query, Redux, Shadcn UI, Tailwind CSS
• External integrations: Google Maps SDK (autocomplete) for location search, Stripe for payments, Google OAuth for authentication
• Role-based access control across clients/vendors/admins
• Real-time collaboration via WebSockets
a. Main components
• Client-side (browser SPA)
• API Gateway / Load Balancer
• Microservice cluster (or API layer) with distinct domain services:
– Auth Service (signup/sign-in, Google OAuth)
– Client Service (client profiles, bookings)
– Vendor Service (vendor profiles, service listings, portfolios)
– Admin Service (category/community/user management)
– Community Service (posts, comments, feeds)
– Chat Service (WebSocket server for real-time messaging)
– Payment Service (Stripe integration, webhooks)
– Wallet Service (transaction history)
• Databases:
– Relational DB (PostgreSQL/MySQL) for core data (users, services, bookings, communities)
– NoSQL/Redis for real-time chat messages and caching
• External Services:
– Google Maps API (location autocomplete, geocoding)
– Stripe Payments & Webhook endpoint
– Google OAuth
b. Relationships and interactions
– Browser SPA communicates via HTTPS to API Gateway
– API Gateway routes requests to respective microservices
– Chat UI opens WebSocket connection to Chat Service (socket.ts)
– Payment Service triggers Stripe Checkout; Stripe sends webhooks back to Payment Service
– Services talk to shared databases or caches
– Redux/TanStack Query on frontend manage state and API calls
c. Architectural patterns/design principles
– Separation of concerns via domain-specific microservices or API modules
– Unidirectional data flow in front end (React → hooks → services → API → store)
– CQRS pattern (read models via TanStack Query, write operations via services)
– Real-time communication via WebSockets
– Role-based access control enforced at API gateway or service layer
d. Key technologies/frameworks
– Frontend: React, TypeScript, Redux Toolkit, TanStack Query, TailwindCSS, Shadcn components
– Backend (assumed): Node.js/Express or similar, WebSocket (socket.io or ws)
– Database: PostgreSQL/MySQL, Redis
– External: Google Maps SDK, Stripe, Google OAuth
Elements
• Labels: name each service, database, and external dependency.
• From SPA → API Gateway (HTTP requests)
• From SPA → Chat Service (WebSocket)
• From Payment Service ←→ Stripe (HTTPS + webhook)
• Services → Databases
Final advice
• Be exhaustive: represent each domain component (Auth, Client, Vendor, Admin, Community, Chat, Payment, Wallet) separately.
• Data flows precisely: who calls whom, which data stores are used.
• Deployment context (e.g., Vercel for frontend, Kubernetes or VM cluster for backend) at the bottom.