Skip to content

Commit d5a7507

Browse files
psandersclaude
andcommitted
feat: scaffold Qcobro app monorepo
Sets up the full monorepo structure following mikro best practices: - Lerna v9 + npm workspaces with four packages: common, apiserver, agents, webapp - @qcobro/common: Zod schemas, TypeScript types, and utilities for all entities - @qcobro/apiserver: Express 5 + tRPC v11 with routers for all seven domains, Prisma/SQLite schema, JWT auth, Mocha test setup - @qcobro/agents: LangChain skeleton wired for Anthropic/OpenAI/Google - @qcobro/webapp: React 19 + Vite + Tailwind v4 + shadcn/ui Radix primitives, all seven pages from the Pencil design, tRPC client, Storybook - Root ESLint flat config, Prettier, Husky pre-commit, TypeScript composite projects - Docker + docker-compose for production and dev - GitHub Actions for CI tests and app deployment Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2f7fc25 commit d5a7507

68 files changed

Lines changed: 1572 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/settings.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"mcp__pencil__get_screenshot",
5+
"mcp__pencil__batch_get",
6+
"mcp__pencil__find_empty_space_on_canvas",
7+
"mcp__pencil__get_editor_state",
8+
"mcp__pencil__get_variables",
9+
"mcp__pencil__export_nodes",
10+
"mcp__pencil__snapshot_layout",
11+
"mcp__pencil__open_document",
12+
"Bash(npm ls *)",
13+
"Bash(npm view *)",
14+
"Bash(npm info *)"
15+
],
16+
"deny": []
17+
}
18+
}

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
QCOBRO_CONFIG_FILE=./qcobro.json

.github/workflows/deploy-app.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Deploy App
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "mods/**"
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
cache: npm
19+
20+
- run: npm ci
21+
22+
- name: Build webapp
23+
run: npm run build --workspace=mods/webapp
24+
25+
- name: Build Docker image
26+
run: docker build -t qcobro-api -f mods/apiserver/Dockerfile .
27+
28+
- name: Publish image
29+
run: echo "Wire up your registry push here (GHCR, Docker Hub, etc.)"

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "mods/**"
8+
pull_request:
9+
branches: [main]
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
cache: npm
21+
22+
- run: npm ci
23+
24+
- name: Typecheck
25+
run: npm run typecheck
26+
27+
- name: Lint
28+
run: npm run lint
29+
30+
- name: Build common
31+
run: npm run build --workspace=mods/common
32+
33+
- name: Test apiserver
34+
run: npm run test --workspace=mods/apiserver

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
dist
3+
*.db
4+
*.db-journal
5+
.env
6+
.env.local
7+
*.tsbuildinfo
8+
coverage
9+
storybook-static
10+
.DS_Store

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
node_modules
3+
*.lock

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": false,
4+
"tabWidth": 2,
5+
"trailingComma": "none",
6+
"printWidth": 100
7+
}

compose.dev.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
api:
3+
build: .
4+
command: npm run start:dev
5+
ports:
6+
- "3000:3000"
7+
environment:
8+
NODE_ENV: development
9+
DATABASE_URL: ./prisma/qcobro.db
10+
volumes:
11+
- .:/app
12+
- /app/node_modules
13+
restart: "no"

compose.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
services:
2+
api:
3+
build:
4+
context: .
5+
dockerfile: mods/apiserver/Dockerfile
6+
ports:
7+
- "3000:3000"
8+
environment:
9+
NODE_ENV: production
10+
DATABASE_URL: /data/qcobro.db
11+
JWT_SECRET: ${JWT_SECRET}
12+
volumes:
13+
- db_data:/data
14+
restart: unless-stopped
15+
16+
volumes:
17+
db_data:

0 commit comments

Comments
 (0)