Commit Graph

11 Commits

Author SHA1 Message Date
Luca Sacchi Ricciardi
991908ba62 feat(frontend): implement complete React frontend with Vite, TypeScript, and Tailwind
Complete frontend implementation (FE-001 to FE-006):

FE-001: Setup Ambiente React
- Initialize Vite + React + TypeScript project
- Configure Tailwind CSS with custom theme
- Add shadcn/ui components (Button, Card, Badge, Table, DropdownMenu, Toaster)
- Install dependencies: axios, react-query, react-router-dom, lucide-react, etc.
- Configure path aliases (@/components, @/lib, etc.)

FE-002: Configurazione API Client
- Create lib/api.ts with Axios instance
- Add TypeScript types for Scenario, Metrics, etc.
- Configure environment variable VITE_API_URL

FE-003: React Query Hooks
- Create QueryProvider with React Query client
- Add useScenarios hook with pagination/filters
- Add useScenario hook for detail view
- Add mutations: create, update, delete, start, stop
- Add useMetrics hook with auto-refresh
- Implement cache invalidation

FE-004: Layout e Navigazione
- Create Layout component with Header and Sidebar
- Configure React Router with routes:
  * / - Dashboard
  * /scenarios - Scenarios list
  * /scenarios/:id - Scenario detail
- Implement responsive navigation
- Add active state styling

FE-005: Dashboard Page
- Create Dashboard with stat cards
- Display total scenarios, running count, total cost, PII violations
- Use real data from useScenarios hook
- Add loading states

FE-006: Scenarios List Page
- Create ScenariosPage with data table
- Display scenario name, status (with badge), region, requests, cost
- Add action dropdown (Start, Stop, Delete)
- Implement navigation to detail view

Components Created:
- ui/button.tsx - Button component with variants
- ui/card.tsx - Card component with header/content/footer
- ui/badge.tsx - Badge component for status
- ui/table.tsx - Table component
- ui/dropdown-menu.tsx - Dropdown menu
- ui/toaster.tsx - Toast notifications

Pages Created:
- Dashboard.tsx - Main dashboard view
- ScenariosPage.tsx - List of scenarios
- ScenarioDetail.tsx - Scenario detail with metrics
- NotFound.tsx - 404 page

All features integrated with backend API.

Tasks: FE-001, FE-002, FE-003, FE-004, FE-005, FE-006 complete
2026-04-07 14:58:46 +02:00
Luca Sacchi Ricciardi
b18728f0f9 feat(api): implement complete API layer with services and endpoints
Complete API implementation (BE-006 to BE-010):

BE-006: API Dependencies & Configuration
- Add core/config.py with Settings and environment variables
- Add core/exceptions.py with AppException hierarchy
- Add api/deps.py with get_db() and get_running_scenario() dependencies
- Add pydantic-settings dependency

BE-007: Services Layer
- Add services/pii_detector.py: PIIDetector with email/SSN/credit card patterns
- Add services/cost_calculator.py: AWS cost calculation (SQS, Lambda, Bedrock)
- Add services/ingest_service.py: Log processing with hash, PII detection, metrics

BE-008: Scenarios API Endpoints
- POST /api/v1/scenarios - Create scenario
- GET /api/v1/scenarios - List with filters and pagination
- GET /api/v1/scenarios/{id} - Get single scenario
- PUT /api/v1/scenarios/{id} - Update scenario
- DELETE /api/v1/scenarios/{id} - Delete scenario
- POST /api/v1/scenarios/{id}/start - Start (draft->running)
- POST /api/v1/scenarios/{id}/stop - Stop (running->completed)
- POST /api/v1/scenarios/{id}/archive - Archive (completed->archived)

BE-009: Ingest API
- POST /ingest with X-Scenario-ID header validation
- Depends on get_running_scenario() for status check
- Returns LogResponse with processed metrics
- POST /flush for backward compatibility

BE-010: Metrics API
- GET /api/v1/scenarios/{id}/metrics - Full metrics endpoint
- Aggregates data from scenario_logs
- Calculates costs using CostCalculator
- Returns cost breakdown (SQS/Lambda/Bedrock)
- Returns timeseries data grouped by hour

Refactored main.py:
- Simplified to use api_router
- Added exception handlers
- Added health check endpoint

All endpoints tested and working.

Tasks: BE-006, BE-007, BE-008, BE-009, BE-010 complete
2026-04-07 14:35:50 +02:00
Luca Sacchi Ricciardi
ebefc323c3 feat(backend): implement database layer with models, schemas and repositories
Complete backend core implementation (BE-001 to BE-005):

BE-001: Database Connection & Session Management
- Create src/core/database.py with async SQLAlchemy 2.0
- Configure engine with pool_size=20
- Implement get_db() FastAPI dependency

BE-002: SQLAlchemy Models (5 models)
- Base model with TimestampMixin
- Scenario: status enum, relationships, cost tracking
- ScenarioLog: message hash, PII detection, metrics
- ScenarioMetric: time-series with extra_data (JSONB)
- AwsPricing: service pricing with region support
- Report: format enum, file tracking, extra_data

BE-003: Pydantic Schemas
- Scenario: Create, Update, Response, List schemas
- Log: Ingest, Response schemas
- Metric: Summary, CostBreakdown, MetricsResponse
- Common: PaginatedResponse generic type

BE-004: Base Repository Pattern
- Generic BaseRepository[T] with CRUD operations
- Methods: get, get_multi, count, create, update, delete
- Dynamic filter support

BE-005: Scenario Repository
- Extends BaseRepository[Scenario]
- Specific methods: get_by_name, list_by_status, list_by_region
- Business methods: update_status, increment_total_requests, update_total_cost
- ScenarioStatus enum
- Singleton instance: scenario_repository

All models, schemas and repositories tested and working.

Tasks: BE-001, BE-002, BE-003, BE-004, BE-005 complete
2026-04-07 14:20:02 +02:00
Luca Sacchi Ricciardi
216f9e229c feat(database): seed AWS pricing data
Populate aws_pricing table with real AWS pricing for:

Services:
- SQS: /bin/bash.40 per million requests
- Lambda: /bin/bash.20 per million requests + /bin/bash.0000166667 per GB-second
- Bedrock Claude 3 Sonnet: /bin/bash.003 input / /bin/bash.015 output per 1K tokens

Regions:
- us-east-1 (N. Virginia)
- eu-west-1 (Ireland)

Total: 10 pricing records inserted

Task: DB-007 complete
All database tasks (DB-001 to DB-007) now complete!

Next: Backend team can proceed with SQLAlchemy models and repositories.
2026-04-07 13:55:30 +02:00
Luca Sacchi Ricciardi
26fb4a276f feat(database): create all core tables with migrations
Add database migrations for mockupAWS v0.2.0:

- DB-003: scenario_logs table
  * Stores received log entries with SHA256 hash for deduplication
  * PII detection flags
  * Metrics: size_bytes, token_count, sqs_blocks
  * Indexes on scenario_id, received_at, message_hash, has_pii

- DB-004: scenario_metrics table
  * Time-series storage for metrics aggregation
  * Supports: sqs, lambda, bedrock, safety metric types
  * Flexible JSONB metadata field
  * BRIN index on timestamp for efficient queries

- DB-005: aws_pricing table
  * Stores AWS service pricing by region
  * Supports price history with effective_from/to dates
  * Active pricing flag for current rates
  * Index on service, region, tier combination

- DB-006: reports table
  * Generated report tracking
  * Supports PDF and CSV formats
  * File path and size tracking
  * Metadata JSONB for extensibility

All tables include:
- UUID primary keys with auto-generation
- Foreign key constraints with CASCADE delete
- Appropriate indexes for query performance
- Check constraints for data validation

Tasks: DB-003, DB-004, DB-005, DB-006 complete
2026-04-07 13:53:07 +02:00
Luca Sacchi Ricciardi
6f03c33ab5 feat(database): setup alembic and create scenarios table
- Install alembic and asyncpg for database migrations
- Configure alembic for async SQLAlchemy 2.0
- Create initial migration for scenarios table:
  * UUID primary key with auto-generation
  * Status enum (draft, running, completed, archived)
  * JSONB tags with GIN index
  * Timestamps with auto-update trigger
  * Check constraints for name/region validation
  * Indexes on status, region, created_at
- Test database connection and migration

Task: DB-001, DB-002 complete
2026-04-07 13:48:05 +02:00
Luca Sacchi Ricciardi
18ce380a6d docs: add team kickoff prompt for Fase 1 development 2026-04-07 13:11:49 +02:00
Luca Sacchi Ricciardi
cd6f8ad166 docs: complete architecture specifications and project planning
Add comprehensive technical specifications for mockupAWS v0.2.0:

- export/architecture.md: Complete system architecture with:
  * Layered architecture diagram (Client → API → Service → Repository → DB)
  * Full database schema with DDL SQL (5 tables, indexes, constraints)
  * API specifications (OpenAPI format) for all endpoints
  * Security architecture (auth, PII detection, rate limiting)
  * Data flow diagrams (ingestion, cost calculation, state machine)
  * Technology stack details (backend, frontend, infrastructure)
  * Project structure for backend and frontend
  * 4 Architecture Decision Records (DEC-001 to DEC-004)

- export/kanban.md: Task breakdown with 32 tasks organized in:
  * Database setup (DB-001 to DB-007)
  * Backend models/schemas (BE-001 to BE-003)
  * Backend repositories (BE-004 to BE-008)
  * Backend services (BE-009 to BE-014)
  * Backend API (BE-015 to BE-020)
  * Testing (QA-001 to QA-003)

- export/progress.md: Project tracking initialized with:
  * Current status: 0% complete, Fase 1 setup
  * Sprint planning and metrics
  * Resource links and team assignments

All specifications follow 'Little Often' principle with tasks < 2 hours.
2026-04-07 13:10:12 +02:00
Luca Sacchi Ricciardi
ab4c537c16 feat: add complete development team configuration
Add specialized agent configurations for mockupAWS development:
- @spec-architect: Software architect and specification lead
- @db-engineer: PostgreSQL schema and Alembic migrations
- @backend-dev: FastAPI development and services
- @frontend-dev: React dashboard and UI components
- @devops-engineer: Docker and CI/CD setup
- @qa-engineer: Testing strategy and E2E tests

Update prompt-zero.md with complete team and project structure.
Add prompt-team-standup.md for team kickoff and coordination.

Each agent has detailed configuration with:
- Role and responsibilities
- Technical stack
- Scope and constraints
- Output requirements
- Communication style
2026-04-07 12:58:53 +02:00
Luca Sacchi Ricciardi
59e5cf48f0 feat: initial project setup with scenarios, database and web ui
Add complete mockupAWS platform for AWS cost estimation:
- FastAPI backend with scenario management
- PostgreSQL database schema for scenarios, metrics, logs
- AWS pricing table with real pricing data
- React frontend dashboard (planned)
- PII detection and token counting
- Report generation (PDF/CSV)
- Complete test suite with pytest
- Docker Compose setup
- Documentation: README, PRD, Architecture
- OpenCode configuration (.opencode/)
2026-04-07 12:52:18 +02:00
Luca Sacchi Ricciardi
b539134280 first commit 2026-04-07 11:27:03 +02:00