A comprehensive, production-ready data platform that ingests diverse data sources, transforms data for analytics, and exposes secure REST APIs.
- Data Ingestion: JSON, CSV, XML, Excel, SQL sources
- Incremental Loading: Watermarking techniques for efficient updates
- Data Transformation: Cleansing, normalization, and enrichment
- Data Warehouse: Star schema design in Azure Synapse Analytics
- APIs: Python FastAPI + .NET Core Web API
- Security: Azure Entra ID authentication and RBAC
- Infrastructure: Azure Bicep templates for IaC
- CI/CD: Automated deployment pipelines
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Data Sources βββββΆβ Data Pipeline βββββΆβ Data Warehouse β
β (JSON/CSV/XML) β β (ADF + Python) β β (Synapse SQL) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β .NET API ββββββ Load Balancer βββββΆβ Python API β
β (Swagger UI) β β (App Gateway) β β (FastAPI Docs) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- Python 3.8+
- .NET 8.0 SDK (for .NET API)
- Azure CLI (for deployment)
- Git
git clone <repository-url>
cd GIS_takehome# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Generate sample data files
python3 scripts/generate_sample_data.pyThis creates sample data in the sample_data/ directory:
customers.json,customers.csv,customers.xmlproducts.json,products.csv,products.xmlsales.json,sales.csv,sales.xmlweather.json,weather.csvstocks.json,stocks.csvnews.json,news.csv
# Navigate to API directory
cd api
# Start the server
uvicorn main:app --reload --host 0.0.0.0 --port 8000Access Python API:
- API: http://localhost:8000
- Documentation: http://localhost:8000/docs
- Alternative Docs: http://localhost:8000/redoc
# Navigate to .NET API directory
cd dotnet-api
# Start the server
dotnet runAccess .NET API:
- API: https://localhost:7001
- Swagger: https://localhost:7001/swagger
# Run comprehensive test
python3 scripts/test_with_sample_data.py# Test health endpoints
curl http://localhost:8000/health
curl https://localhost:7001/health
# Test data endpoints
curl http://localhost:8000/api/data/customers
curl https://localhost:7001/api/data/sales| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/docs |
GET | Interactive API docs |
/api/data/customers |
GET | Customer data |
/api/data/products |
GET | Product data |
/api/data/sales |
GET | Sales data |
/api/analytics/summary |
GET | Analytics summary |
/api/monitoring/status |
GET | System status |
/api/auth/login |
POST | User authentication |
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/swagger |
GET | Swagger UI |
/api/data/sales |
GET | Sales data |
/api/analytics/summary |
GET | Analytics summary |
/api/monitoring/status |
GET | System status |
/api/auth/login |
POST | User authentication |
Create a .env file in the project root:
# API Settings
API_SECRET_KEY=your-super-secret-key-with-at-least-32-characters
API_ALGORITHM=HS256
API_ACCESS_TOKEN_EXPIRE_MINUTES=30
# Database
DATABASE_URL=sqlite:///./dataplatform.db
# Azure Settings (for deployment)
AZURE_STORAGE_ACCOUNT_NAME=your-storage-account
AZURE_STORAGE_ACCOUNT_KEY=your-storage-key
AZURE_SYNAPSE_SERVER=your-synapse-server.database.windows.net
AZURE_SYNAPSE_DATABASE=your-synapse-database
AZURE_SYNAPSE_USERNAME=your-username
AZURE_SYNAPSE_PASSWORD=your-password
# CORS
ALLOWED_ORIGINS=["http://localhost:3000", "http://localhost:8000"]
ALLOWED_HOSTS=["localhost", "127.0.0.1"]# Install Azure CLI
brew install azure-cli # macOS
# or download from: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
# Login to Azure
az login# Create resource group
az group create --name rg-data-platform --location "East US"
# Deploy infrastructure
az deployment group create \
--resource-group rg-data-platform \
--template-file infrastructure/main.bicep \
--parameters \
resourceGroupName=rg-data-platform \
location="East US" \
dataPlatformName=your-data-platform \
synapseAdminUsername=admin \
synapseAdminPassword="SecurePassword123!" \
enablePrivateEndpoints=true# Deploy Python API
cd api
az webapp up --name your-python-api --resource-group rg-data-platform --runtime "PYTHON:3.9"
# Deploy .NET API
cd ../dotnet-api
az webapp up --name your-dotnet-api --resource-group rg-data-platform --runtime "DOTNETCORE:8.0"# Run all tests
python3 scripts/test_with_sample_data.py
# Run smoke tests
python3 scripts/smoke-tests.py
# Run performance tests
k6 run infrastructure/performance-tests.js-
Health Checks
curl http://localhost:8000/health curl https://localhost:7001/health
-
API Documentation
- Python: http://localhost:8000/docs
- .NET: https://localhost:7001/swagger
-
Data Endpoints
curl http://localhost:8000/api/data/customers curl https://localhost:7001/api/data/sales
GIS_takehome/
βββ api/ # Python FastAPI
β βββ main.py # Main application
β βββ config.py # Configuration
β βββ auth.py # Authentication
β βββ models.py # Data models
β βββ services.py # Business logic
β βββ middleware.py # Custom middleware
βββ dotnet-api/ # .NET Core API
β βββ Controllers/ # API controllers
β βββ Models/ # Data models
β βββ Services/ # Business services
β βββ Program.cs # Main entry point
βββ data_processing/ # Data pipeline
β βββ ingestion.py # Data ingestion
β βββ transformation.py # Data transformation
β βββ sample_data_sources.py # Sample data generation
βββ infrastructure/ # Azure infrastructure
β βββ main.bicep # Bicep template
β βββ data-factory-pipeline.json # ADF pipeline
βββ scripts/ # Automation scripts
β βββ generate_sample_data.py # Sample data generation
β βββ test_with_sample_data.py # Comprehensive testing
β βββ deploy.py # Deployment script
βββ sample_data/ # Generated sample data
βββ tests/ # Test files
βββ requirements.txt # Python dependencies
βββ README.md # This file
- Authentication: JWT tokens with Azure Entra ID
- Authorization: Role-based access control (RBAC)
- Secrets: Azure Key Vault integration
- Network: Private endpoints and network security groups
- Data: Encryption at rest and in transit
- Application Insights: Performance monitoring
- Azure Monitor: Infrastructure monitoring
- Health Checks: API health monitoring
- Logging: Structured logging with Serilog/structlog
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License.
-
Import Errors
# Ensure virtual environment is activated source venv/bin/activate # Reinstall dependencies pip install -r requirements.txt
-
Port Already in Use
# Kill process using port 8000 lsof -ti:8000 | xargs kill -9
-
Database Connection Issues
- Check
.envfile configuration - Ensure SQLite file is writable
- For Azure: verify connection strings
- Check
-
Azure Deployment Issues
# Check Azure CLI login az account show # Verify resource group exists az group show --name rg-data-platform
- Check the documentation in
/docsdirectory - Review the API documentation at
/docsendpoints - Check logs for detailed error messages
- Ensure all prerequisites are installed
- Test the APIs using the provided endpoints
- Explore the documentation at
/docsand/swagger - Deploy to Azure using the provided scripts
- Customize the platform for your specific needs
- Extend with additional data sources and transformations
Happy coding! π