How projectultra/finance_metrics works
Project type and purpose
• This is a full-stack Django web application (“FM” project) for fetching live stock, currency, commodity, and news data, preprocessing it, running it through a TensorFlow/Keras model, and displaying predicted prices in a browser.
• Key functionality:
• Live data ingestion from an external API
• Data preprocessing and transformation
• ML inference via a saved TensorFlow Keras model
• Presentation of results via HTML templates
File structure
• Top-level directories and files
• FM/ – Django project settings, URLs, WSGI/ASGI entry points
• FinanceMetrics/ – Django app containing models, views, templates, migrations
• Stock Data/ – sample CSVs, a Jupyter notebook, and the saved TensorFlow model artifacts
• db.sqlite3 – local database
• Dockerfile, .github/workflows – containerization and CI pipelines
• requirements.txt – Python dependencies
• manage.py – Django command-line utility
• Architectural cues
• MVC pattern (Models in FinanceMetrics/models.py, Views in views.py, Templates in Templates/)
• ORM migrations for evolving data schema
• Integration of a machine‐learning model as part of the application
README for additional insights
• Confirms tech stack: Python, Django, TensorFlow, Keras, HTML/CSS
• Describes how live data is fetched, preprocessed, and fed to a trained model
• Shows screenshots of UI sections (stocks, currencies, commodities, news)
a. Main components
• Client Browser (UI)
• Django Web Server
– URL Router (FM/urls.py)
– Views/Controllers (FinanceMetrics/views.py)
– Template Renderer (FinanceMetrics/Templates/*.html)
– ORM & Database Layer (FinanceMetrics/models.py + SQLite)
– ML Inference Module (loads TensorFlow model from Stock Data/models)
• External Stock Data API
• Static Asset Server (images/, CSS)
• CI/CD Pipeline (GitHub Actions, Dockerfile)
b. Relationships and interactions
1. User requests a page in the browser
2. Django URL router dispatches to the view
3. View calls a service to fetch live data from External API
4. Data flows into preprocessing routines
5. Preprocessed data is passed into the ML Inference Module
6. Model returns predictions
7. View writes results to the ORM for optional logging (SQLite)
8. Template Renderer builds the HTML response
9. Browser displays results; static assets are loaded in parallel
c. Architectural patterns and design principles
• MVC (Models, Views, Templates)
• Single monolithic service with clearly separated layers
• Reuse of Django’s built-in ORM and templating
• ML model as an internal library – could be factored out to a micro-service if scalability demands
d. Key technologies and libraries
• Django (web framework, routing, ORM, templating)
• SQLite (development database)
• TensorFlow & Keras (model inference)
• Python scripts/notebooks (data exploration in Stock Data/)
• Docker & GitHub Actions (container build and CI/CD)