Skip to content

Commit 60f903c

Browse files
mjunaidcaclaude
andcommitted
refactor: Restructure to true monorepo (apps/ + infrastructure/)
Structure changes: - Rename packages/ → apps/ - Move web-dashboard/ → apps/web/ - Move sso-platform/ → apps/sso/ - Move helm/ → infrastructure/helm/ Final structure: ``` apps/ ├── api/ # FastAPI backend ├── cli/ # Python CLI ├── mcp-server/ # MCP HTTP server ├── notification-service/ # Dapr notification consumer ├── sso/ # Better Auth SSO (was sso-platform) └── web/ # Next.js dashboard (was web-dashboard) infrastructure/ └── helm/ # Kubernetes Helm charts ``` Updated path references in: - compose.yaml, compose.dev.yaml - .github/workflows/*.yml - scripts/deploy-prod.sh - scripts/utils/build-images.sh - docker-dev.sh, docker-start.sh 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5092e07 commit 60f903c

515 files changed

Lines changed: 267 additions & 158 deletions

File tree

Some content is hidden

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

.claude/commands/sp.orchestrate.md

Lines changed: 1 addition & 1 deletion

.cursorrules

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
**For ALL work**, read these first:
2121
1. `.specify/memory/constitution.md` — Platform governance and principles
22-
2. `research/DIRECTIVES.md` — Phase-specific execution guidance
23-
3. `research/requirement.md` — Hackathon requirements and constraints
22+
2. `docs/research/DIRECTIVES.md` — Phase-specific execution guidance
23+
3. `docs/research/requirement.md` — Hackathon requirements and constraints
2424

2525
**For feature work**, additionally read:
2626
4. Relevant spec in `specs/` folder
@@ -246,7 +246,7 @@ Sprint 3 (19 min): start → progress → complete → audit
246246

247247
### Phase IV-V: Kubernetes + Production
248248

249-
See `research/DIRECTIVES.md` for detailed guidance.
249+
See `docs/research/DIRECTIVES.md` for detailed guidance.
250250

251251
---
252252

@@ -276,7 +276,7 @@ See `research/DIRECTIVES.md` for detailed guidance.
276276
```
277277
/specs/features/ # Feature specifications
278278
/.specify/memory/ # Constitution and memory
279-
/research/ # Requirements and directives
279+
/docs/research/ # Requirements and directives
280280
/src/ # Python source (CLI, backend, MCP)
281281
/frontend/ # Next.js frontend
282282
/helm/ # Kubernetes charts (Phase IV+)
@@ -287,7 +287,7 @@ See `research/DIRECTIVES.md` for detailed guidance.
287287
```bash
288288
# Always start by reading context
289289
cat .specify/memory/constitution.md
290-
cat research/DIRECTIVES.md
290+
cat docs/research/DIRECTIVES.md
291291

292292
# Check for existing spec
293293
ls specs/features/

.github/workflows/api.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ on:
44
push:
55
branches: [main, 003-backend-api]
66
paths:
7-
- 'packages/api/**'
7+
- 'apps/api/**'
88
- '.github/workflows/api.yml'
99
pull_request:
1010
branches: [main]
1111
paths:
12-
- 'packages/api/**'
12+
- 'apps/api/**'
1313

1414
defaults:
1515
run:
16-
working-directory: packages/api
16+
working-directory: apps/api
1717

1818
env:
1919
# Test environment variables

.github/workflows/cli.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ on:
44
push:
55
branches: [main, 001-cli-core]
66
paths:
7-
- 'packages/cli/**'
7+
- 'apps/cli/**'
88
- '.github/workflows/cli.yml'
99
pull_request:
1010
branches: [main]
1111
paths:
12-
- 'packages/cli/**'
12+
- 'apps/cli/**'
1313

1414
defaults:
1515
run:
16-
working-directory: packages/cli
16+
working-directory: apps/cli
1717

1818
jobs:
1919
test:
@@ -36,7 +36,7 @@ jobs:
3636
- name: Upload coverage
3737
uses: codecov/codecov-action@v4
3838
with:
39-
file: packages/cli/coverage.xml
39+
file: apps/cli/coverage.xml
4040
continue-on-error: true
4141

4242
lint:

.github/workflows/deploy.yml

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
name: Build & Deploy to Cloud
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch: # Manual trigger
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_PREFIX: ${{ github.repository_owner }}/taskflow
11+
12+
jobs:
13+
# =============================================================================
14+
# Build all Docker images and push to GHCR
15+
# =============================================================================
16+
build-images:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
strategy:
23+
matrix:
24+
include:
25+
- name: api
26+
context: apps/api
27+
dockerfile: apps/api/Dockerfile
28+
- name: sso
29+
context: apps/sso
30+
dockerfile: apps/sso/Dockerfile
31+
- name: mcp-server
32+
context: apps/mcp-server
33+
dockerfile: apps/mcp-server/Dockerfile
34+
- name: notification-service
35+
context: apps/notification-service
36+
dockerfile: apps/notification-service/Dockerfile
37+
- name: web
38+
context: apps/web
39+
dockerfile: apps/web/Dockerfile
40+
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v3
47+
48+
- name: Log in to GHCR
49+
uses: docker/login-action@v3
50+
with:
51+
registry: ${{ env.REGISTRY }}
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Extract metadata
56+
id: meta
57+
uses: docker/metadata-action@v5
58+
with:
59+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/${{ matrix.name }}
60+
tags: |
61+
type=sha,prefix=
62+
type=raw,value=latest,enable={{is_default_branch}}
63+
64+
- name: Build and push
65+
uses: docker/build-push-action@v5
66+
with:
67+
context: ${{ matrix.context }}
68+
file: ${{ matrix.dockerfile }}
69+
push: true
70+
tags: ${{ steps.meta.outputs.tags }}
71+
labels: ${{ steps.meta.outputs.labels }}
72+
cache-from: type=gha
73+
cache-to: type=gha,mode=max
74+
75+
# =============================================================================
76+
# Deploy to Kubernetes cluster
77+
# =============================================================================
78+
deploy:
79+
needs: build-images
80+
runs-on: ubuntu-latest
81+
environment: production
82+
83+
steps:
84+
- name: Checkout
85+
uses: actions/checkout@v4
86+
87+
- name: Set up kubectl
88+
uses: azure/setup-kubectl@v3
89+
with:
90+
version: 'v1.28.0'
91+
92+
- name: Set up Helm
93+
uses: azure/setup-helm@v3
94+
with:
95+
version: 'v3.13.0'
96+
97+
# For Azure AKS
98+
- name: Azure Login
99+
if: ${{ vars.CLOUD_PROVIDER == 'azure' }}
100+
uses: azure/login@v1
101+
with:
102+
creds: ${{ secrets.AZURE_CREDENTIALS }}
103+
104+
- name: Get AKS credentials
105+
if: ${{ vars.CLOUD_PROVIDER == 'azure' }}
106+
run: |
107+
az aks get-credentials \
108+
--resource-group ${{ vars.AZURE_RESOURCE_GROUP }} \
109+
--name ${{ vars.AZURE_CLUSTER_NAME }}
110+
111+
# For GKE
112+
- name: Authenticate to GKE
113+
if: ${{ vars.CLOUD_PROVIDER == 'gke' }}
114+
uses: google-github-actions/auth@v1
115+
with:
116+
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
117+
118+
- name: Get GKE credentials
119+
if: ${{ vars.CLOUD_PROVIDER == 'gke' }}
120+
uses: google-github-actions/get-gke-credentials@v1
121+
with:
122+
cluster_name: ${{ vars.GKE_CLUSTER_NAME }}
123+
location: ${{ vars.GKE_CLUSTER_ZONE }}
124+
125+
# For any provider with kubeconfig
126+
- name: Set kubeconfig
127+
if: ${{ vars.CLOUD_PROVIDER == 'kubeconfig' }}
128+
run: |
129+
mkdir -p ~/.kube
130+
echo "${{ secrets.KUBECONFIG }}" | base64 -d > ~/.kube/config
131+
chmod 600 ~/.kube/config
132+
133+
- name: Add Dapr Helm repo
134+
run: |
135+
helm repo add dapr https://dapr.github.io/helm-charts/
136+
helm repo update
137+
138+
- name: Install/Upgrade Dapr
139+
run: |
140+
helm upgrade --install dapr dapr/dapr \
141+
--version=1.15 \
142+
--namespace dapr-system \
143+
--create-namespace \
144+
--wait
145+
146+
- name: Create namespace
147+
run: kubectl create namespace taskflow --dry-run=client -o yaml | kubectl apply -f -
148+
149+
- name: Create GHCR pull secret
150+
run: |
151+
kubectl create secret docker-registry ghcr-secret \
152+
--namespace taskflow \
153+
--docker-server=ghcr.io \
154+
--docker-username=${{ github.actor }} \
155+
--docker-password=${{ secrets.GITHUB_TOKEN }} \
156+
--dry-run=client -o yaml | kubectl apply -f -
157+
158+
- name: Deploy with Helm
159+
run: |
160+
helm upgrade --install taskflow ./infrastructure/helm/taskflow \
161+
--namespace taskflow \
162+
--values infrastructure/helm/taskflow/values-cloud.yaml \
163+
--set global.imageRegistry="${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}" \
164+
--set global.imageTag="${{ github.sha }}" \
165+
--set global.imagePullSecrets[0].name=ghcr-secret \
166+
--set managedServices.neon.enabled=true \
167+
--set "managedServices.neon.ssoDatabase=${{ secrets.NEON_SSO_DATABASE_URL }}" \
168+
--set "managedServices.neon.apiDatabase=${{ secrets.NEON_API_DATABASE_URL }}" \
169+
--set "managedServices.neon.chatkitDatabase=${{ secrets.NEON_CHATKIT_DATABASE_URL }}" \
170+
--set "managedServices.neon.notificationDatabase=${{ secrets.NEON_NOTIFICATION_DATABASE_URL }}" \
171+
--set managedServices.upstash.enabled=true \
172+
--set "managedServices.upstash.host=${{ secrets.UPSTASH_REDIS_HOST }}" \
173+
--set "managedServices.upstash.password=${{ secrets.UPSTASH_REDIS_PASSWORD }}" \
174+
--set "managedServices.upstash.restUrl=${{ secrets.REDIS_URL }}" \
175+
--set "managedServices.upstash.restToken=${{ secrets.REDIS_TOKEN }}" \
176+
--set "sso.env.BETTER_AUTH_SECRET=${{ secrets.BETTER_AUTH_SECRET }}" \
177+
--set "api.openai.apiKey=${{ secrets.OPENAI_API_KEY }}" \
178+
--set notificationService.enabled=true \
179+
--set dapr.enabled=true \
180+
--set "global.domain=${{ vars.DOMAIN }}" \
181+
--wait \
182+
--timeout 10m
183+
184+
- name: Verify deployment
185+
run: |
186+
echo "Checking pod status..."
187+
kubectl get pods -n taskflow
188+
echo ""
189+
echo "Checking services..."
190+
kubectl get svc -n taskflow
191+
echo ""
192+
echo "Checking ingress..."
193+
kubectl get ingress -n taskflow 2>/dev/null || echo "No ingress configured"
194+
195+
- name: Post deployment URLs
196+
run: |
197+
echo "## Deployment Complete! :rocket:" >> $GITHUB_STEP_SUMMARY
198+
echo "" >> $GITHUB_STEP_SUMMARY
199+
echo "| Service | URL |" >> $GITHUB_STEP_SUMMARY
200+
echo "|---------|-----|" >> $GITHUB_STEP_SUMMARY
201+
echo "| Web Dashboard | https://${{ vars.DOMAIN }} |" >> $GITHUB_STEP_SUMMARY
202+
echo "| SSO Platform | https://sso.${{ vars.DOMAIN }} |" >> $GITHUB_STEP_SUMMARY
203+
echo "| API | https://api.${{ vars.DOMAIN }} |" >> $GITHUB_STEP_SUMMARY
204+
echo "" >> $GITHUB_STEP_SUMMARY
205+
echo "Commit: \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY

.specify/memory/constitution.md

Lines changed: 3 additions & 3 deletions

CLAUDE.md

Lines changed: 5 additions & 5 deletions

GEMINI.md

Lines changed: 5 additions & 5 deletions

0 commit comments

Comments
 (0)