How jashanpreet-82099/ai-builder works
Genweb.ai is a web app for generating and revising websites with AI, managing saved projects, and deploying live previews; it also provides account access and paid credit plans. The main user journey runs from the client’s generation/editor screens to the website API, which prompts OpenRouter, parses its response, and stores generated code and credit changes. Deployment saves a public slug that the live-site screen can retrieve. Billing creates Stripe checkout sessions and credits accounts through a webhook. Client-to-server wiring beyond the sampled current-user hook is not shown, so those links are omitted.
Main entry points: App.jsx App routing · index.js Express API · website.controllers.js Website controller · user.model.js User records
Components 26
Client app
- App routing
client/src/App.jsx - Home
client/src/pages/Home.jsx - Dashboard
client/src/pages/Dashboard.jsx - Generate screen
client/src/pages/Generate.jsx - Website editor
client/src/pages/Editor.jsx - Live site
client/src/pages/LiveSite.jsx - Pricing
client/src/pages/Pricing.jsx - Current-user hook
client/src/hooks/useGetCurrentUser.jsx - User state
client/src/redux/userSlice.js
Website generation
- Website routes
server/routes/website.routes.js - Website controller
server/controllers/website.controllers.js - Website records
server/models/website.model.js - JSON extraction
server/utils/extractJson.js
Accounts and billing
- Auth routes
server/routes/auth.routes.js - User routes
server/routes/user.routes.js - Billing routes
server/routes/billing.routes.js - Auth controller
server/controllers/auth.controller.js - User controller
server/controllers/user.controllers.js - Billing controller
server/controllers/billing.controller.js - Stripe webhook
server/controllers/stripeWebhook.controller.js - User records
server/models/user.model.js
Server platform
- Express API
server/index.js - Auth middleware
server/middlewares/isAuth.js
Other components
- User
- OpenRouter
server/config/openRouter.js - Stripe
server/config/stripe.js
Connections 33
- User → App routing: uses
- App routing → Home: routes
- App routing → Dashboard: routes
- App routing → Generate screen: routes
- App routing → Website editor: routes
- App routing → Live site: routes
- App routing → Pricing: routes
- App routing → Current-user hook: invokes
- Current-user hook → User routes: requests user
- Current-user hook → User state: dispatches user
- Express API → Auth routes: mounts
- Express API → User routes: mounts
- Express API → Website routes: mounts
- Express API → Billing routes: mounts
- Express API → Stripe webhook: dispatches webhook
- Auth routes → Auth controller: dispatches
- User routes → Auth middleware: guards
- User routes → User controller: dispatches
- Website routes → Auth middleware: guards
- Website routes → Website controller: dispatches
- Billing routes → Auth middleware: guards
- Billing routes → Billing controller: dispatches
- Auth controller → User records: reads and writes
- Auth controller → User records: finds account
- User controller → User records: reads account
- Website controller → User records: reads and updates
- Website controller → Website records: reads and writes
- Website controller → OpenRouter: generates code
- Website controller → JSON extraction: parses response
- Billing controller → Stripe: creates checkout
- Stripe → Stripe webhook: sends event
- Stripe webhook → Stripe: verifies event
- Stripe webhook → User records: adds credits