bolt.new/README.md

78 lines
1.9 KiB
Markdown
Raw Normal View History

2024-09-25 18:54:09 +00:00
# Bolt
2024-07-10 16:44:39 +00:00
2024-09-25 18:54:09 +00:00
Bolt is an AI assistant developed by StackBlitz. This package contains the UI interface for Bolt as well as the server components, built using [Remix Run](https://remix.run/).
2024-07-10 16:44:39 +00:00
2024-09-25 18:54:09 +00:00
## Prerequisites
2024-07-10 16:44:39 +00:00
2024-09-25 18:54:09 +00:00
Before you begin, ensure you have the following installed:
2024-07-10 16:44:39 +00:00
2024-07-11 19:25:19 +00:00
- Node.js (v20.15.1)
2024-07-10 16:44:39 +00:00
- pnpm (v9.4.0)
2024-09-25 18:54:09 +00:00
## Setup
2024-07-10 16:44:39 +00:00
2024-09-25 18:54:09 +00:00
1. Clone the repository (if you haven't already):
2024-07-10 16:44:39 +00:00
```bash
2024-09-30 16:20:55 +00:00
git clone https://github.com/stackblitz/bolt.new.git
2024-07-10 16:44:39 +00:00
```
2. Install dependencies:
```bash
2024-09-25 18:54:09 +00:00
pnpm install
```
3. Create a `.env.local` file in the root directory and add your Anthropic API key:
```
ANTHROPIC_API_KEY=XXX
```
2024-09-26 16:45:41 +00:00
Optionally, you an set the debug level:
2024-09-25 18:54:09 +00:00
```
VITE_LOG_LEVEL=debug
```
**Important**: Never commit your `.env.local` file to version control. It's already included in .gitignore.
## Available Scripts
- `pnpm run dev`: Starts the development server.
- `pnpm run build`: Builds the project.
- `pnpm run start`: Runs the built application locally using Wrangler Pages. This script uses `bindings.sh` to set up necessary bindings so you don't have to duplicate environment variables.
- `pnpm run preview`: Builds the project and then starts it locally, useful for testing the production build. Note, HTTP streaming currently doesn't work as expected with `wrangler pages dev`.
- `pnpm test:` Runs the test suite using Vitest.
- `pnpm run typecheck`: Runs TypeScript type checking.
- `pnpm run typegen`: Generates TypeScript types using Wrangler.
- `pnpm run deploy`: Builds the project and deploys it to Cloudflare Pages.
## Development
To start the development server:
2024-07-29 18:31:45 +00:00
```bash
2024-09-25 18:54:09 +00:00
pnpm run dev
2024-07-29 18:31:45 +00:00
```
2024-09-25 18:54:09 +00:00
This will start the Remix Vite development server.
2024-07-10 16:44:39 +00:00
2024-09-25 18:54:09 +00:00
## Testing
2024-07-10 16:44:39 +00:00
2024-09-25 18:54:09 +00:00
Run the test suite with:
2024-07-10 16:44:39 +00:00
```bash
2024-09-25 18:54:09 +00:00
pnpm test
2024-07-10 16:44:39 +00:00
```
2024-09-25 18:54:09 +00:00
## Deployment
To deploy the application to Cloudflare Pages:
2024-07-10 16:44:39 +00:00
```bash
2024-09-25 18:54:09 +00:00
pnpm run deploy
2024-07-10 16:44:39 +00:00
```
2024-09-25 18:54:09 +00:00
Make sure you have the necessary permissions and Wrangler is correctly configured for your Cloudflare account.