Generate a full website from a prompt. Deploy it in one click.
Built with the MERN stack, powered by AI, and monetized with Stripe.
Genweb.ai is a full-stack SaaS application that lets users describe the website they want in plain language and get a fully generated site back — ready to preview and deploy, all in one click. It's built end-to-end: authentication, an AI generation pipeline, a credits-based usage system, and Stripe-powered subscription billing.
- 🤖 AI-powered website generation — describe your site in a prompt, get a working website generated for you
- ⚡ One-click deploy — go from prompt to live site without touching config
- 💳 Stripe billing & checkout — secure, PCI-compliant payments via Stripe Checkout Sessions
- 🎟️ Credit-based usage system — Free / Pro / Enterprise plans, each with its own credit allowance
- 🔐 Authentication & protected routes — JWT-based auth middleware guarding sensitive endpoints
- 🪝 Stripe Webhooks — automatic credit + plan provisioning on successful payment
- 🗄️ MongoDB persistence — user accounts, plans, and credit balances stored and updated reliably
| Layer | Technology |
|---|---|
| Frontend | React |
| Backend | Node.js + Express |
| Database | MongoDB (Mongoose) |
| Payments | Stripe (Checkout Sessions + Webhooks) |
| AI Generation | OpenRouter API |
| Auth | JWT-based middleware |
┌──────────────┐ ┌──────────────────┐ ┌───────────────┐
│ React UI │ ─────▶ │ Express Backend │ ─────▶ │ MongoDB │
│ (Prompt Box, │ REST │ (Auth, Billing, │ │ (Users, Plans,│
│ Dashboard) │◀───────│ AI Generation) │◀───────│ Credits) │
└──────────────┘ └──────────┬────────┘ └───────────────┘
│
┌──────────────┼───────────────┐
▼ ▼
┌─────────────┐ ┌──────────────┐
│ OpenRouter │ │ Stripe │
│ (AI models) │ │ (Checkout + │
└─────────────┘ │ Webhooks) │
└──────────────┘
| Plan | Price | Credits |
|---|---|---|
| Free | $0 | 100 |
| Pro | $5.99 | 500 |
| Enterprise | $10.99 | 1000 |
Credits are consumed per AI generation and automatically topped up when a paid plan checkout completes, via a Stripe webhook.
websiteBuilder/
├── backend/
│ ├── config/
│ │ ├── db.js
│ │ ├── openRouter.js
│ │ ├── plans.js
│ │ └── stripe.js
│ ├── controllers/
│ │ ├── auth.controller.js
│ │ ├── billing.controller.js
│ │ ├── stripeWebhook.controller.js
│ │ ├── user.controller.js
│ │ └── website.controller.js
│ ├── middlewares/
│ │ └── isAuth.js
│ ├── models/
│ │ ├── user.model.js
│ │ └── website.model.js
│ ├── routes/
│ │ ├── auth.routes.js
│ │ ├── billing.routes.js
│ │ ├── user.routes.js
│ │ └── website.routes.js
│ ├── utils/
│ │ └── extractJson.js
│ ├── .gitignore
│ ├── index.js
│ └── package.json
│
├── frontend/
│ ├── public/
│ │ ├── favicon.svg
│ │ └── icons.svg
│ ├── src/
│ │ ├── assets/
│ │ │ ├── hero.png
│ │ │ ├── react.svg
│ │ │ └── vite.svg
│ │ ├── components/
│ │ │ └── LoginModal.jsx
│ │ ├── hooks/
│ │ │ └── useGetCurrentUser.jsx
│ │ ├── pages/
│ │ │ ├── Dashboard.jsx
│ │ │ ├── Editor.jsx
│ │ │ ├── Generate.jsx
│ │ │ ├── Home.jsx
│ │ │ ├── LiveSite.jsx
│ │ │ └── Pricing.jsx
│ │ ├── redux/
│ │ │ ├── store.js
│ │ │ └── userSlice.js
│ │ ├── App.jsx
│ │ ├── firebase.js
│ │ ├── index.css
│ │ └── main.jsx
│ ├── .gitignore
│ ├── .oxlintrc.json
│ ├── index.html
│ ├── package.json
│ └── vite.config.js
│
└── README.md
- Node.js (v18+ recommended)
- MongoDB (local or Atlas)
- A Stripe account (test mode keys)
- An OpenRouter API key
git clone https://github.com/<your-username>/genweb-ai.git
cd genweb-aicd backend
npm installCreate a .env file in backend/:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
FRONTEND_URL=http://localhost:5173
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
OPENROUTER_API_KEY=your_openrouter_api_keyCreate a .env file in frontend/ with your Firebase config:
VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain
VITE_FIREBASE_PROJECT_ID=your_firebase_project_id
VITE_FIREBASE_APP_ID=your_firebase_app_idRun the backend:
npm run devcd ../frontend
npm install
npm run devstripe listen --forward-to localhost:5000/api/billing/webhookRoutes are split across four files: auth.routes.js, billing.routes.js, user.routes.js, and website.routes.js. Typical shape:
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/auth/* |
Registration / login / Firebase token exchange | ❌ |
| GET | /api/user/* |
Fetch current user profile & credit balance | ✅ |
| POST | /api/billing |
Creates a Stripe Checkout session for a plan | ✅ |
| POST | /api/billing/webhook |
Handles Stripe webhook events (raw body, Stripe-signed) | ❌ |
| POST | /api/website/* |
Generate, save, and fetch AI-generated websites | ✅ |
Fill in the exact paths from your route files — this is the general shape based on your project structure.
- Custom domain support on deploy
- Template gallery
- Team/multi-user workspaces
- Usage analytics dashboard
Contributions, issues, and feature requests are welcome. Feel free to check the issues page.
Distributed under the MIT License. See LICENSE for more information.
AYUSH DUBEY
- GitHub: @Coderencrypt
- LinkedIn: AYUSH DUBEY
If you found this project useful, consider giving it a ⭐️!



