Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bolt Community Edition #3304

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c2cb5cc
prompt revision
Rami9237 Nov 2, 2024
a4c2550
Use latest Anthropic Sonnet 3.5 model
elie222 Nov 14, 2024
87de744
Remove unnecessary convertToCoreMessages
elie222 Nov 14, 2024
99fc3c0
feat: add download to zip button
codewithtyler Nov 19, 2024
02656ce
made terminal collapsible
codewithtyler Nov 23, 2024
80575eb
Polished up the terminal header to look more professional
codewithtyler Nov 24, 2024
62aa2a7
Fixing Typo in System Prompt
fauzulkc Nov 24, 2024
cb20b6b
fix: fixed typos and optimized code
mnsdojo Nov 25, 2024
c04212f
added files needed for docker support
dustinwloring1988 Nov 27, 2024
9e06601
file size and image size reduced
dustinwloring1988 Nov 27, 2024
ceb6819
add an example env and rebranded the repo
dustinwloring1988 Nov 27, 2024
7fd6bf1
Merge pull request #4 from codewithtyler/feature/download
dustinwloring1988 Nov 27, 2024
cdf948b
Merge pull request #5 from elie222/patch-2
dustinwloring1988 Nov 27, 2024
8ca9ed0
Merge pull request #3 from codewithtyler/feature/collapsible-terminal
dustinwloring1988 Nov 27, 2024
92c982c
Merge pull request #2 from fauzulkc/patch-1
dustinwloring1988 Nov 27, 2024
768bef1
Merge pull request #7 from Bolt-CE/optimize-social-image
dustinwloring1988 Nov 27, 2024
8085a47
Merge pull request #8 from Bolt-CE/add-docker
dustinwloring1988 Nov 27, 2024
09b9a08
Merge pull request #6 from Rami9237/main
dustinwloring1988 Nov 27, 2024
971f944
Merge pull request #1 from mnsdojo/chore/fix-typos-and-improve-code
dustinwloring1988 Nov 27, 2024
1a14de5
Merge pull request #9 from Bolt-CE/rebrand
dustinwloring1988 Nov 27, 2024
92939c0
Create dependabot.yml
dustinwloring1988 Nov 27, 2024
cc9234a
chore(deps): bump react-toastify from 10.0.5 to 10.0.6
dependabot[bot] Nov 27, 2024
e9e1a84
chore(deps): bump date-fns from 3.6.0 to 4.1.0
dependabot[bot] Nov 27, 2024
2cf52c5
chore(deps-dev): bump wrangler from 3.63.2 to 3.64.0
dependabot[bot] Nov 27, 2024
792061e
Merge pull request #12 from elie222/patch-1
dustinwloring1988 Nov 27, 2024
69502bd
chore(deps): bump jose from 5.6.3 to 5.9.6
dependabot[bot] Nov 27, 2024
fc3ea72
chore(deps): bump isbot from 4.4.0 to 5.1.17
dependabot[bot] Nov 27, 2024
c0d3f78
Rename dockerignore to .dockerignore
dustinwloring1988 Nov 27, 2024
b3a45d7
Update README.md
dustinwloring1988 Nov 27, 2024
cb68aa4
Merge pull request #10 from Bolt-CE/dependabot/npm_and_yarn/react-toa…
dustinwloring1988 Nov 27, 2024
6398465
Merge pull request #11 from Bolt-CE/dependabot/npm_and_yarn/date-fns-…
dustinwloring1988 Nov 27, 2024
78b7f11
Merge pull request #14 from Bolt-CE/dependabot/npm_and_yarn/jose-5.9.6
dustinwloring1988 Nov 27, 2024
dddc7e8
Merge pull request #15 from Bolt-CE/dependabot/npm_and_yarn/isbot-5.1.17
dustinwloring1988 Nov 27, 2024
fa36568
Merge pull request #13 from Bolt-CE/dependabot/npm_and_yarn/wrangler-…
dustinwloring1988 Nov 27, 2024
7d1353f
chore(deps): bump the npm_and_yarn group with 9 updates
dependabot[bot] Nov 27, 2024
f7b1fb4
Merge pull request #16 from Bolt-CE/dependabot/npm_and_yarn/npm_and_y…
dustinwloring1988 Nov 27, 2024
f28fcc9
chore(deps-dev): bump vite in the npm_and_yarn group across 1 directory
dependabot[bot] Nov 27, 2024
531aac9
Merge pull request #17 from Bolt-CE/dependabot/npm_and_yarn/npm_and_y…
dustinwloring1988 Nov 27, 2024
68ea950
Update dependabot.yml
dustinwloring1988 Nov 27, 2024
cc55a56
Create codeql.yml
dustinwloring1988 Nov 27, 2024
474fa8b
Fix code scanning alert no. 1: DOM text reinterpreted as HTML
dustinwloring1988 Nov 27, 2024
dfd42ff
Merge pull request #18 from dustinwloring1988/alert-autofix-1
dustinwloring1988 Nov 27, 2024
5cc3489
Update README.md
dustinwloring1988 Nov 27, 2024
55dec71
Update and rename commit-msg to pre-commit
dustinwloring1988 Nov 27, 2024
8016998
Update package.json
dustinwloring1988 Nov 27, 2024
2ca4f9b
Update package.json
dustinwloring1988 Nov 27, 2024
da9eb08
Update package.json
dustinwloring1988 Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Ignore Git and GitHub files
.git
.github/

# Ignore Husky configuration files
.husky/

# Ignore documentation and metadata files
CONTRIBUTING.md
LICENSE
README.md

# Ignore environment examples and sensitive info
.env
*.local
*.example

# Ignore node modules, logs and cache files
**/*.log
**/node_modules
**/dist
**/build
**/.cache
logs
dist-ssr
.DS_Store
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "pnpm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
92 changes: 92 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '20 11 * * 4'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
7 changes: 0 additions & 7 deletions .husky/commit-msg

This file was deleted.

17 changes: 17 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

echo "🔍 Running pre-commit hook to check the code looks good... 🔍"

if ! pnpm typecheck; then
echo "❌ Type checking failed! Please review TypeScript types."
echo "Once you're done, don't forget to add your changes to the commit! 🚀"
exit 1
fi

if ! pnpm lint; then
echo "❌ Linting failed! 'pnpm lint:check' will help you fix the easy ones."
echo "Once you're done, don't forget to add your beautification to the commit! 🤩"
exit 1
fi

echo "👍 All good! Committing changes..."
46 changes: 46 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
ARG BASE=node:20.18.1-bookworm-slim
FROM ${BASE} AS base

WORKDIR /app

# Install dependencies (this step is cached as long as the dependencies don't change)
COPY package.json pnpm-lock.yaml ./

RUN corepack enable pnpm && pnpm install

# Copy the rest of your app's source code
COPY . .

# Expose the port the app runs on
EXPOSE 5173

# Production image
FROM base AS bolt-ai-production

# Define environment variables with default values or let them be overridden
ARG VITE_LOG_LEVEL=debug
ARG ANTHROPIC_API_KEY

ENV ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY} \
VITE_LOG_LEVEL=${VITE_LOG_LEVEL}

# Pre-configure wrangler to disable metrics
RUN mkdir -p /root/.config/.wrangler && \
echo '{"enabled":false}' > /root/.config/.wrangler/metrics.json

RUN npm run build

CMD [ "pnpm", "run", "dockerstart"]

# Development image
FROM base AS bolt-ai-development

# Define the same environment variables for development
ARG VITE_LOG_LEVEL=debug
ARG ANTHROPIC_API_KEY

ENV ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY} \
VITE_LOG_LEVEL=${VITE_LOG_LEVEL}

RUN mkdir -p ${WORKDIR}/run
CMD pnpm run dev --host
113 changes: 80 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,101 @@
[![Bolt.new: AI-Powered Full-Stack Web Development in the Browser](./public/social_preview_index.jpg)](https://bolt.new)
[![Bolt: AI-Powered Full-Stack Web Development in the Browser](./public/social_preview_index.jpg)](https://bolt.new)

# Bolt.new: AI-Powered Full-Stack Web Development in the Browser
# Bolt Community Edition

Bolt.new is an AI-powered web development agent that allows you to prompt, run, edit, and deploy full-stack applications directly from your browser—no local setup required. If you're here to build your own AI-powered web dev agent using the Bolt open source codebase, [click here to get started!](./CONTRIBUTING.md)
## Overview

## What Makes Bolt.new Different
**Bolt Community Edition** is a community-driven fork of the original Bolt repository, developed to provide more frequent updates and stronger community involvement. The original Bolt repository shifted focus towards a commercial edition, leading to the creation of this fork to maintain an open-source, actively developed alternative.

Claude, v0, etc are incredible- but you can't install packages, run backends or edit code. That’s where Bolt.new stands out:
This edition closely follows the commercial version while encouraging open contributions and innovation from the community.

- **Full-Stack in the Browser**: Bolt.new integrates cutting-edge AI models with an in-browser development environment powered by **StackBlitz’s WebContainers**. This allows you to:
- Install and run npm tools and libraries (like Vite, Next.js, and more)
- Run Node.js servers
- Interact with third-party APIs
- Deploy to production from chat
- Share your work via a URL
## Community

- **AI with Environment Control**: Unlike traditional dev environments where the AI can only assist in code generation, Bolt.new gives AI models **complete control** over the entire environment including the filesystem, node server, package manager, terminal, and browser console. This empowers AI agents to handle the entire app lifecycle—from creation to deployment.
Join the discussion and stay updated:
- **Discord**: [https://discord.gg/t9b6Npje](https://discord.gg/t9b6Npje)

Whether you’re an experienced developer, a PM or designer, Bolt.new allows you to build production-grade full-stack applications with ease.
## Getting Started

For developers interested in building their own AI-powered development tools with WebContainers, check out the open-source Bolt codebase in this repo!
### Prerequisites

## Tips and Tricks
- **Git**
- **Docker / Docker Compose** (optional)
- **Node.js / npm** (optional)
- **LLM API Key** (for `.env.local`)

### Installation Steps

1. **Clone the Repository**
Open a terminal or command prompt with admin permissions and run:
```bash
git clone https://github.com/Bolt-CE/bolt.git
```

2. **Setup Environment File**
Rename `env.example` to `.env.local` and add your LLM API key.

Here are some tips to get the most out of Bolt.new:
3. **Run Bolt**
Choose one of the following methods to run Bolt:

- **Be specific about your stack**: If you want to use specific frameworks or libraries (like Astro, Tailwind, ShadCN, or any other popular JavaScript framework), mention them in your initial prompt to ensure Bolt scaffolds the project accordingly.
#### 4a. Direct Docker Build Commands
Use Docker’s target feature to specify the environment:
```bash
# Development build
docker build . --target bolt-ai-development

# Production build
docker build . --target bolt-ai-production
```

- **Use the enhance prompt icon**: Before sending your prompt, try clicking the 'enhance' icon to have the AI model help you refine your prompt, then edit the results before submitting.
#### 4b. Docker Compose with Profiles
Run the container with Docker Compose profiles:
```bash
# Development environment
docker-compose --profile development up

# Production environment
docker-compose --profile production up
```

- **Scaffold the basics first, then add features**: Make sure the basic structure of your application is in place before diving into more advanced functionality. This helps Bolt understand the foundation of your project and ensure everything is wired up right before building out more advanced functionality.
**Note**: In development mode, changes to the code will be reflected live in the container (hot reloading).

- **Batch simple instructions**: Save time by combining simple instructions into one message. For example, you can ask Bolt to change the color scheme, add mobile responsiveness, and restart the dev server, all in one go saving you time and reducing API credit consumption significantly.
#### 4c. Using npm
```bash
npm i . && npm run dev
```

## FAQs
## AI-Powered Full-Stack Web Development in the Browser

**Where do I sign up for a paid plan?**
Bolt.new is free to get started. If you need more AI tokens or want private projects, you can purchase a paid subscription in your [Bolt.new](https://bolt.new) settings, in the lower-left hand corner of the application.
Bolt allows you to prompt, run, edit, and deploy full-stack applications directly from your browser—no local setup required.

**What happens if I hit the free usage limit?**
Once your free daily token limit is reached, AI interactions are paused until the next day or until you upgrade your plan.
### Key Features:
- **Full-Stack in the Browser**: Powered by StackBlitz’s WebContainers, you can:
- Install and run npm tools (like Vite, Next.js)
- Run Node.js servers
- Interact with third-party APIs
- Deploy directly from chat
- Share your projects via a URL

- **AI with Environment Control**: Unlike traditional AI code assistants, Bolt provides full control over:
- Filesystem
- Node server
- Package manager
- Terminal and browser console

**Is Bolt in beta?**
Yes, Bolt.new is in beta, and we are actively improving it based on feedback.
This enables Bolt to handle the entire app lifecycle—from creation to deployment.

### What Makes Bolt Different?
Unlike other AI tools (e.g., Claude, v0), Bolt empowers you to:
- Install packages
- Run backend servers
- Edit code within a full-stack environment

## Tips and Tricks

**How can I report Bolt.new issues?**
Check out the [Issues section](https://github.com/stackblitz/bolt.new/issues) to report an issue or request a new feature. Please use the search feature to check if someone else has already submitted the same issue/request.
- **Be Specific About Your Stack**: Mention frameworks (e.g., Astro, Tailwind) in your initial prompt for optimal scaffolding.
- **Enhance Prompts**: Use the 'enhance' icon to refine your prompt before submitting.
- **Scaffold Basics First**: Establish the basic structure before adding advanced features.
- **Batch Simple Instructions**: Combine tasks in one prompt to save time and reduce API usage.

**What frameworks/libraries currently work on Bolt?**
Bolt.new supports most popular JavaScript frameworks and libraries. If it runs on StackBlitz, it will run on Bolt.new as well.
---

**How can I add make sure my framework/project works well in bolt?**
We are excited to work with the JavaScript ecosystem to improve functionality in Bolt. Reach out to us via [[email protected]](mailto:[email protected]) to discuss how we can partner!
Bolt Community Edition is designed for developers, PMs, and designers to build production-grade full-stack applications with ease. Explore the [open-source repository](https://github.com/Bolt-CE/bolt) and join the community today!
16 changes: 8 additions & 8 deletions app/components/chat/Artifact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface ArtifactProps {

export const Artifact = memo(({ messageId }: ArtifactProps) => {
const userToggledActions = useRef(false);
const [showActions, setShowActions] = useState(false);
const [showActions, setShowActions] = useState<boolean>(false);

const artifacts = useStore(workbenchStore.artifacts);
const artifact = artifacts[messageId];
Expand All @@ -43,10 +43,10 @@ export const Artifact = memo(({ messageId }: ArtifactProps) => {
};

useEffect(() => {
if (actions.length && !showActions && !userToggledActions.current) {
if (actions.length > 0 && !showActions && !userToggledActions.current) {
setShowActions(true);
}
}, [actions]);
}, [actions, showActions]);

return (
<div className="artifact border border-bolt-elements-borderColor flex flex-col overflow-hidden rounded-lg w-full transition-border duration-150">
Expand All @@ -60,7 +60,7 @@ export const Artifact = memo(({ messageId }: ArtifactProps) => {
>
<div className="px-5 p-3.5 w-full text-left">
<div className="w-full text-bolt-elements-textPrimary font-medium leading-5 text-sm">{artifact?.title}</div>
<div className="w-full w-full text-bolt-elements-textSecondary text-xs mt-0.5">Click to open Workbench</div>
<div className=" w-full text-bolt-elements-textSecondary text-xs mt-0.5">Click to open Workbench</div>
</div>
</button>
<div className="bg-bolt-elements-artifacts-borderColor w-[1px]" />
Expand Down Expand Up @@ -102,14 +102,14 @@ export const Artifact = memo(({ messageId }: ArtifactProps) => {
});

interface ShellCodeBlockProps {
classsName?: string;
className?: string;
code: string;
}

function ShellCodeBlock({ classsName, code }: ShellCodeBlockProps) {
function ShellCodeBlock({ className, code }: ShellCodeBlockProps) {
return (
<div
className={classNames('text-xs', classsName)}
className={classNames('text-xs', className)}
dangerouslySetInnerHTML={{
__html: shellHighlighter.codeToHtml(code, {
lang: 'shell',
Expand Down Expand Up @@ -175,7 +175,7 @@ const ActionList = memo(({ actions }: ActionListProps) => {
</div>
{type === 'shell' && (
<ShellCodeBlock
classsName={classNames('mt-1', {
className={classNames('mt-1', {
'mb-3.5': !isLast,
})}
code={content}
Expand Down
Loading
Loading