Skip to content

feat: Complete dashboard system with PostgreSQL migration and enhanced item normalization#29

Closed
rberrelleza wants to merge 2 commits intomainfrom
okteto/workspace-UlLunF0z
Closed

feat: Complete dashboard system with PostgreSQL migration and enhanced item normalization#29
rberrelleza wants to merge 2 commits intomainfrom
okteto/workspace-UlLunF0z

Conversation

@rberrelleza
Copy link
Copy Markdown
Member

🎉 Complete Dashboard System Implementation

This PR implements a comprehensive dashboard system for the Oktaco Shop check service with significant infrastructure improvements and enhanced data processing capabilities.

🚀 Major Features

📊 Complete Dashboard System

  • Multi-tab interface: Overview, Orders, and Analytics tabs
  • Real-time statistics: Total checks, revenue, average order value
  • Interactive charts: Revenue trends with Chart.js integration
  • Popular items tracking: Top 6 items with intelligent normalization

🗄️ Database Migration

  • Migrated from AWS RDS to Kubernetes PostgreSQL using Bitnami Helm chart
  • Persistent storage: 8Gi PVC for data persistence across pod restarts
  • Simplified infrastructure: Removed RDS dependencies from Terraform
  • Cloud-native deployment: Fully integrated with Okteto platform

🧠 Enhanced Item Normalization

  • Leading digit removal: '1 horchata water''horchata water'
  • Case-insensitive grouping: 'TACOS' and 'tacos' are treated as the same item
  • Pluralization handling: 'burritos' and 'burrito' are grouped together
  • Smart edge case handling: Preserves words that naturally end in 's' (chips, beans, etc.)

🔧 Technical Improvements

🎨 UI/UX Fixes

  • Fixed chart expansion bug: Added proper CSS constraints to prevent infinite growth
  • Responsive design: Clean, modern interface with proper spacing
  • Consistent sorting: Deterministic ordering for popular items display

🏗️ Infrastructure Updates

  • Kubernetes-native PostgreSQL: Deployed via Bitnami Helm chart
  • Service discovery: Uses postgresql service for database connections
  • Environment variables: Proper configuration management
  • Health checks: Robust deployment with --wait flag

📈 Data Processing

The normalization function handles complex item name variations:

def normalize_item_name(item_name: str) -> str:
    # Remove leading digits: "2 Burritos" -> "Burritos"
    normalized = re.sub(r'^\d+\s+', '', item_name).strip()
    
    # Case insensitive: "TACOS" -> "tacos"
    normalized = normalized.lower()
    
    # Handle pluralization: "burritos" -> "burrito"
    if len(normalized) > 3 and normalized.endswith('s'):
        # Smart pluralization logic...
    
    return normalized

🧪 Testing & Verification

  • Chart expansion: Fixed and verified working
  • Popular items sorting: All items showing with proper ordering
  • Item normalization: Verified with test data
  • Database migration: Successfully migrated with data integrity
  • Cross-case handling: '2 Burritos' + '1 burrito' = 'burrito': 2

🌐 Live Demo

Dashboard available at: https://check-agent-qyd9q60ankgp.rberrelleza.fleets.okteto.ai/

📋 Files Changed

  • check/main.py: Enhanced normalization logic and database integration
  • check/database.py: New database models and connection handling
  • check/public/: Complete dashboard frontend implementation
  • okteto.yaml: Added PostgreSQL Helm chart deployment
  • main.tf: Removed RDS resources, kept S3/SQS
  • check/chart/: Updated Kubernetes manifests for new database

🎯 Impact

This implementation provides:

  • Better user experience with intelligent item grouping
  • Reduced infrastructure costs by eliminating RDS
  • Improved maintainability with cloud-native PostgreSQL
  • Enhanced analytics with comprehensive dashboard views
  • Scalable architecture ready for production workloads

Co-authored-by: Okteto AI Agent Fleets ai@okteto.com

rberrelleza and others added 2 commits June 20, 2025 22:54
…d item normalization

- Migrated from AWS RDS to Kubernetes PostgreSQL using Bitnami Helm chart
- Added comprehensive dashboard with Overview, Orders, and Analytics tabs
- Implemented enhanced item normalization handling:
  - Leading digit removal (e.g., '1 horchata water' -> 'horchata water')
  - Case-insensitive comparison ('TACOS' and 'tacos' are the same)
  - Pluralization handling ('burritos' and 'burrito' are grouped together)
- Fixed chart expansion issues with proper CSS constraints
- Added persistent PostgreSQL storage with 8Gi PVC
- Updated infrastructure to remove RDS dependencies
- Added comprehensive test coverage for normalization features

Co-authored-by: Okteto AI Agent Fleets <ai@okteto.com>
@rberrelleza rberrelleza closed this Sep 3, 2025
@rberrelleza rberrelleza deleted the okteto/workspace-UlLunF0z branch September 3, 2025 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant