Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
20 changes: 20 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM mcr.microsoft.com/devcontainers/python:1-3.11-bookworm
Comment thread Fixed

RUN rm -f /etc/apt/sources.list.d/yarn.list /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
git \
bash \
build-essential \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*

RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get update \
&& apt-get install -y --no-install-recommends nodejs \
&& npm install -g npm@latest \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /workspaces/bambuddy
43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "Bambuddy Dev",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/bambuddy",
"remoteUser": "vscode",
"forwardPorts": [8000, 5173],
"portsAttributes": {
"8000": {
"label": "Bambuddy Backend",
"onAutoForward": "notify"
},
"5173": {
"label": "Vite Frontend",
"onAutoForward": "openPreview"
}
},
"postCreateCommand": "python -m pip install --upgrade pip && pip install -r requirements.txt -r requirements-dev.txt && mkdir -p /home/vscode/.npm && sudo chown -R vscode:vscode /home/vscode/.npm && sudo rm -rf frontend/node_modules && cd frontend && npm ci",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"charliermarsh.ruff",
"ms-azuretools.vscode-docker",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.analysis.typeCheckingMode": "basic",
"editor.formatOnSave": true,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
},
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.fixAll.ruff": "explicit"
}
}
}
}
}
19 changes: 19 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
app:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
command: sleep infinity
volumes:
- ..:/workspaces/bambuddy:cached
- bambuddy-pip-cache:/home/vscode/.cache/pip
- bambuddy-npm-cache:/home/vscode/.npm
environment:
PYTHONUNBUFFERED: "1"
PIP_DISABLE_PIP_VERSION_CHECK: "1"
DEBUG: "true"
BACKEND_PORT: "8000"

volumes:
bambuddy-pip-cache:
bambuddy-npm-cache:
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,42 @@ services:

</details>

#### DevContainer (VS Code)

Use the included `.devcontainer/` setup for a consistent development environment.

**Prerequisites:**
- Docker
- VS Code with the Dev Containers extension

```bash
# from repository root
code .
```

Then run **"Dev Containers: Reopen in Container"** from the command palette.

Inside the container, start the app in two terminals:

```bash
# Terminal 1 (backend)
DEBUG=true uvicorn backend.app.main:app --reload

# Terminal 2 (frontend)
cd frontend && npm run dev
```

Ports `8000` (backend) and `5173` (frontend) are forwarded automatically.

**Troubleshooting:**
If container creation fails early (for example with `devContainersSpecCLI ... Exit code 1`), run:

```bash
docker compose -f .devcontainer/docker-compose.yml build --no-cache app
```

Then use **"Dev Containers: Rebuild and Reopen in Container"** in VS Code.

#### Windows (Portable Launcher)

The easiest way to run Bambuddy on Windows - no installation required:
Expand Down
3 changes: 2 additions & 1 deletion frontend/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
import { defineConfig } from 'vite'

// Backend port for dev server proxy (default: 8000)
const backendPort = process.env.BACKEND_PORT || '8000'
Expand All @@ -14,6 +14,7 @@ export default defineConfig({
chunkSizeWarningLimit: 3000,
},
server: {
host: '0.0.0.0',
proxy: {
'/api/v1/ws': {
target: backendUrl,
Expand Down