How kavithranch/ranchedge works
Main System Components
a) Frontend Layer:
• Flask templates structure
• Hierarchy of base templates and specific sports pages
• Static assets management
b) Backend Layer:
• Flask application core
• Routes handling
• Model definitions
• Database interactions
c) Data Layer:
• Database storage
• API integration points
• Data fill scripts
┌─ Frontend Layer ─────────────┐ ┌─ External Services ─┐
• ┌─ Templates ──────────────┐ │ │ │
• base.html │ │ │ Sports APIs │
• base_stats.html │ │ │ Betting APIs │
• Sport-specific pages │ │ │ │
• ┘ │ └─────────────────────┘
• ▲
• ┬───────────────┘ │
• ▼ │
┌─ Backend Layer ──────────────┐ │
• ┌─ Flask Application ───────┐│ │
• Routes ││ │
• Models ││◄────────────┘
• Business Logic ││
• ┘│
• ┬───────────────┘
• ▼
┌─ Data Layer ───────────────┐
• ┌─ Database ─────────────┐ │
• Teams │ │
• Stats │ │
• Betting Data │ │
• ┘│
• ┌─ Data Scripts ─────────┐ │
• Fill Scripts │ │
• Update Scripts │ │
• ┘│
• ┘
Important Architectural Aspects to Highlight
a) Data Flow:
• How data moves from external APIs through the backend
• How the fill scripts populate the database
• Demonstrate the flow from database to frontend views
b) Component Separation:
• Clear distinction between frontend templates and backend logic
• Separate data management layer
• External service integration points
Notes for Implementation
• Keep the database schema separate but referenced
• Version information (currently moving toward 1.3.0)
• Planned features (like NFL and NHL expansion)