File size: 5,470 Bytes
2e1ab99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# Contribution Guidelines

Welcome! This guide provides all the details you need to contribute effectively to the project. Thank you for helping us make **bolt.diy** a better tool for developers worldwide. πŸ’‘

---

## πŸ“‹ Table of Contents

1. [Code of Conduct](#code-of-conduct)  
2. [How Can I Contribute?](#how-can-i-contribute)  
3. [Pull Request Guidelines](#pull-request-guidelines)  
4. [Coding Standards](#coding-standards)  
5. [Development Setup](#development-setup)  
6. [Testing](#testing)  
7. [Deployment](#deployment)  
8. [Docker Deployment](#docker-deployment)  
9. [VS Code Dev Containers Integration](#vs-code-dev-containers-integration)  

---

## πŸ›‘οΈ Code of Conduct

This project is governed by our **Code of Conduct**. By participating, you agree to uphold this code. Report unacceptable behavior to the project maintainers.

---

## πŸ› οΈ How Can I Contribute?

### 1️⃣ Reporting Bugs or Feature Requests
- Check the [issue tracker](#) to avoid duplicates.
- Use issue templates (if available).  
- Provide detailed, relevant information and steps to reproduce bugs.

### 2️⃣ Code Contributions
1. Fork the repository.  
2. Create a feature or fix branch.  
3. Write and test your code.  
4. Submit a pull request (PR).

### 3️⃣ Join as a Core Contributor  
Interested in maintaining and growing the project? Fill out our [Contributor Application Form](https://forms.gle/TBSteXSDCtBDwr5m7).

---

## βœ… Pull Request Guidelines

### PR Checklist  
- Branch from the **main** branch.  
- Update documentation, if needed.  
- Test all functionality manually.  
- Focus on one feature/bug per PR.  

### Review Process  
1. Manual testing by reviewers.  
2. At least one maintainer review required.  
3. Address review comments.  
4. Maintain a clean commit history.

---

## πŸ“ Coding Standards

### General Guidelines  
- Follow existing code style.  
- Comment complex logic.  
- Keep functions small and focused.  
- Use meaningful variable names.

---

## πŸ–₯️ Development Setup

### 1️⃣ Initial Setup  
- Clone the repository:  
  ```bash

  git clone https://github.com/stackblitz-labs/bolt.diy.git

  ```
- Install dependencies:  
  ```bash

  pnpm install

  ```
- Set up environment variables:  
  1. Rename `.env.example` to `.env.local`.  
  2. Add your API keys:
     ```bash

     GROQ_API_KEY=XXX

     HuggingFace_API_KEY=XXX

     OPENAI_API_KEY=XXX

     ...

     ```

  3. Optionally set:  

     - Debug level: `VITE_LOG_LEVEL=debug`  

     - Context size: `DEFAULT_NUM_CTX=32768`  


**Note**: Never commit your `.env.local` file to version control. It’s already in `.gitignore`.

### 2️⃣ Run Development Server  
```bash

pnpm run dev

```
**Tip**: Use **Google Chrome Canary** for local testing.

---

## πŸ§ͺ Testing

Run the test suite with:  
```bash

pnpm test

```

---

## πŸš€ Deployment

### Deploy to Cloudflare Pages  
```bash

pnpm run deploy

```
Ensure you have required permissions and that Wrangler is configured.

---

## 🐳 Docker Deployment

This section outlines the methods for deploying the application using Docker. The processes for **Development** and **Production** are provided separately for clarity.

---

### πŸ§‘β€πŸ’» Development Environment  

#### Build Options  

**Option 1: Helper Scripts**  
```bash

# Development build

npm run dockerbuild

```

**Option 2: Direct Docker Build Command**  
```bash

docker build . --target bolt-ai-development

```

**Option 3: Docker Compose Profile**  
```bash

docker-compose --profile development up

```

#### Running the Development Container  
```bash

docker run -p 5173:5173 --env-file .env.local bolt-ai:development

```

---

### 🏭 Production Environment  

#### Build Options  

**Option 1: Helper Scripts**  
```bash

# Production build

npm run dockerbuild:prod

```

**Option 2: Direct Docker Build Command**  
```bash

docker build . --target bolt-ai-production

```

**Option 3: Docker Compose Profile**  
```bash

docker-compose --profile production up

```

#### Running the Production Container  
```bash

docker run -p 5173:5173 --env-file .env.local bolt-ai:production

```

---

### Coolify Deployment  

For an easy deployment process, use [Coolify](https://github.com/coollabsio/coolify):  
1. Import your Git repository into Coolify.  
2. Choose **Docker Compose** as the build pack.  
3. Configure environment variables (e.g., API keys).  
4. Set the start command:  
   ```bash

   docker compose --profile production up

   ```

---

## πŸ› οΈ VS Code Dev Containers Integration

The `docker-compose.yaml` configuration is compatible with **VS Code Dev Containers**, making it easy to set up a development environment directly in Visual Studio Code.

### Steps to Use Dev Containers

1. Open the command palette in VS Code (`Ctrl+Shift+P` or `Cmd+Shift+P` on macOS).  
2. Select **Dev Containers: Reopen in Container**.  
3. Choose the **development** profile when prompted.  
4. VS Code will rebuild the container and open it with the pre-configured environment.

---

## πŸ”‘ Environment Variables

Ensure `.env.local` is configured correctly with:  
- API keys.  
- Context-specific configurations.  

Example for the `DEFAULT_NUM_CTX` variable:  
```bash

DEFAULT_NUM_CTX=24576 # Uses 32GB VRAM

```