A modern financial data warehouse built with FastAPI and Cassandra, featuring temporal database capabilities for complete audit trails and historical data tracking.
Academic Project - West University of Timisoara
Big Data Data Warehouse Course | Author: Patru Gheorghe Eduard | 2025
- π Temporal Database: Complete audit trail with versioned records (no data loss)
- π Multi-Asset Support: Stocks, bonds, currencies, derivatives
- β‘ Real-time Data: Automated Nasdaq data ingestion with coverage tracking
- π¨ Modern Web UI: Responsive interface with interactive charts
- π High Performance: FastAPI + Cassandra scaling
- π Type Safety: Full Pydantic validation and auto-generated docs
- π Smart Ingestion: Automatic data source filtering and coverage extension
- π Data Refresh: Temporal versioning for data updates without loss
βββ src/
β βββ api/ # FastAPI routes and models
β βββ models/ # Data models and repositories
β βββ services/ # Business logic
β βββ utils/ # Database utilities
β βββ resources/ # Connection files
βββ web/ # Frontend interface
βββ requirements.txt # Dependencies
βββ setup_and_run.sh # Automated setup
- Python 3.9+
- Nasdaq Data Link API Key (free)
- DataStax Astra Database (free)
git clone https://github.com/patrueduard03/nasdaq-cassandra-dw-fin-api
cd nasdaq-cassandra-dw-fin-api
chmod +x setup_and_run.sh
./setup_and_run.sh
git clone https://github.com/patrueduard03/nasdaq-cassandra-dw-fin-api
cd nasdaq-cassandra-dw-fin-api
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
- Sign up at Nasdaq Data Link
- Account Settings β API Key β Copy
- Create account at DataStax Astra
- Create database with keyspace
lectures
- Download: secure connect bundle (ZIP) + token file (JSON)
- Place files in
src/resources/
Create .env
file in project root:
NASDAQ_DATA_LINK_API_KEY=your_api_key_here
SECURE_CONNECT_BUNDLE=src/resources/secure-connect-your-db.zip
SECURE_TOKEN=src/resources/your-db-token.json
python src/utils/create_tables.py # Create database tables
python src/main.py # Start application
- π± Web Interface: http://localhost:8000/web/
- π API Documentation: http://localhost:8000/docs
- π API Base: http://localhost:8000/
- Import
financial-data-warehouse.postman_collection.json
into Postman - Or use interactive docs at http://localhost:8000/docs
python src/utils/create_tables.py # Initialize tables
python src/utils/test_nasdaq_datalink.py # Test API connection
python src/utils/truncate_tables.py # Clear data
python src/utils/drop_tables.py # Drop all tables
tail -f logs/app.log # Application logs
tail -f logs/ingestion.log # Data ingestion logs
GET /assets
- List active assetsPOST /assets
- Create assetPUT /assets/{id}
- Update asset (creates version)DELETE /assets/{id}
- Soft deleteGET /admin/assets/all
- All versions + deleted
GET /data-sources
- List active sourcesPOST /data-sources
- Create sourcePUT /data-sources/{id}
- Update sourceDELETE /data-sources/{id}
- Soft deletePOST /data-sources/{id}/resurrect
- Restore deleted sourceGET /admin/data-sources/all
- All versions + deletedGET /data-sources/provider/{provider}
- Get by provider
GET /time-series/{asset_id}/{source_id}
- Get dataGET /time-series/{asset_id}/{source_id}?start_date=2024-01-01&end_date=2024-12-31
- Date range
POST /ingest/nasdaq
- Import Nasdaq dataPOST /ingest/nasdaq/refresh
- Refresh existing data with temporal versioningGET /ingest/status
- Get ingestion status for assetsGET /ingest/availability/{asset_id}/{data_source_id}
- Check data availabilityGET /ingest/compatible-data-sources/{asset_id}
- Get compatible data sourcesGET /ingest/progress/{session_id}
- Get ingestion progress by session
GET /
- Health checkGET /health
- Detailed health check with database connectivityGET /docs
- API documentationGET /web/
- Web interfaceWS /ws
- WebSocket endpoint for real-time progress updates
This system implements a temporal database with:
- β No Data Loss: Changes create new versions, never overwrite
- π Complete History: Track who, what, when, and why
- π Point-in-Time: Query data as it existed at any date
- ποΈ Soft Deletion: Mark deleted but preserve records
- π Version Control: Multiple versions of each entity
valid_from/valid_to
- Business time (real-world validity)system_date
- System time (record creation)is_deleted
- Soft deletion flag9999-12-31
- Far-future date for current records
- Backend: FastAPI, Python 3.9+
- Database: Apache Cassandra (DataStax Astra)
- Frontend: HTML5, CSS3, JavaScript, Bootstrap 5, Chart.js
- Data Source: Nasdaq Data Link API
fastapi
- Modern web frameworkcassandra-driver
- Database connectivitypydantic
- Data validationnasdaq-data-link
- Financial data APIuvicorn
- ASGI server