2.2 KiB
2.2 KiB
Development Guide
Project Structure
├── apps/ # Frontend applications
├── services/ # Backend microservices
├── packages/ # Shared libraries
├── infra/ # Infrastructure configs
├── deployments/ # Deployment configs
├── scripts/ # Automation scripts
└── docs/ # Documentation
Development Workflow
1. Create a Feature Branch
git checkout -b feature/my-feature
2. Make Changes
- Write code following TypeScript strict mode
- Add tests for new functionality
- Update documentation if needed
3. Run Tests Locally
# All tests
pnpm test
# Specific service
pnpm --filter @goodgo/iam-service test
4. Lint and Format
pnpm lint
pnpm format
5. Create Pull Request
- Push your branch
- Create PR targeting
develop - CI/CD will run automatically
Adding a New Service
-
Use the template:
./scripts/utils/create-service.sh my-new-service -
Update service configuration
-
Implement business logic
-
Add tests
-
Update documentation
Adding a New Package
- Create package in
packages/new-package - Add to workspace in
pnpm-workspace.yaml - Export from
index.ts - Add tests
- Document usage
Database Migrations
Database Migrations
# Create migration (dev)
./scripts/db/migrate.sh iam-service dev
# Apply migrations (production)
./scripts/db/migrate.sh iam-service deploy
Kubernetes Deployment
Local Kubernetes (Docker Desktop)
# Enable Kubernetes in Docker Desktop
# Settings → Kubernetes → Enable Kubernetes
# Deploy service
cd deployments/local/kubernetes
./deploy.sh
# Verify deployment
kubectl get pods -n iam-local
kubectl logs -f -n iam-local -l app=iam-service
# Port forward for testing
kubectl port-forward svc/iam-service 5002:80 -n iam-local
curl http://localhost:5002/health/live
See detailed guide: Kubernetes Local Deployment Guide
Debugging
- Use logger from
@goodgo/logger - Check Traefik logs:
docker logs traefik-local - Check service logs:
./scripts/dev/logs.sh iam-service