Overview
KAIU Natural Living follows a modern monorepo structure with clear separation between frontend and backend code.Root Directory
Frontend Structure (src/)
The frontend is built with React, Vite, and TailwindCSS.
Component Organization
- UI Components (
components/ui/) - Generic, reusable components based on shadcn/ui - Feature Components - Domain-specific components grouped by feature
- Pages - Top-level route components
Backend Structure (backend/)
The backend is organized by functional domains.
Backend Organization Principles
- Services - Encapsulate business logic and external integrations
- API Handlers - Thin controllers that orchestrate services
- Workers - Background job processors (BullMQ)
- Utils - Shared helper functions
Database (prisma/)
Configuration Files
Build and Development
-
vite.config.ts- Vite bundler configuration- React plugin with SWC
- PWA configuration
- API proxy to backend (port 3001)
- Path aliases (
@→./src)
-
vitest.config.ts- Test runner configuration- jsdom environment
- Global test utilities
- Setup files
-
tailwind.config.ts- TailwindCSS configuration -
tsconfig.json- TypeScript configuration
Code Quality
eslint.config.js- ESLint rules.gitignore- Git exclusions
Entry Points
server.mjs- Backend Express serversrc/main.tsx- Frontend React applicationSTART_ALL.sh- Development environment launcher
Key Directories Explained
/public
Static assets served directly:
- Icons and favicons
- robots.txt
- Manifest files for PWA
/scripts
Utility scripts for development and testing:
simulate-webhook.js- Test WhatsApp webhookssimulate-wompi-events.js- Test payment eventstest-*.js- Various testing utilities
/data
Configuration and data files (if applicable).
Import Path Aliases
The project uses path aliases for cleaner imports:@ resolves to ./src/
Technology Stack Reference
Frontend
- Framework: React 18
- Build Tool: Vite 5
- Styling: TailwindCSS + shadcn/ui
- Routing: React Router v6
- State: React Query (TanStack Query)
- Forms: React Hook Form + Zod
- UI Components: Radix UI primitives
Backend
- Runtime: Node.js 20+
- Framework: Express
- Database: PostgreSQL + Prisma
- Queue: BullMQ + Redis
- AI: Anthropic Claude + LangChain
- Messaging: WhatsApp Cloud API
- Payments: Wompi
Next Steps
- Explore Prisma Schema Models
- Learn about Database Migrations
- Review Code Style Guide