A modern, responsive website builder built with Next.js 15, TypeScript, and Tailwind CSS. Create beautiful websites with drag-and-drop sections, real-time preview, and export/import functionality.
- 📚 Section Library: Click-to-add pre-made sections (Header, Hero, Content, CTA, Footer)
- 👀 Live Preview: Real-time preview of your website as you build
- 📥📤 Import/Export: Save and load your designs as JSON files
- ✏️ Editable Sections: Customize text, images, colors, and properties
- 🔄 Drag & Drop: Reorder sections with smooth animations
- 🗑️ Section Management: Delete unwanted sections with confirmation
- 🖥️ Desktop Layout: Traditional sidebar layout with section library and editor
- 📱 Mobile/Tablet: Floating action buttons with slide-out panels
- 🎯 Touch-Friendly: Optimized interactions for mobile devices
- 🔄 Adaptive UI: Seamlessly adapts to all screen sizes
- 🚀 SSR-Friendly: Server-side rendering for better SEO and performance
- 🎭 Smooth Animations: Subtle transitions and hover effects
- ⚡ Optimized Rendering: React.memo and useCallback for minimal re-renders
- 🎨 Visual Feedback: Selection rings, hover states, and drag indicators
- ✅ Jest Testing: Comprehensive test coverage for all components
- 🔧 TypeScript: Full type safety throughout the application
- 📏 ESLint: Code quality and consistency
- 🎨 Prettier: Automated code formatting
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: Tailwind CSS 4
- State Management: Zustand
- Drag & Drop: @hello-pangea/dnd
- Icons: Custom SVG icons
- Testing: Jest + Testing Library
- Node.js 18+
- npm, yarn, pnpm, or bun
-
Clone the repository
git clone https://github.com/MohAlkurdi/website-builder.git cd website-builder -
Install dependencies
npm install # or yarn install # or pnpm install
-
Start the development server
npm run dev # or yarn dev # or pnpm dev
-
Open your browser Navigate to http://localhost:3000
- Add Sections: Click on any section template in the library or use the mobile + button
- Customize Content: Click on any section to edit its properties in the sidebar
- Reorder Sections: Drag and drop sections to rearrange them
- Preview Mode: Toggle preview mode to see how your site looks to visitors
- Save Your Work: Export your design as JSON and import it later
- Left Sidebar: Section library with available templates
- Center Area: Live preview of your website
- Right Sidebar: Section editor (appears when a section is selected)
- Full Screen Preview: Maximum screen real estate for your content
- Floating Action Button: Add new sections
- Edit Button: Appears when a section is selected
- Slide-out Panels: Access section library and editor
src/
├── app/ # Next.js App Router
│ ├── layout.tsx # Root layout (SSR)
│ ├── page.tsx # Home page
│ └── globals.css # Global styles
├── components/
│ ├── builder/ # Main builder components
│ │ ├── BuilderLayout.tsx # Server component wrapper
│ │ ├── ClientBuilderLayout.tsx # Client-side logic
│ │ ├── Toolbar.tsx # Top toolbar
│ │ ├── SectionLibrary.tsx # Section templates
│ │ ├── PreviewArea.tsx # Live preview
│ │ └── SectionEditor.tsx # Property editor
│ ├── sections/ # Individual section types
│ │ ├── SectionRenderer.tsx # Section router
│ │ ├── HeaderSection.tsx # Header component
│ │ ├── HeroSection.tsx # Hero component
│ │ ├── ContentSection.tsx # Content component
│ │ ├── CTASection.tsx # Call-to-action component
│ │ └── FooterSection.tsx # Footer component
│ └── ui/ # Reusable UI components
│ └── Button.tsx # Button component
├── store/ # State management
│ └── builderStore.ts # Zustand store
├── types/ # TypeScript definitions
│ └── index.ts # Type definitions
├── data/ # Static data
│ └── sectionTemplates.ts # Section templates
├── lib/ # Utilities
│ ├── utils.ts # General utilities
│ └── generateId.ts # ID generation
├── hooks/ # Custom hooks
│ └── useInitializeStore.ts # Store initialization
└── __tests__/ # Test files
├── components/ # Component tests
└── store/ # Store tests
Run the test suite:
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm test -- --coveragenpm run dev- Start development servernpm run build- Build for productionnpm start- Start production servernpm run lint- Run ESLintnpm test- Run Jest testsnpm run test:watch- Run tests in watch mode
- Create the section component in
src/components/sections/ - Add the section type to
src/types/index.ts - Update the SectionRenderer to handle the new type
- Add a template to
src/data/sectionTemplates.ts
The project uses Tailwind CSS for styling. Customize:
- Colors: Update the Tailwind config or use CSS custom properties
- Animations: Modify
src/app/globals.cssfor custom animations - Responsive Breakpoints: Adjust Tailwind breakpoints as needed