Skip to content

Commit 1e75ced

Browse files
authored
docs: update CONTRIBUTING.md with proper setup commands and Infisical guide link (#279)
1 parent 4895180 commit 1e75ced

File tree

3 files changed

+115
-6
lines changed

3 files changed

+115
-6
lines changed

.env.example

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# AI API Keys
2+
ANTHROPIC_API_KEY=dummy_anthropic_key
3+
ANTHROPIC_API_KEY2=dummy_anthropic_key_2
4+
OPEN_AI_KEY=dummy_openai_key
5+
GEMINI_API_KEY=dummy_gemini_key
6+
DEEPSEEK_API_KEY=dummy_deepseek_key
7+
OPEN_ROUTER_API_KEY=dummy_openrouter_key
8+
HELICONE_API_KEY=dummy_helicone_key
9+
10+
# Database & Server
11+
DATABASE_URL=postgresql://postgres:secretpassword_local@localhost:5432/codebuff
12+
PORT=4242
13+
GOOGLE_CLOUD_PROJECT_ID=dummy_project_id
14+
15+
# Authentication
16+
CODEBUFF_GITHUB_ID=dummy_github_id
17+
CODEBUFF_GITHUB_SECRET=dummy_github_secret
18+
NEXTAUTH_SECRET=dummy_nextauth_secret_at_least_32_chars_long
19+
API_KEY_ENCRYPTION_SECRET=dummy_encryption_secret_32_chars
20+
21+
# Payment (Stripe)
22+
STRIPE_SECRET_KEY=sk_test_dummy_stripe_secret
23+
STRIPE_WEBHOOK_SECRET_KEY=whsec_dummy_webhook_secret
24+
STRIPE_USAGE_PRICE_ID=price_dummy_usage_id
25+
STRIPE_TEAM_FEE_PRICE_ID=price_dummy_team_fee_id
26+
27+
# External Services
28+
RELACE_API_KEY=dummy_relace_key
29+
LINKUP_API_KEY=dummy_linkup_key
30+
LOOPS_API_KEY=dummy_loops_key
31+
32+
# Discord Integration
33+
DISCORD_PUBLIC_KEY=dummy_discord_public_key
34+
DISCORD_BOT_TOKEN=dummy_discord_bot_token
35+
DISCORD_APPLICATION_ID=dummy_discord_app_id
36+
37+
# Frontend/Public Variables
38+
NEXT_PUBLIC_CB_ENVIRONMENT=development
39+
NEXT_PUBLIC_CODEBUFF_APP_URL=http://localhost:3000
40+
NEXT_PUBLIC_CODEBUFF_BACKEND_URL=http://localhost:3001
41+
NEXT_PUBLIC_SUPPORT_EMAIL=support@codebuff.com
42+
NEXT_PUBLIC_POSTHOG_API_KEY=phc_dummy_posthog_key
43+
NEXT_PUBLIC_POSTHOG_HOST_URL=https://app.posthog.com
44+
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_dummy_publishable
45+
NEXT_PUBLIC_STRIPE_CUSTOMER_PORTAL=https://billing.stripe.com/p/login/test_dummy

CONTRIBUTING.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,19 @@ Before you begin, you'll need to install a few tools:
3939
4. **Set up secrets management**:
4040

4141
```bash
42+
npm install -g @infisical/cli
4243
infisical init
4344
infisical login
4445
# Select "US" region when prompted
45-
infisical secrets # Verify setup works
4646
```
4747

48-
You will need to populate all the secrets in the infisical UI at https://app.infisical.com. You can provide dummy values for the secrets if you get an error about missing secrets, but you will need to update them with real values in order to use the associated feature.
48+
Follow the [Infisical Setup Guide](./INFISICAL_SETUP_GUIDE.md) for detailed setup instructions.
49+
50+
Load all environment variables at once:
51+
```bash
52+
infisical secrets set --file .env.example
53+
infisical secrets set DATABASE_URL=postgresql://postgres:secretpassword_local@localhost:5432/codebuff
54+
```
4955

5056
5. **Configure environment**:
5157

@@ -62,16 +68,21 @@ Before you begin, you'll need to install a few tools:
6268
7. **Start development services** (requires 3 terminals):
6369

6470
```bash
65-
# Terminal 1 - Backend server
71+
# Terminal 1 - Backend server (start first)
6672
bun run start-server
73+
# Expected: 🚀 Server is running on port 4242
6774

68-
# Terminal 2 - Web server
75+
# Terminal 2 - Web server (start second)
6976
bun run start-web
77+
# Expected: Ready on http://localhost:3000
7078

71-
# Terminal 3 - CLI client
79+
# Terminal 3 - CLI client (start last)
7280
bun run start-bin
81+
# Expected: Welcome to Codebuff! + agent list
7382
```
7483

84+
**Note**: CLI requires both backend and web server running for authentication.
85+
7586
## Understanding the Codebase
7687

7788
Codebuff is organized as a monorepo with these main packages:
@@ -173,7 +184,7 @@ Level up the web interface in `web/` with better agent management, project templ
173184

174185
- **direnv problems?** Make sure it's hooked into your shell, run `direnv allow`, and restart your terminal
175186
- **Script errors?** Double-check you're using bun for all commands
176-
- **Can't find files?** See our [local development guide](./local-development.md) for more detailed setup
187+
- **Infisical issues?** See our [Infisical Setup Guide](./INFISICAL_SETUP_GUIDE.md) for step-by-step instructions
177188

178189
**Questions?** Jump into our [Discord community](https://codebuff.com/discord) - we're friendly and always happy to help!
179190

INFISICAL_SETUP_GUIDE.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Simple Infisical Setup for Codebuff
2+
3+
Quick 5-step setup to get Codebuff running with Infisical secrets.
4+
5+
## Setup Steps
6+
7+
### 1. Install & Setup
8+
```bash
9+
npm install -g @infisical/cli
10+
infisical init
11+
infisical login
12+
# Select "US" region when prompted
13+
infisical secrets # Verify setup works
14+
```
15+
16+
### 2. Browser Login
17+
- Browser opens automatically to https://app.infisical.com
18+
- Login with **any email** (Gmail, etc.)
19+
- Fill in any **name** and **organization name** when asked
20+
- Copy the token from browser and paste in terminal
21+
22+
### 3. Select Project
23+
- Use arrow keys to choose your organization
24+
- Select or create a Codebuff project
25+
26+
### 4. Load Environment Variables
27+
```bash
28+
# Load all variables at once
29+
infisical secrets set --file .env.example
30+
31+
# IMPORTANT: Fix the database password separately
32+
infisical secrets set DATABASE_URL=postgresql://postgres:secretpassword_local@localhost:5432/codebuff
33+
```
34+
35+
### 5. Done! Run Codebuff
36+
```bash
37+
bun run start-server # Backend (port 4242)
38+
bun run start-web # Web (port 3000)
39+
bun run start-bin # CLI
40+
```
41+
42+
## Common Issues & Quick Fixes
43+
44+
**Token won't paste?** → Right-click → paste
45+
**Database error?** → Run the DATABASE_URL command above
46+
**Can't navigate menus?** → Use arrow keys ↓ ↑
47+
48+
## That's It!
49+
50+
The `.env.example` file contains all the dummy values needed for development. Only the database password needs to be fixed to match Docker's password.
51+
52+
You will need to populate all the secrets in the Infisical UI at https://app.infisical.com. You can provide dummy values for the secrets if you get an error about missing secrets, but you will need to update them with real values in order to use the associated feature.
53+

0 commit comments

Comments
 (0)