added cloudflare support in readme

This commit is contained in:
BurhanCantCode 2025-02-05 18:55:21 +05:00
parent 670bcb7b3f
commit f01721f251

733
README.md
View File

@ -1,352 +1,381 @@
# bolt.diy (Previously oTToDev) # bolt.diy (Previously oTToDev)
[![bolt.diy: AI-Powered Full-Stack Web Development in the Browser](./public/social_preview_index.jpg)](https://bolt.diy) [![bolt.diy: AI-Powered Full-Stack Web Development in the Browser](./public/social_preview_index.jpg)](https://bolt.diy)
Welcome to bolt.diy, the official open source version of Bolt.new (previously known as oTToDev and bolt.new ANY LLM), which allows you to choose the LLM that you use for each prompt! Currently, you can use OpenAI, Anthropic, Ollama, OpenRouter, Gemini, LMStudio, Mistral, xAI, HuggingFace, DeepSeek, or Groq models - and it is easily extended to use any other model supported by the Vercel AI SDK! See the instructions below for running this locally and extending it to include more models. Welcome to bolt.diy, the official open source version of Bolt.new (previously known as oTToDev and bolt.new ANY LLM), which allows you to choose the LLM that you use for each prompt! Currently, you can use OpenAI, Anthropic, Ollama, OpenRouter, Gemini, LMStudio, Mistral, xAI, HuggingFace, DeepSeek, or Groq models - and it is easily extended to use any other model supported by the Vercel AI SDK! See the instructions below for running this locally and extending it to include more models.
----- -----
Check the [bolt.diy Docs](https://stackblitz-labs.github.io/bolt.diy/) for more offical installation instructions and more informations. Check the [bolt.diy Docs](https://stackblitz-labs.github.io/bolt.diy/) for more offical installation instructions and more informations.
----- -----
Also [this pinned post in our community](https://thinktank.ottomator.ai/t/videos-tutorial-helpful-content/3243) has a bunch of incredible resources for running and deploying bolt.diy yourself! Also [this pinned post in our community](https://thinktank.ottomator.ai/t/videos-tutorial-helpful-content/3243) has a bunch of incredible resources for running and deploying bolt.diy yourself!
We have also launched an experimental agent called the "bolt.diy Expert" that can answer common questions about bolt.diy. Find it here on the [oTTomator Live Agent Studio](https://studio.ottomator.ai/). We have also launched an experimental agent called the "bolt.diy Expert" that can answer common questions about bolt.diy. Find it here on the [oTTomator Live Agent Studio](https://studio.ottomator.ai/).
bolt.diy was originally started by [Cole Medin](https://www.youtube.com/@ColeMedin) but has quickly grown into a massive community effort to build the BEST open source AI coding assistant! bolt.diy was originally started by [Cole Medin](https://www.youtube.com/@ColeMedin) but has quickly grown into a massive community effort to build the BEST open source AI coding assistant!
## Table of Contents ## Table of Contents
- [Join the Community](#join-the-community) - [Join the Community](#join-the-community)
- [Requested Additions](#requested-additions) - [Requested Additions](#requested-additions)
- [Features](#features) - [Features](#features)
- [Setup](#setup) - [Setup](#setup)
- [Run the Application](#run-the-application) - [Run the Application](#run-the-application)
- [Available Scripts](#available-scripts) - [Available Scripts](#available-scripts)
- [Contributing](#contributing) - [Contributing](#contributing)
- [Roadmap](#roadmap) - [Roadmap](#roadmap)
- [FAQ](#faq) - [FAQ](#faq)
## Join the community ## Join the community
[Join the bolt.diy community here, in the oTTomator Think Tank!](https://thinktank.ottomator.ai) [Join the bolt.diy community here, in the oTTomator Think Tank!](https://thinktank.ottomator.ai)
## Project management ## Project management
Bolt.diy is a community effort! Still, the core team of contributors aims at organizing the project in way that allows Bolt.diy is a community effort! Still, the core team of contributors aims at organizing the project in way that allows
you to understand where the current areas of focus are. you to understand where the current areas of focus are.
If you want to know what we are working on, what we are planning to work on, or if you want to contribute to the If you want to know what we are working on, what we are planning to work on, or if you want to contribute to the
project, please check the [project management guide](./PROJECT.md) to get started easily. project, please check the [project management guide](./PROJECT.md) to get started easily.
## Requested Additions ## Requested Additions
- ✅ OpenRouter Integration (@coleam00) - ✅ OpenRouter Integration (@coleam00)
- ✅ Gemini Integration (@jonathands) - ✅ Gemini Integration (@jonathands)
- ✅ Autogenerate Ollama models from what is downloaded (@yunatamos) - ✅ Autogenerate Ollama models from what is downloaded (@yunatamos)
- ✅ Filter models by provider (@jasonm23) - ✅ Filter models by provider (@jasonm23)
- ✅ Download project as ZIP (@fabwaseem) - ✅ Download project as ZIP (@fabwaseem)
- ✅ Improvements to the main bolt.new prompt in `app\lib\.server\llm\prompts.ts` (@kofi-bhr) - ✅ Improvements to the main bolt.new prompt in `app\lib\.server\llm\prompts.ts` (@kofi-bhr)
- ✅ DeepSeek API Integration (@zenith110) - ✅ DeepSeek API Integration (@zenith110)
- ✅ Mistral API Integration (@ArulGandhi) - ✅ Mistral API Integration (@ArulGandhi)
- ✅ "Open AI Like" API Integration (@ZerxZ) - ✅ "Open AI Like" API Integration (@ZerxZ)
- ✅ Ability to sync files (one way sync) to local folder (@muzafferkadir) - ✅ Ability to sync files (one way sync) to local folder (@muzafferkadir)
- ✅ Containerize the application with Docker for easy installation (@aaronbolton) - ✅ Containerize the application with Docker for easy installation (@aaronbolton)
- ✅ Publish projects directly to GitHub (@goncaloalves) - ✅ Publish projects directly to GitHub (@goncaloalves)
- ✅ Ability to enter API keys in the UI (@ali00209) - ✅ Ability to enter API keys in the UI (@ali00209)
- ✅ xAI Grok Beta Integration (@milutinke) - ✅ xAI Grok Beta Integration (@milutinke)
- ✅ LM Studio Integration (@karrot0) - ✅ LM Studio Integration (@karrot0)
- ✅ HuggingFace Integration (@ahsan3219) - ✅ HuggingFace Integration (@ahsan3219)
- ✅ Bolt terminal to see the output of LLM run commands (@thecodacus) - ✅ Bolt terminal to see the output of LLM run commands (@thecodacus)
- ✅ Streaming of code output (@thecodacus) - ✅ Streaming of code output (@thecodacus)
- ✅ Ability to revert code to earlier version (@wonderwhy-er) - ✅ Ability to revert code to earlier version (@wonderwhy-er)
- ✅ Chat history backup and restore functionality (@sidbetatester) - ✅ Chat history backup and restore functionality (@sidbetatester)
- ✅ Cohere Integration (@hasanraiyan) - ✅ Cohere Integration (@hasanraiyan)
- ✅ Dynamic model max token length (@hasanraiyan) - ✅ Dynamic model max token length (@hasanraiyan)
- ✅ Better prompt enhancing (@SujalXplores) - ✅ Better prompt enhancing (@SujalXplores)
- ✅ Prompt caching (@SujalXplores) - ✅ Prompt caching (@SujalXplores)
- ✅ Load local projects into the app (@wonderwhy-er) - ✅ Load local projects into the app (@wonderwhy-er)
- ✅ Together Integration (@mouimet-infinisoft) - ✅ Together Integration (@mouimet-infinisoft)
- ✅ Mobile friendly (@qwikode) - ✅ Mobile friendly (@qwikode)
- ✅ Better prompt enhancing (@SujalXplores) - ✅ Better prompt enhancing (@SujalXplores)
- ✅ Attach images to prompts (@atrokhym)(@stijnus) - ✅ Attach images to prompts (@atrokhym)(@stijnus)
- ✅ Added Git Clone button (@thecodacus) - ✅ Added Git Clone button (@thecodacus)
- ✅ Git Import from url (@thecodacus) - ✅ Git Import from url (@thecodacus)
- ✅ PromptLibrary to have different variations of prompts for different use cases (@thecodacus) - ✅ PromptLibrary to have different variations of prompts for different use cases (@thecodacus)
- ✅ Detect package.json and commands to auto install & run preview for folder and git import (@wonderwhy-er) - ✅ Detect package.json and commands to auto install & run preview for folder and git import (@wonderwhy-er)
- ✅ Selection tool to target changes visually (@emcconnell) - ✅ Selection tool to target changes visually (@emcconnell)
- ✅ Detect terminal Errors and ask bolt to fix it (@thecodacus) - ✅ Detect terminal Errors and ask bolt to fix it (@thecodacus)
- ✅ Detect preview Errors and ask bolt to fix it (@wonderwhy-er) - ✅ Detect preview Errors and ask bolt to fix it (@wonderwhy-er)
- ✅ Add Starter Template Options (@thecodacus) - ✅ Add Starter Template Options (@thecodacus)
- ✅ Perplexity Integration (@meetpateltech) - ✅ Perplexity Integration (@meetpateltech)
- ✅ AWS Bedrock Integration (@kunjabijukchhe) - ✅ AWS Bedrock Integration (@kunjabijukchhe)
- ⬜ **HIGH PRIORITY** - Prevent bolt from rewriting files as often (file locking and diffs) - ⬜ **HIGH PRIORITY** - Prevent bolt from rewriting files as often (file locking and diffs)
- ⬜ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start) - ⬜ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start)
- ⬜ **HIGH PRIORITY** - Run agents in the backend as opposed to a single model call - ⬜ **HIGH PRIORITY** - Run agents in the backend as opposed to a single model call
- ⬜ Deploy directly to Vercel/Netlify/other similar platforms - ⬜ Deploy directly to Vercel/Netlify/other similar platforms
- ⬜ Have LLM plan the project in a MD file for better results/transparency - ⬜ Have LLM plan the project in a MD file for better results/transparency
- ⬜ VSCode Integration with git-like confirmations - ⬜ VSCode Integration with git-like confirmations
- ⬜ Upload documents for knowledge - UI design templates, a code base to reference coding style, etc. - ⬜ Upload documents for knowledge - UI design templates, a code base to reference coding style, etc.
- ⬜ Voice prompting - ⬜ Voice prompting
- ⬜ Azure Open AI API Integration - ⬜ Azure Open AI API Integration
- ⬜ Vertex AI Integration - ⬜ Vertex AI Integration
- ⬜ Granite Integration - ⬜ Granite Integration
- ✅ Popout Window for Web Container(@stijnus) - ✅ Popout Window for Web Container(@stijnus)
- ✅ Ability to change Popout window size (@stijnus) - ✅ Ability to change Popout window size (@stijnus)
## Features ## Features
- **AI-powered full-stack web development** for **NodeJS based applications** directly in your browser. - **AI-powered full-stack web development** for **NodeJS based applications** directly in your browser.
- **Support for multiple LLMs** with an extensible architecture to integrate additional models. - **Support for multiple LLMs** with an extensible architecture to integrate additional models.
- **Attach images to prompts** for better contextual understanding. - **Attach images to prompts** for better contextual understanding.
- **Integrated terminal** to view output of LLM-run commands. - **Integrated terminal** to view output of LLM-run commands.
- **Revert code to earlier versions** for easier debugging and quicker changes. - **Revert code to earlier versions** for easier debugging and quicker changes.
- **Download projects as ZIP** for easy portability. - **Download projects as ZIP** for easy portability.
- **Integration-ready Docker support** for a hassle-free setup. - **Integration-ready Docker support** for a hassle-free setup.
## Setup ## Setup
If you're new to installing software from GitHub, don't worry! If you encounter any issues, feel free to submit an "issue" using the provided links or improve this documentation by forking the repository, editing the instructions, and submitting a pull request. The following instruction will help you get the stable branch up and running on your local machine in no time. If you're new to installing software from GitHub, don't worry! If you encounter any issues, feel free to submit an "issue" using the provided links or improve this documentation by forking the repository, editing the instructions, and submitting a pull request. The following instruction will help you get the stable branch up and running on your local machine in no time.
Let's get you up and running with the stable version of Bolt.DIY! Let's get you up and running with the stable version of Bolt.DIY!
## Quick Download ## Quick Download
[![Download Latest Release](https://img.shields.io/github/v/release/stackblitz-labs/bolt.diy?label=Download%20Bolt&sort=semver)](https://github.com/stackblitz-labs/bolt.diy/releases/latest) ← Click here to go the the latest release version! [![Download Latest Release](https://img.shields.io/github/v/release/stackblitz-labs/bolt.diy?label=Download%20Bolt&sort=semver)](https://github.com/stackblitz-labs/bolt.diy/releases/latest) ← Click here to go the the latest release version!
- Next **click source.zip** - Next **click source.zip**
## Prerequisites ## Prerequisites
Before you begin, you'll need to install two important pieces of software: Before you begin, you'll need to install two important pieces of software:
### Install Node.js ### Install Node.js
Node.js is required to run the application. Node.js is required to run the application.
1. Visit the [Node.js Download Page](https://nodejs.org/en/download/) 1. Visit the [Node.js Download Page](https://nodejs.org/en/download/)
2. Download the "LTS" (Long Term Support) version for your operating system 2. Download the "LTS" (Long Term Support) version for your operating system
3. Run the installer, accepting the default settings 3. Run the installer, accepting the default settings
4. Verify Node.js is properly installed: 4. Verify Node.js is properly installed:
- **For Windows Users**: - **For Windows Users**:
1. Press `Windows + R` 1. Press `Windows + R`
2. Type "sysdm.cpl" and press Enter 2. Type "sysdm.cpl" and press Enter
3. Go to "Advanced" tab → "Environment Variables" 3. Go to "Advanced" tab → "Environment Variables"
4. Check if `Node.js` appears in the "Path" variable 4. Check if `Node.js` appears in the "Path" variable
- **For Mac/Linux Users**: - **For Mac/Linux Users**:
1. Open Terminal 1. Open Terminal
2. Type this command: 2. Type this command:
```bash ```bash
echo $PATH echo $PATH
``` ```
3. Look for `/usr/local/bin` in the output 3. Look for `/usr/local/bin` in the output
## Running the Application ## Running the Application
You have two options for running Bolt.DIY: directly on your machine or using Docker. You have two options for running Bolt.DIY: directly on your machine or using Docker.
### Option 1: Direct Installation (Recommended for Beginners) ### Option 1: Direct Installation (Recommended for Beginners)
1. **Install Package Manager (pnpm)**: 1. **Install Package Manager (pnpm)**:
```bash ```bash
npm install -g pnpm npm install -g pnpm
``` ```
2. **Install Project Dependencies**: 2. **Install Project Dependencies**:
```bash ```bash
pnpm install pnpm install
``` ```
3. **Start the Application**: 3. **Start the Application**:
```bash ```bash
pnpm run dev pnpm run dev
``` ```
**Important Note**: If you're using Google Chrome, you'll need Chrome Canary for local development. [Download it here](https://www.google.com/chrome/canary/) **Important Note**: If you're using Google Chrome, you'll need Chrome Canary for local development. [Download it here](https://www.google.com/chrome/canary/)
### Option 2: Using Docker ### Option 2: Using Docker
This option requires some familiarity with Docker but provides a more isolated environment. This option requires some familiarity with Docker but provides a more isolated environment.
#### Additional Prerequisite #### Additional Prerequisite
- Install Docker: [Download Docker](https://www.docker.com/) - Install Docker: [Download Docker](https://www.docker.com/)
#### Steps: #### Steps:
1. **Build the Docker Image**: 1. **Build the Docker Image**:
```bash ```bash
# Using npm script: # Using npm script:
npm run dockerbuild npm run dockerbuild
# OR using direct Docker command: # OR using direct Docker command:
docker build . --target bolt-ai-development docker build . --target bolt-ai-development
``` ```
2. **Run the Container**: 2. **Run the Container**:
```bash ```bash
docker compose --profile development up docker compose --profile development up
``` ```
## Configuring API Keys and Providers ## Configuring API Keys and Providers
### Adding Your API Keys ### Adding Your API Keys
Setting up your API keys in Bolt.DIY is straightforward: Setting up your API keys in Bolt.DIY is straightforward:
1. Open the home page (main interface) 1. Open the home page (main interface)
2. Select your desired provider from the dropdown menu 2. Select your desired provider from the dropdown menu
3. Click the pencil (edit) icon 3. Click the pencil (edit) icon
4. Enter your API key in the secure input field 4. Enter your API key in the secure input field
![API Key Configuration Interface](./docs/images/api-key-ui-section.png) ![API Key Configuration Interface](./docs/images/api-key-ui-section.png)
### Configuring Custom Base URLs ### Configuring Custom Base URLs
For providers that support custom base URLs (such as Ollama or LM Studio), follow these steps: For providers that support custom base URLs (such as Ollama or LM Studio), follow these steps:
1. Click the settings icon in the sidebar to open the settings menu 1. Click the settings icon in the sidebar to open the settings menu
![Settings Button Location](./docs/images/bolt-settings-button.png) ![Settings Button Location](./docs/images/bolt-settings-button.png)
2. Navigate to the "Providers" tab 2. Navigate to the "Providers" tab
3. Search for your provider using the search bar 3. Search for your provider using the search bar
4. Enter your custom base URL in the designated field 4. Enter your custom base URL in the designated field
![Provider Base URL Configuration](./docs/images/provider-base-url.png) ![Provider Base URL Configuration](./docs/images/provider-base-url.png)
> **Note**: Custom base URLs are particularly useful when running local instances of AI models or using custom API endpoints. > **Note**: Custom base URLs are particularly useful when running local instances of AI models or using custom API endpoints.
### Supported Providers ### Supported Providers
- Ollama - Ollama
- LM Studio - LM Studio
- OpenAILike - OpenAILike
## Setup Using Git (For Developers only) ## Setup Using Git (For Developers only)
This method is recommended for developers who want to: This method is recommended for developers who want to:
- Contribute to the project - Contribute to the project
- Stay updated with the latest changes - Stay updated with the latest changes
- Switch between different versions - Switch between different versions
- Create custom modifications - Create custom modifications
#### Prerequisites #### Prerequisites
1. Install Git: [Download Git](https://git-scm.com/downloads) 1. Install Git: [Download Git](https://git-scm.com/downloads)
#### Initial Setup #### Initial Setup
1. **Clone the Repository**: 1. **Clone the Repository**:
```bash ```bash
# Using HTTPS # Using HTTPS
git clone https://github.com/stackblitz-labs/bolt.diy.git git clone https://github.com/stackblitz-labs/bolt.diy.git
``` ```
2. **Navigate to Project Directory**: 2. **Navigate to Project Directory**:
```bash ```bash
cd bolt.diy cd bolt.diy
``` ```
3. **Switch to the Main Branch**: 3. **Switch to the Main Branch**:
```bash ```bash
git checkout main git checkout main
``` ```
4. **Install Dependencies**: 4. **Install Dependencies**:
```bash ```bash
pnpm install pnpm install
``` ```
5. **Start the Development Server**: 5. **Start the Development Server**:
```bash ```bash
pnpm run dev pnpm run dev
``` ```
#### Staying Updated #### Staying Updated
To get the latest changes from the repository: To get the latest changes from the repository:
1. **Save Your Local Changes** (if any): 1. **Save Your Local Changes** (if any):
```bash ```bash
git stash git stash
``` ```
2. **Pull Latest Updates**: 2. **Pull Latest Updates**:
```bash ```bash
git pull origin main git pull origin main
``` ```
3. **Update Dependencies**: 3. **Update Dependencies**:
```bash ```bash
pnpm install pnpm install
``` ```
4. **Restore Your Local Changes** (if any): 4. **Restore Your Local Changes** (if any):
```bash ```bash
git stash pop git stash pop
``` ```
#### Troubleshooting Git Setup #### Troubleshooting Git Setup
If you encounter issues: If you encounter issues:
1. **Clean Installation**: 1. **Clean Installation**:
```bash ```bash
# Remove node modules and lock files # Remove node modules and lock files
rm -rf node_modules pnpm-lock.yaml rm -rf node_modules pnpm-lock.yaml
# Clear pnpm cache # Clear pnpm cache
pnpm store prune pnpm store prune
# Reinstall dependencies # Reinstall dependencies
pnpm install pnpm install
``` ```
2. **Reset Local Changes**: 2. **Reset Local Changes**:
```bash ```bash
# Discard all local changes # Discard all local changes
git reset --hard origin/main git reset --hard origin/main
``` ```
Remember to always commit your local changes or stash them before pulling updates to avoid conflicts. Remember to always commit your local changes or stash them before pulling updates to avoid conflicts.
--- ---
## Available Scripts ## Available Scripts
- **`pnpm run dev`**: Starts the development server. - **`pnpm run dev`**: Starts the development server.
- **`pnpm run build`**: Builds the project. - **`pnpm run build`**: Builds the project.
- **`pnpm run start`**: Runs the built application locally using Wrangler Pages. - **`pnpm run start`**: Runs the built application locally using Wrangler Pages.
- **`pnpm run preview`**: Builds and runs the production build locally. - **`pnpm run preview`**: Builds and runs the production build locally.
- **`pnpm test`**: Runs the test suite using Vitest. - **`pnpm test`**: Runs the test suite using Vitest.
- **`pnpm run typecheck`**: Runs TypeScript type checking. - **`pnpm run typecheck`**: Runs TypeScript type checking.
- **`pnpm run typegen`**: Generates TypeScript types using Wrangler. - **`pnpm run typegen`**: Generates TypeScript types using Wrangler.
- **`pnpm run deploy`**: Deploys the project to Cloudflare Pages. - **`pnpm run deploy`**: Deploys the project to Cloudflare Pages.
- **`pnpm run lint:fix`**: Automatically fixes linting issues. - **`pnpm run lint:fix`**: Automatically fixes linting issues.
--- ## Deployment
## Contributing ### Deploying to Cloudflare Pages
We welcome contributions! Check out our [Contributing Guide](CONTRIBUTING.md) to get started. 1. **Login to Cloudflare** (if you haven't already):
```bash
--- wrangler login
```
## Roadmap
2. **Install Dependencies**:
Explore upcoming features and priorities on our [Roadmap](https://roadmap.sh/r/ottodev-roadmap-2ovzo). ```bash
pnpm install
--- ```
## FAQ 3. **Build and Deploy**:
```bash
For answers to common questions, issues, and to see a list of recommended models, visit our [FAQ Page](FAQ.md). pnpm run deploy
```
This command will build the project and deploy it to Cloudflare Pages.
4. **Configure API Keys**:
After deployment, you'll need to configure your API keys through the Bolt interface:
1. Open your deployed site
2. Select your desired provider from the dropdown menu
3. Click the pencil (edit) icon
4. Enter your API key in the secure input field
Note: The deployment process uses Wrangler, Cloudflare's official deployment tool. Make sure you have the necessary Cloudflare permissions before deploying.
---
## Contributing
We welcome contributions! Check out our [Contributing Guide](CONTRIBUTING.md) to get started.
---
## Roadmap
Explore upcoming features and priorities on our [Roadmap](https://roadmap.sh/r/ottodev-roadmap-2ovzo).
---
## FAQ
For answers to common questions, issues, and to see a list of recommended models, visit our [FAQ Page](FAQ.md).