Utility scripts for maintaining the monorepo.
Scripts for keeping template and template-react backends in sync.
Verifies that template and template-react backends are synchronized.
Usage:
# Quick check (Python files only)
./scripts/check-template-sync.sh --quick
# Full check (includes config, ports, docker-compose)
./scripts/check-template-sync.sh
# Verbose output (show file-by-file comparison)
./scripts/check-template-sync.sh --verboseWhat it checks:
- ✅ All Python source code is identical (50 files)
- ✅
Dockerfilediffers (allows architectural differences) - ✅
pyproject.tomldiffers ONLY in package name (strict) - ✅ Port allocation follows pattern (template + 1)
- ✅ Docker-compose uses hot_reload.py
- ✅ Paths are correct for each app
Exit codes:
0- All checks passed1- Issues found
Synchronizes backend code from template to template-react.
Usage:
# Preview changes (dry run)
./scripts/sync-template-backends.sh --dry-run
# Apply changes (with confirmation)
./scripts/sync-template-backends.sh
# Force sync (skip confirmation)
./scripts/sync-template-backends.sh --forceWhat it syncs:
- ✅ All Python files in
src/app/ - ✅ Worker entry point (
src/worker_entry.py)
What it NEVER syncs (app-specific):
- ❌
Dockerfile - ❌
pyproject.toml - ❌
docker-compose*.yml - ❌
.env* - ❌
migrations/ - ❌
.venv/
Workflow:
- Make changes to template backend
- Run sync script:
./scripts/sync-template-backends.sh - Run check script:
./scripts/check-template-sync.sh - Test both apps
- Commit changes
See docs/templates/backend-sync-guide.md for detailed documentation on:
- Architecture overview
- File structure comparison
- Synchronization workflow
- Common issues
- Best practices
When adding new scripts:
- Use bash shebang:
#!/bin/bash - Set executable:
chmod +x script.sh - Add error handling:
set -e - Add help text:
--helpflag - Document in this README
- Use colors for output clarity:
RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' NC='\033[0m' # No Color