A Next.js-based website builder that allows you to create and manage pages with a block-based editor and embed AI-powered chatbots.
- Block-Based Editor: Create pages using text, image, video, embed, and chatbot blocks
- Advanced Mode: Toggle between block-based editing and raw HTML/CSS with Tailwind support
- Chatbot Integration: Embed AI-powered chatbots that are aware of page content
- SEO Management: Automatically generate SEO metadata for your pages
- Search Functionality: Find pages based on content and titles
- Simple Deployment: Deploy your site with a single click
- Node.js 14.x or higher
- npm or yarn
-
Clone the repository:
git clone https://github.com/yourusername/selfhosted-builder.git cd selfhosted-builder -
Install dependencies:
npm install # or yarn install -
Set up environment variables: Create a
.env.localfile in the root directory with the following content:NEXT_PUBLIC_OPENAI_API_KEY=your_openai_api_key -
Start the development server:
npm run dev # or yarn dev -
Open http://localhost:3000 in your browser to see the application.
To use the chatbot functionality, you need an OpenAI API key:
- Sign up for an account at OpenAI
- Generate an API key in your account dashboard
- Add the key to your
.env.localfile as shown above - Restart the development server
The chatbot uses the GPT model to generate responses. You can modify the model and parameters in pages/api/chatbot.ts.
To build the application locally:
npm run build
# or
yarn buildThen start the production server:
npm run start
# or
yarn startThe easiest way to deploy your Next.js app is to use Vercel:
- Sign up for a Vercel account
- Install the Vercel CLI:
npm install -g vercel
- Run the deployment command:
vercel
- Follow the prompts to complete deployment
- Don't forget to add your OpenAI API key to the environment variables in the Vercel dashboard
You can also deploy to Netlify:
- Sign up for a Netlify account
- Install the Netlify CLI:
npm install -g netlify-cli
- Build your application:
npm run build # or yarn build - Deploy to Netlify:
netlify deploy
- Add your OpenAI API key to the environment variables in the Netlify dashboard
/pages: Next.js pages and API routes/components: React components including blocks and chatbot/utils: Utility functions for SEO and other features/styles: CSS and styling/__tests__: Test files
# Run all tests
npm test
# or
yarn test
# Run tests in watch mode
npm run test:watch
# or
yarn test:watchYou can add or modify block types in components/types.ts and create corresponding components in components/blocks/.
The application uses basic CSS. You can add Tailwind CSS or other styling libraries as needed.
For advanced configuration, refer to the Next.js documentation.
This project is licensed under the MIT License - see the LICENSE file for details.