Skip to content

Saket22-CS/WebSmithAI

Repository files navigation

🧠 WebSmithAI – Full-Stack AI SaaS Website Generator πŸš€

Live Demo: https://web-smith-ai.vercel.app/

WebSmithAI is a next-generation AI-powered SaaS web application that allows users to generate, edit, and customize complete websites with a single click β€” all in real time.
Built with Next.js 14, TypeScript, Tailwind CSS, Clerk, ImageKit, Drizzle ORM, and Neon PostgreSQL, it merges AI creativity with human precision.


πŸ—οΈ Key Features & Highlights

βš™οΈ AI-Powered Website Generation

  • Generate full, production-ready websites instantly from a text prompt.
  • Uses OpenRouter’s streaming AI API for real-time code generation.
  • Generates responsive HTML/CSS/Tailwind code on the fly.

✏️ Inline Editing Without Regeneration

  • Unique inline editing feature enables users to modify elements (text, font, color, margin, padding, etc.) directly within the preview.
  • Updates are saved instantly to the database β€” no need to re-trigger the AI model.

🧩 AI Image Generation & Transformation

  • Powered by ImageKit for:
    • Smart cropping
    • Background removal
    • Drop shadows
    • Upscaling
    • AI-generated images from text prompts
  • Transformations are applied instantly using URL-based AI parameters.

πŸ–₯️ Responsive Design Preview

  • Toggle between desktop and mobile modes for adaptive layouts.
  • Built-in iframe-based rendering isolates design styles for accurate previews.

πŸ” Authentication & Billing (SaaS Model)

  • Clerk handles secure sign-up, sign-in, and multi-factor authentication.
  • Integrated subscription billing and credit-based usage model.
  • Free-tier users get limited project credits; upgrade for unlimited creation.

πŸ“¦ Project & Workspace Management

  • Personalized workspace dashboard with:
    • Project list
    • Remaining credits tracker
    • Profile dropdown
    • β€œAdd New Project” button
  • Each project stores multiple β€œframes” (design versions) and associated chat logs.

πŸ—ƒοΈ Backend & Database

  • Neon PostgreSQL cloud database with Drizzle ORM for schema management.
  • Stores:
    • User data
    • Projects
    • Frames (website versions)
    • AI conversation history

πŸ’Ύ Code & Data Persistence

  • All user edits, AI-generated HTML, and transformations are persistently stored.
  • Cleaned HTML code is saved and retrievable for preview or download.

🌩️ Deployment

  • Fully deployed on Vercel with GitHub integration for CI/CD.
  • Environment variables configured securely through Vercel’s dashboard.

🧰 Tech Stack

Layer Technologies
Frontend Next.js 14, React, TypeScript, Tailwind CSS, ShadCN UI
Backend Next.js API Routes, Drizzle ORM, Neon PostgreSQL
Authentication & Billing Clerk
AI Integration OpenRouter API
Image Processing ImageKit AI Transformations
Deployment Vercel
Utilities UUID, Axios, React Context API, Toast Notifications

🧩 Architecture Overview

WebSmithAI follows a modular full-stack architecture, combining React’s client interactivity with serverless APIs for scalability.


User β†’ Clerk Auth β†’ Workspace β†’ Project β†’ Frame β†’ Chat β†’ AI Model β†’ HTML Code β†’ Inline Editor β†’ Database β†’ Save/Preview/Deploy

  • Frontend: React + Tailwind + TypeScript for UI/UX.
  • Serverless APIs: Handle chat, project CRUD, and AI integration.
  • Database (Drizzle ORM + Neon): Stores structured relational data.
  • AI Layer: Streams responses from OpenRouter for live content/code generation.
  • Storage: ImageKit handles media storage and transformation.

πŸ§‘β€πŸ’» Application Flow

  1. User Login/Signup via Clerk.
  2. Create Project β†’ Generates a unique Project ID.
  3. Send Prompt β†’ AI generates HTML/Tailwind code.
  4. Preview Website in iframe.
  5. Edit Inline β†’ Modify text, styles, spacing, etc.
  6. Save β†’ Updated HTML is persisted to database.
  7. Upload/Generate Images β†’ Modify visuals with ImageKit.
  8. View Projects in Workspace.
  9. Upgrade Plan for extended usage and features.

🧠 Core Functionalities by Module

πŸ”Ή Landing Page

  • Hero section with input for website ideas.
  • AI prompt suggestions and interactive UI.

πŸ”Ή Authentication

  • Clerk-powered sign-in, sign-up, and session handling.
  • Custom modals for login prompts on restricted routes.

πŸ”Ή Workspace

  • Sidebar with projects and credit tracker.
  • Project listing with skeleton loaders and progress bar.

πŸ”Ή Playground (Editor)

  • Split-view layout: Chat β†’ Preview β†’ Settings.
  • Real-time AI responses stream directly into design preview.
  • Inline editing for direct manipulation of elements.
  • Save button triggers HTML extraction and cleanup.

πŸ”Ή Database

  • PostgreSQL (via Neon) structured as:
    • users – user info
    • projects – each AI-generated website
    • frames – website versions
    • messages – chat history

πŸ”Ή Subscription & Billing

  • Clerk’s subscription system for SaaS plan management.
  • Restricts advanced features for free users.
  • Real-time plan sync via Clerk Webhooks.

πŸ’¬ AI Prompt Example

"Create a modern landing page for a personal portfolio website with a hero section, project showcase, and contact form."

AI Response: Streams Tailwind-styled responsive code instantly, viewable and editable inline.


πŸ“š Learning & References


πŸ’‘ Key Insights

  • Inline editing separates WebSmithAI from other AI website generators.
  • Streaming AI integration ensures faster feedback than traditional APIs.
  • Cloud-native architecture ensures scalability and smooth deployment.
  • Clerk + Neon + Vercel combination makes it production-ready out of the box.

🧾 Keywords

AI SaaS β€’ Website Generator β€’ Inline Editing β€’ Next.js β€’ Tailwind CSS β€’ TypeScript β€’ Clerk β€’ ImageKit β€’ PostgreSQL β€’ Drizzle ORM β€’ OpenRouter β€’ Streaming API β€’ WebRTC β€’ Responsive Design β€’ Vercel Deployment


πŸ‘¨β€πŸ’» Author

Developed by: Saket Chaudhary

Live Demo: https://web-smith-ai.vercel.app/

GitHub Repo: https://github.com/Saket22-CS/WebSmithAI

β€œTransforming AI intelligence into creative, editable web experiences.”


πŸ“„ License

This project is licensed under the MIT License – you’re free to use, modify, and distribute with attribution.


⭐ Support

If you like this project, please ⭐ the repository and share it! Feedback and suggestions are always welcome.


About

Full-stack AI-powered website generator built with Next.js, TypeScript, Drizzle ORM, and ImageKit.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors