sahyogi/
├── client/ # React frontend (Vite)
│ └── src/
│ ├── pages/ # Route-level page components
│ ├── components/ # Shared UI components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utilities, API clients
│ ├── App.tsx # Router + layout
│ └── main.tsx # Entry point
│
├── server/ # Express backend
│ ├── index.ts # Server entry point
│ ├── routes.ts # ALL API routes (~5300 lines)
│ ├── db.ts # Database connection (mysql2 pool)
│ ├── jwt-auth.ts # JWT middleware + helpers
│ ├── storage.ts # DB operations (queries/mutations)
│ ├── stripe.ts # Stripe client + webhook handler
│ ├── subscription.ts # Subscription & billing logic
│ ├── access-control.ts # RBAC implementation
│ ├── websocket.ts # WebSocket server
│ ├── cron.ts # Scheduled jobs (node-cron)
│ ├── controllers/wapp/ # WhatsApp-specific route handlers
│ ├── webhooks/ # Incoming webhook handlers
│ ├── middleware/ # RBAC middleware
│ └── utils/ # vectorSearch, encryption, event-emitter
│
├── shared/
│ ├── schema.ts # Drizzle schema + Zod types (source of truth)
│ ├── gupshup.ts # Gupshup API client
│ └── wasimple.ts # Wasimple API client
│
├── db/
│ ├── index.ts # DB pool initialization
│ ├── seed.ts # Seed data
│ └── migrations/ # SQL migration files
│
├── agent/ # Standalone AI agent process (port 5555)
├── uploads/ # Local file upload directory
├── drizzle.config.ts # ORM configuration
├── docker-compose.yml # Local dev services
├── Dockerfile # Production Docker image
└── package.json