How shashankvemuri/economic-dashboard works
Project type and purpose
• This is a monolithic full-stack single-page dashboard application built with Python and Plotly Dash.
• Purpose: display macroeconomic and stock market data (sentiment indicators, unemployment, inflation, treasury rates) via interactive graphs and tables.
File structure
• app.py: main Dash server script that initializes the app, sets up layout, and registers page callbacks.
• pages/: modular sub-pages (economy.py, indices.py, sentiment.py) each define a section’s layout and callbacks.
• assets/: CSS/SCSS styling (boot-swatch theme, custom variables). Dash will auto-serve these under /assets.
• data_functions.py: business-logic layer for data retrieval, processing, and transformation.
• render.yaml: deployment configuration for Render.com (defines service type, build/runtime commands, environment).
• requirements.txt: Python dependencies.
• README.md: project overview, install/run instructions, deployment URL.
README for additional insights
• Confirms purely Python/Dash stack with no external database—data likely fetched on demand via APIs or CSVs inside data_functions.py.
• Deployment on Render.com, serving at port 8050 by default.
Main components and interactions
a. Components
• User’s web browser (front end)
• Dash server (app.py entry point)
• Page modules (economy.py, indices.py, sentiment.py)
• Business logic module (data_functions.py)
• Assets server (CSS/SCSS files under assets/)
• External data sources (e.g., FRED API, Yahoo Finance, local CSVs)
• Deployment environment (Render.com container)
b. Relationships & data flow
1. User interacts with browser UI → sends HTTP requests over WebSocket/REST to Dash server.
2. Dash server routes requests to appropriate page module callback.
3. Page callback invokes data_functions to fetch/process data.
4. data_functions retrieves raw data from external APIs or local files.
5. Processed data returned to callback → rendered as graphs/tables in browser.
6. Browser downloads CSS/JS from assets folder served by the Dash server.
7. Deployment layer (Render.com) wraps entire Dash server in a container, exposing port 8050 behind a load balancer/HTTPS.
Architectural patterns & design principles
• Modular page-based routing (Dash multipage architecture).
• Separation of concerns: UI layout and callbacks in pages/, data access in data_functions.py, styling in assets/.
• Single-process monolith; no microservices.
• Stateless server: each request invokes fresh data fetch; no persistent session state.
Relevant technologies, frameworks, libraries
• Python 3.x, Plotly Dash, pandas (probable), requests (for API calls), SCSS bootstrap theme.
• Render.com for PaaS deployment (render.yaml).
• Git for version control.