# Prompt: Team Standup - mockupAWS Development Kickoff ## 🎯 Obiettivo Ingaggiare il team di sviluppo per verificare lo stato attuale e procedere con l'implementazione della Fase 1 (Database + Backend API) del progetto mockupAWS. --- ## πŸ“Š Stato Progetto **Progetto:** mockupAWS - Backend Profiler & Cost Estimator **Versione Target:** v0.2.0 **Data:** 2026-04-07 **Stato:** πŸ”΄ Pianificazione / Architettura iniziale ### Cosa Γ¨ stato completato βœ… 1. **Documentazione:** - βœ… PRD completo (v0.2.0) in `export/prd.md` - βœ… README aggiornato con architettura e istruzioni - βœ… Team configurato in `.opencode/agents/` 2. **Codice Base Iniziale:** - βœ… FastAPI base con endpoint `/ingest`, `/metrics`, `/reset`, `/flush` - βœ… Calcolo metriche: SQS blocks, token count (tiktoken), PII detection - βœ… Test suite pytest con 5 test passanti - βœ… Struttura progetto e configurazione uv/pyproject.toml 3. **Configurazione:** - βœ… Configurazione OpenCode (`.opencode/`) - βœ… Git repository con commit iniziale ### Cosa deve essere fatto πŸ”΄ #### PrioritΓ  Alta (Fase 1 - v0.2.0) - [ ] **Database PostgreSQL:** - Schema completo (scenarios, scenario_logs, scenario_metrics, aws_pricing, reports) - Alembic migrations setup - Migrazioni per tutte le tabelle - Seed dati prezzi AWS - [ ] **Backend API:** - Integrazione SQLAlchemy 2.0 async - Model SQLAlchemy per tutte le tabelle - API CRUD scenari (/api/v1/scenarios/*) - Gestione stati scenario (draftβ†’runningβ†’completedβ†’archived) - Calcolo costi usando prezzi da database - Persistenza log e metriche - [ ] **Testing:** - Integration tests per API scenari - Test coverage > 80% #### PrioritΓ  Media (Fase 2 - v0.3.0) - [ ] Frontend React con dashboard - [ ] Docker Compose setup --- ## πŸ‘₯ Team Assegnato | Agente | Ruolo | PrioritΓ  Task | |--------|-------|---------------| | `@spec-architect` | Software Architect | Completare architecture.md, kanban.md, coordinamento | | `@db-engineer` | Database Engineer | Schema DB, Alembic migrations, seed dati | | `@backend-dev` | Backend Developer | API CRUD, integrazione DB, services | | `@frontend-dev` | Frontend Developer | In attesa Fase 2 (preparare mock data) | | `@devops-engineer` | DevOps Engineer | In attesa (preparare Docker base) | | `@qa-engineer` | QA Engineer | Review requisiti, preparare test plan | --- ## 🎬 Azioni Immediate ### Per @spec-architect **Task:** Completare specifiche tecniche 1. **Leggere attentamente:** - `/home/google/Sources/LucaSacchiNet/mockupAWS/export/prd.md` (tutto) - `/home/google/Sources/LucaSacchiNet/mockupAWS/src/main.py` (codice esistente) - `/home/google/Sources/LucaSacchiNet/mockupAWS/src/profiler.py` 2. **Aggiornare** `/home/google/Sources/LucaSacchiNet/mockupAWS/export/architecture.md`: ```markdown # Da aggiungere: - Sezione Database: schema dettagliato con tipi SQL - Sezione API: endpoint completi con request/response - Sezione Sicurezza: JWT, API keys, rate limiting - Sezione Deployment: Docker strategy ``` 3. **Creare** `/home/google/Sources/LucaSacchiNet/mockupAWS/export/kanban.md`: ```markdown # Struttura richiesta: ## πŸ”΄ TODO (Fase 1 - Database & Backend) ### DB-001: Setup Alembic - [ ] Configurazione async - [ ] Test connessione ### DB-002: Migrazione Scenarios - [ ] Tabella scenarios - [ ] Indici ### API-001: CRUD Scenari - [ ] POST /api/v1/scenarios - [ ] GET /api/v1/scenarios - ... ``` 4. **Aggiornare** `/home/google/Sources/LucaSacchiNet/mockupAWS/export/progress.md`: - Stato attuale: "πŸ”΄ Fase 1 - Database setup" - Percentuale: 10% - Task in corso: Architettura ### Per @db-engineer **Task:** Progettare e implementare database 1. **Progettare schema completo**: ```sql -- scenarios id: UUID PK name: VARCHAR(255) description: TEXT tags: JSONB status: ENUM('draft', 'running', 'completed', 'archived') region: VARCHAR(50) created_at: TIMESTAMP updated_at: TIMESTAMP total_cost_estimate: DECIMAL(10,4) -- scenario_logs id: UUID PK scenario_id: UUID FK received_at: TIMESTAMP message_hash: VARCHAR(64) -- SHA256 message_preview: VARCHAR(500) source: VARCHAR(100) size_bytes: INTEGER has_pii: BOOLEAN token_count: INTEGER sqs_blocks: INTEGER -- scenario_metrics id: UUID PK scenario_id: UUID FK timestamp: TIMESTAMP metric_type: VARCHAR(50) metric_name: VARCHAR(100) value: DECIMAL(15,4) unit: VARCHAR(20) metadata: JSONB -- aws_pricing id: UUID PK service: VARCHAR(50) region: VARCHAR(50) tier: VARCHAR(50) price_per_unit: DECIMAL(10,8) unit: VARCHAR(20) effective_from: DATE effective_to: DATE is_active: BOOLEAN -- reports id: UUID PK scenario_id: UUID FK format: ENUM('pdf', 'csv') file_path: VARCHAR(500) generated_at: TIMESTAMP metadata: JSONB ``` 2. **Setup Alembic**: ```bash cd /home/google/Sources/LucaSacchiNet/mockupAWS uv add alembic asyncpg uv run alembic init alembic # Configurare per async ``` 3. **Creare migrazioni**: - `alembic/versions/001_create_scenarios_table.py` - `alembic/versions/002_create_scenario_logs_table.py` - `alembic/versions/003_create_scenario_metrics_table.py` - `alembic/versions/004_create_aws_pricing_table.py` - `alembic/versions/005_create_reports_table.py` - `alembic/versions/006_seed_aws_pricing_data.py` 4. **Documentare** in `docs/database_schema.md`: - Schema ER - Indici - Query principali ### Per @backend-dev **Task:** Preparare integrazione database 1. **Analizzare** codice esistente: - Come funziona `/ingest` attualmente (in-memory) - Come adattarlo per usare database 2. **Preparare** struttura nuova: ``` backend/src/ β”œβ”€β”€ models/ β”‚ β”œβ”€β”€ __init__.py β”‚ β”œβ”€β”€ scenario.py # SQLAlchemy model β”‚ β”œβ”€β”€ scenario_log.py β”‚ β”œβ”€β”€ scenario_metric.py β”‚ └── aws_pricing.py β”œβ”€β”€ schemas/ β”‚ β”œβ”€β”€ __init__.py β”‚ β”œβ”€β”€ scenario.py # Pydantic schemas β”‚ └── ... β”œβ”€β”€ api/ β”‚ β”œβ”€β”€ __init__.py β”‚ β”œβ”€β”€ v1/ β”‚ β”‚ β”œβ”€β”€ __init__.py β”‚ β”‚ β”œβ”€β”€ scenarios.py # CRUD endpoints β”‚ β”‚ β”œβ”€β”€ ingest.py # Updated /ingest β”‚ β”‚ └── pricing.py β”‚ └── deps.py # Dependencies (DB session) β”œβ”€β”€ services/ β”‚ β”œβ”€β”€ __init__.py β”‚ β”œβ”€β”€ scenario_service.py β”‚ β”œβ”€β”€ cost_calculator.py β”‚ └── ingest_processor.py └── core/ β”œβ”€β”€ config.py # Settings (DB URL, etc.) └── database.py # DB connection/session ``` 3. **Aspettare** completamento schema DB prima di iniziare implementazione ### Per @qa-engineer **Task:** Preparare test strategy 1. **Creare** `docs/test_plan.md`: ```markdown # Test Plan mockupAWS v0.2.0 ## Unit Tests - [ ] ScenarioService.create() - [ ] ScenarioService.update_status() - [ ] CostCalculator.calculate_sqs_cost() - [ ] CostCalculator.calculate_lambda_cost() - [ ] IngestProcessor.process_log() ## Integration Tests - [ ] POST /api/v1/scenarios - Crea scenario - [ ] GET /api/v1/scenarios - Lista scenari - [ ] POST /ingest with X-Scenario-ID - Ingest log - [ ] GET /api/v1/scenarios/{id}/metrics - Get metrics - [ ] State transitions: draftβ†’runningβ†’completed ## E2E Tests (preparazione) - [ ] Flow completo: Crea β†’ Ingest 10 log β†’ Verifica metriche - [ ] Confronto costi: scenario A vs scenario B ``` 2. **Review** requisiti PRD per completezza test coverage ### Per @frontend-dev (preparazione) **Task:** Preparare ambiente e mock data 1. **Setup** struttura frontend: ```bash mkdir -p /home/google/Sources/LucaSacchiNet/mockupAWS/frontend cd /home/google/Sources/LucaSacchiNet/mockupAWS/frontend npm create vite@latest . -- --template react-ts npm install npm install tailwindcss postcss autoprefixer npx tailwindcss init -p npm install @tanstack/react-query axios recharts lucide-react npm install -D @types/node ``` 2. **Preparare** mock data per sviluppo UI: ```typescript // mock/scenarios.ts export const mockScenarios = [ { id: "uuid-1", name: "Produzione Q2", status: "running", total_cost_estimate: 125.50, total_requests: 15000, created_at: "2026-04-01T10:00:00Z" }, // ... ]; ``` 3. **Attendere** completamento API backend ### Per @devops-engineer (preparazione) **Task:** Preparare Docker base 1. **Creare** `docker-compose.yml` base: ```yaml version: '3.8' services: postgres: image: postgres:15-alpine environment: POSTGRES_DB: mockupaws POSTGRES_USER: app POSTGRES_PASSWORD: changeme volumes: - postgres_data:/var/lib/postgresql/data ports: - "5432:5432" # backend e frontend da aggiungere dopo volumes: postgres_data: ``` 2. **Preparare** `backend/Dockerfile`: ```dockerfile FROM python:3.11-slim WORKDIR /app COPY pyproject.toml . RUN pip install uv && uv pip install -r pyproject.toml COPY . . CMD ["uv", "run", "uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000"] ``` --- ## πŸ“‹ Checklist Team ### @spec-architect - [ ] Leggere PRD completo - [ ] Aggiornare architecture.md con dettagli DB e API - [ ] Creare kanban.md con task Fase 1 - [ ] Aggiornare progress.md ### @db-engineer - [ ] Progettare schema completo - [ ] Setup Alembic - [ ] Creare migrazioni - [ ] Documentare schema ### @backend-dev - [ ] Analizzare codice esistente - [ ] Preparare struttura nuova - [ ] In attesa schema DB ### @qa-engineer - [ ] Creare test_plan.md - [ ] Review requisiti ### @frontend-dev - [ ] Setup ambiente React - [ ] Preparare mock data ### @devops-engineer - [ ] Creare docker-compose.yml base - [ ] Preparare Dockerfile backend --- ## 🎯 Success Criteria La Fase 1 Γ¨ completata quando: - [ ] Database PostgreSQL funzionante con tutte le tabelle - [ ] Migrazioni Alembic funzionanti (upgrade/downgrade) - [ ] API CRUD scenari complete e testate - [ ] Endpoint `/ingest` aggiornato per persistere log - [ ] Calcolo costi usando prezzi da database - [ ] Test coverage > 80% - [ ] Documentazione tecnica aggiornata --- ## ⏰ Timeline Suggerita | Settimana | Focus | Deliverable | |-----------|-------|-------------| | Week 1 | Architettura + DB | Schema DB, migrazioni, architettura approvata | | Week 2 | Backend API | CRUD scenari, persistenza, calcolo costi | | Week 3 | Testing + Refinement | Test >80%, bug fixing, ottimizzazioni | | Week 4 | Frontend base | Dashboard lista scenari, form creazione | --- ## πŸ“ž Comunicazione - **Daily standup:** Aggiornare `export/progress.md` - **Domande tecniche:** Documentare in `docs/architecture.md` - **Blocchi:** Aggiungere a `export/kanban.md` colonna BLOCKED - **Decisioni:** Sempre in Conventional Commits --- **Prompt creato:** 2026-04-07 **Team Lead:** @spec-architect **Stato:** Pronto per esecuzione --- ## πŸš€ Prossima Azione Concreta **Tutti gli agenti coinvolti:** Leggete questo prompt e la vostra configurazione in `.opencode/agents/`, poi procedete con i task assegnati. **PrioritΓ  immediata:** 1. @spec-architect completa architecture.md 2. @db-engineer inizia schema DB 3. @backend-dev prepara struttura Iniziate ora! πŸ’ͺ