Skip to content

Commit 4e1547e

Browse files
author
Marvin Zhang
committed
feat: implement workspace management and persistence system with multi-storage support
1 parent e1c4344 commit 4e1547e

11 files changed

+58
-37
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"id": 257,
3+
"key": "test-docker-development-environment",
4+
"title": "Test Docker Development Environment",
5+
"type": "task",
6+
"description": "Testing the Docker development environment setup to ensure it works correctly for development workflow.",
7+
"status": "new",
8+
"priority": "medium",
9+
"createdAt": "2025-07-24T04:18:45.543Z",
10+
"updatedAt": "2025-07-24T04:19:34.049Z",
11+
"notes": [],
12+
"files": [],
13+
"relatedDevlogs": [],
14+
"context": {
15+
"businessContext": "",
16+
"technicalContext": "",
17+
"dependencies": [],
18+
"decisions": [],
19+
"acceptanceCriteria": [],
20+
"risks": []
21+
},
22+
"aiContext": {
23+
"currentSummary": "",
24+
"keyInsights": [],
25+
"openQuestions": [],
26+
"relatedPatterns": [],
27+
"suggestedNextSteps": [],
28+
"lastAIUpdate": "2025-07-24T04:18:45.543Z",
29+
"contextVersion": 1
30+
},
31+
"archived": true
32+
}

.github/copilot-instructions.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -200,34 +200,38 @@ For every significant architectural change:
200200

201201
#### Build vs Dev Server Conflicts
202202
- **Use `pnpm build:test` for AI testing**: When AI agents need to test builds, always use `pnpm build:test` instead of `pnpm build`
203-
- **Why this matters**: `pnpm build` overwrites `.next/` directory and breaks active `dev:web` servers
203+
- **Why this matters**: `pnpm build` overwrites `.next/` directory and breaks active development servers
204204
- **Solution implemented**:
205205
- `pnpm build:test` uses `.next-build/` directory (separate from dev server's `.next/`)
206206
- Dev servers can run concurrently with build testing
207207
- No workflow disruption when testing build success
208208
- **Commands available**:
209-
- `pnpm dev:web` - Runs dev server using `.next/` directory
209+
- `docker compose -f docker-compose.dev.yml up web-dev` - Runs containerized dev server
210210
- `pnpm build:test` - Tests build using `.next-build/` directory
211211
- `pnpm build` - Production build (still uses `.next/` by default)
212212

213-
#### Single Dev Server Policy
214-
- **One server at a time**: `pnpm dev:web` uses fixed port 3000 and will fail if port is occupied
215-
- **Clear feedback**: Shows existing servers before attempting to start new one
216-
- **Preserve hot reload**: Don't kill existing servers - let developers use the running one
217-
- **Error handling**: Next.js EADDRINUSE error clearly indicates when port 3000 is busy
218-
- **Check existing servers**: The dev command shows what's running on ports 3000-3002 before starting
213+
#### Docker-Based Development Policy
214+
- **Use Docker Compose for development**: The development environment now runs in containers for consistency
215+
- **Configurable storage**: Storage type determined by `.env` file configuration (PostgreSQL, SQLite, JSON, or GitHub)
216+
- **Hot reloading preserved**: Volume mounts ensure code changes trigger hot reloads
217+
- **Port management**: Docker handles port allocation and prevents conflicts
218+
- **Environment isolation**: Development dependencies are containerized
219+
- **Commands**:
220+
- Start: `docker compose -f docker-compose.dev.yml up web-dev`
221+
- Stop: `docker compose -f docker-compose.dev.yml down`
222+
- Logs: `docker compose logs web-dev -f`
219223

220224
#### UI-Related Development Tasks
221225
- **ALWAYS use Playwright**: Use Playwright MCP tools for UI validation and debugging
222226
- **Browser Tool Selection**:
223227
- **Playwright**: Required for React error debugging, console monitoring, state analysis
224228
- **Simple Browser**: Basic navigation/UI testing only - NOT reliable for error detection
225229
- **Testing Steps**:
226-
- **Start Web App**: Run `pnpm dev:web` to start the web app
227-
- **Verify**: Ensure the web app is running correctly before testing
230+
- **Start Web App**: Run `docker compose -f docker-compose.dev.yml up web-dev` to start the containerized web app
231+
- **Verify**: Ensure the web app is running correctly before testing (check http://localhost:3200)
228232
- **Run Tests**: Use Playwright to run UI tests against the web app
229233
- **Update Devlog**: Add test results and any fixes to the devlog entry
230-
- **Stop Web App**: After testing, stop the web app with `Ctrl+C` in the terminal
234+
- **Stop Web App**: After testing, stop with `docker compose -f docker-compose.dev.yml down`
231235

232236
#### React Debugging Verification Protocol
233237
- **MANDATORY for React Issues**: Use Playwright console monitoring before concluding any fix

Dockerfile.dev

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install
2828
COPY packages ./packages
2929
COPY tsconfig.json ./
3030

31+
# Copy scripts directory for development utilities
32+
COPY scripts ./scripts
33+
3134
# Development environment
3235
ENV NODE_ENV=development
3336
ENV NEXT_TELEMETRY_DISABLED=1

docker-compose.dev.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,16 @@ services:
1010
container_name: devlog-web-dev
1111
command: pnpm dev:web
1212
ports:
13-
- "3000:3000"
13+
- "3200:3000"
1414
volumes:
1515
- .:/app
1616
- /app/node_modules
1717
- /app/packages/web/.next
1818
- /app/packages/web/.next-build
19-
environment:
20-
- NODE_ENV=development
21-
- POSTGRES_URL=postgresql://postgres:postgres@postgres:5432/devlog
22-
- DEVLOG_STORAGE_TYPE=postgres
23-
- POSTGRES_SSL=false
24-
- NEXT_TELEMETRY_DISABLED=1
25-
depends_on:
26-
postgres:
27-
condition: service_healthy
19+
- './scripts:/app/scripts'
20+
- './.devlog:/app/.devlog'
21+
env_file:
22+
- .env
2823

2924
# SQLite for local development (alternative to postgres)
3025
sqlite-dev:

docker-compose.yml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,14 @@ services:
3535
- NEXT_TELEMETRY_DISABLED=1
3636
- PORT=3000
3737
ports:
38-
- "3000:3000"
38+
- "3100:3000"
3939
depends_on:
4040
postgres:
4141
condition: service_healthy
4242
restart: unless-stopped
4343
networks:
4444
- devlog-network
4545

46-
# Redis for caching (optional)
47-
redis:
48-
image: redis:7-alpine
49-
container_name: devlog-redis
50-
ports:
51-
- "6379:6379"
52-
volumes:
53-
- redis_data:/data
54-
restart: unless-stopped
55-
networks:
56-
- devlog-network
57-
profiles:
58-
- with-cache
59-
6046
networks:
6147
devlog-network:
6248
driver: bridge
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)