Skip to content

Commit 80c472b

Browse files
docs:made modification to CONTRIBUTING.md to assist first timers in local setup. (#458)
1 parent b46ac0d commit 80c472b

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

CONTRIBUTING.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,35 @@ Before you begin, you'll need to install a few tools:
2525
```bash
2626
# Copy the example file
2727
cp .env.example .env.local
28-
28+
2929
# Edit .env.local and update DATABASE_URL to match Docker:
3030
# DATABASE_URL=postgresql://manicode_user_local:secretpassword_local@localhost:5432/manicode_db_local
3131
```
3232

33-
> **Team members**: For shared secrets management, see the [Infisical Setup Guide](./INFISICAL_SETUP_GUIDE.md).
33+
### Required local env changes
34+
35+
The `.env.example` provides defaults. When you create ` .env.local` make sure to update the following important fields for local development:
36+
37+
- **OPEN_ROUTER_API_KEY**: set to your OpenRouter key (used for LLM calls). Example:
38+
- `OPEN_ROUTER_API_KEY=sk-or-v1-...`
39+
- **GRAVITY_API_KEY**: optional; use `test` for ad/analytics testing in dev.
40+
- **PORT**: the example defaults to `4242`. This repo commonly runs on `3000` during development — set `PORT=3000` if you want the web app on `http://localhost:3000`.
41+
- **NEXTAUTH_URL**: when using port 3000 set `NEXTAUTH_URL=http://localhost:3000` to ensure OAuth callbacks work.
42+
- **CODEBUFF_GITHUB_ID** / **CODEBUFF_GITHUB_SECRET**: your GitHub OAuth app credentials — required to sign in locally via GitHub.
43+
- **DATABASE_URL**: confirm this points to your local Docker Postgres (default is fine for the built-in Docker setup):
44+
- `DATABASE_URL=postgresql://manicode_user_local:secretpassword_local@localhost:5432/manicode_db_local`
45+
- **CODEBUFF_API_KEY**: optional CLI fallback — you can `export CODEBUFF_API_KEY=<your-key>` for CLI commands.
46+
47+
Notes / gotchas:
48+
49+
- After editing `.env.local` you must restart the dev server (`bun run start-web`) — environment variables are loaded at startup.
50+
- If you use OpenRouter, ensure the account associated with your API key has credits (OpenRouter will return 402 Payment Required otherwise).
51+
- If you see Postgres role errors during migrations, re-create the DB and wait for it to fully initialize:
52+
```bash
53+
cd packages/internal/src/db && docker compose down -v && docker compose up --wait
54+
```
55+
56+
> **Team members**: For shared secrets management, see the [Infisical Setup Guide](./INFISICAL_SETUP_GUIDE.md).
3457
3558
3. **Install dependencies**:
3659

@@ -39,7 +62,6 @@ Before you begin, you'll need to install a few tools:
3962
```
4063

4164
4. **Setup a Github OAuth app**
42-
4365
1. Follow these instructions to set up a [Github OAuth app](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app)
4466
2. Add your Github client ID and secret to `.env.local`:
4567

@@ -63,7 +85,6 @@ Before you begin, you'll need to install a few tools:
6385
Now, you should be able to run the CLI and send commands, but it will error out because you don't have any credits.
6486

6587
6. **Giving yourself credits**:
66-
6788
1. Log into Codebuff at [http://localhost:3000/login](http://localhost:3000/login)
6889

6990
2. Then give yourself lots of credits. Be generous, you're the boss now!
@@ -97,7 +118,6 @@ In order to run the CLI from other directories, you need to first publish the ag
97118
```
98119

99120
- Repeat this until there are no more errors.
100-
101121
- As of the time of writing, the command required is:
102122

103123
```bash

0 commit comments

Comments
 (0)