A comprehensive, production-ready dashboard that aggregates and visualizes real-time data from multiple public APIs. Built with FastAPI backend and Streamlit frontend featuring a modern, responsive design with fixed header navigation.
- π Overview: Key metrics and quick insights across all services
- βΏ Crypto Dashboard: Live cryptocurrency prices, charts, and trending coins
- π€οΈ Weather: Current weather and forecasts with interactive temperature charts
- π IP Info: IP address lookup with geolocation mapping and ISP details
- π Trending: GitHub repos, Hacker News, and Dev.to trending content
- π° News: Headlines, tech news, and cryptocurrency news aggregation
- π Events: Real-time application events and custom logging system
- CoinGecko: Cryptocurrency prices, market data, and trending coins
- OpenWeatherMap: Weather information and 5-day forecasts
- IPInfo: IP address geolocation and network details
- GitHub: Trending repositories by language and timeframe
- Hacker News: Top stories and trending tech discussions
- Dev.to: Trending developer articles and tutorials
- NewsAPI: Headlines and search (with free alternatives)
- LogSnag: Event logging and monitoring (optional)
git clone https://github.com/Daniel-wambua/Datapulse.git
cd api_dashboard
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Copy environment template
cp .env.example .env
# Edit .env with your API keys (optional for basic functionality)
nano .env- OpenWeatherMap: Get free API key (50,000 calls/month free)
- IPInfo: Get free API key (50,000 requests/month free)
- NewsAPI: Get free API key (1,000 requests/day free)
- GitHub Token: Create personal access token (higher rate limits)
- LogSnag: Get API key (event logging and monitoring)
- CoinGecko (no key required, 10-50 calls/minute)
- Hacker News (unlimited, public API)
- Dev.to (unlimited, public API)
- Alternative news sources when NewsAPI unavailable
# Start FastAPI backend
uvicorn app:app --host 0.0.0.0 --port 8000 --reload
# Start Streamlit frontend
streamlit run dashboard.py --server.port 8501# Make script executable
chmod +x start.sh
# Run both services
./start.sh# Build and run with Docker
docker build -t api-dashboard .
docker run -p 8000:8000 -p 8501:8501 api-dashboard
# Or use Docker Compose (recommended)
docker-compose up --build- π₯οΈ Streamlit Dashboard: http://localhost:8501
- π FastAPI Documentation: http://localhost:8000/docs
- π§ API Endpoints: http://localhost:8000
πͺ Crypto Endpoints (Click to expand)
- `GET /crypto/prices` - Current cryptocurrency prices (top 10) - `GET /crypto/history/{coin_id}` - Historical price data with charts - `GET /crypto/trending` - Trending cryptocurrencies - `GET /crypto/global` - Global market statisticsExample Response:
{
"prices": [
{"id": "bitcoin", "name": "Bitcoin", "price": 43250.50, "change_24h": 2.34},
{"id": "ethereum", "name": "Ethereum", "price": 2580.75, "change_24h": -1.22}
]
}π€οΈ Weather Endpoints (Click to expand)
GET /weather/current?city={city}- Current weather conditionsGET /weather/forecast?city={city}- 5-day weather forecastGET /weather/coordinates?lat={lat}&lon={lon}- Weather by coordinates
Example Usage:
curl "http://localhost:8000/weather/current?city=London"
curl "http://localhost:8000/weather/forecast?city=New York"π IP Info Endpoints (Click to expand)
GET /ip-info- Current public IP informationGET /ip-info?ip={ip}- Specific IP address lookup
Example Response:
{
"ip": "8.8.8.8",
"city": "Mountain View",
"region": "California",
"country": "US",
"org": "Google LLC"
}π Trending Endpoints (Click to expand)
GET /trending/github- GitHub trending repositoriesGET /trending/hackernews- Hacker News top storiesGET /trending/devto- Dev.to trending articles
Query Parameters:
language- Filter GitHub repos by programming languagesince- Time period (daily, weekly, monthly)limit- Number of results (default: 10)
π° News Endpoints (Click to expand)
GET /news/headlines- Top news headlinesGET /news/search?q={query}- Search news articlesGET /news/tech- Technology newsGET /news/crypto- Cryptocurrency news
Features:
- Real-time news aggregation
- Multiple source fallbacks
- Category filtering
- Search functionality
π Events Endpoints (Click to expand)
GET /events- Recent application eventsPOST /events/log- Log custom event
Event Types:
- API calls and response times
- Error tracking and monitoring
- User interaction logging
- System performance metrics
π API Base URL & Authentication (Click to expand)
Base URL: http://localhost:8000
Interactive Documentation:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
Authentication:
- Most endpoints work without authentication
- API keys are optional but provide higher rate limits
- Rate limiting: 100 requests per minute per IP
# API Keys (Optional but Recommended)
OPENWEATHER_API_KEY=your_key_here # Weather data
IPINFO_API_KEY=your_key_here # IP geolocation
NEWS_API_KEY=your_key_here # News headlines
GITHUB_TOKEN=your_token_here # Higher rate limits
LOGSNAG_API_KEY=your_key_here # Event logging
LOGSNAG_PROJECT=your_project_name # LogSnag project
# App Configuration
FASTAPI_HOST=0.0.0.0
FASTAPI_PORT=8000
STREAMLIT_PORT=8501
DEBUG=True
# Cache Configuration
CACHE_TTL_SECONDS=300 # 5 minutes defaultdocker build -t api-dashboard .# Basic run
docker run -p 8000:8000 -p 8501:8501 api-dashboard
# With environment file
docker run --env-file .env -p 8000:8000 -p 8501:8501 api-dashboard
# With persistent cache volume
docker run -v ./cache:/app/cache -p 8000:8000 -p 8501:8501 api-dashboard# Connect GitHub repo to Railway
# Automatic deployments on git push
# Environment variables via dashboard# Install Heroku CLI and login
heroku create api-dashboard
heroku config:set OPENWEATHER_API_KEY=your_key
git push heroku mainname: api-dashboard
services:
- name: web
source_dir: /
github:
repo: your-username/api-dashboard
branch: main
run_command: ./start.sh
environment_slug: python
instance_count: 1
instance_size_slug: basic-xxs
ports:
- http_port: 8501
name: streamlit
- http_port: 8000
name: fastapi- Async Operations: All API calls use httpx async client
- Connection Pooling: Efficient HTTP connection reuse
- Caching Strategy: Smart TTL-based caching reduces API calls
- Error Handling: Graceful degradation when services unavailable
# Fork and clone
git clone https://github.com/Daniel-wambua/Datapulse.git
cd api_dashboard
# Create feature branch
git checkout -b feature/your-feature-name
# Install development dependencies
pip install -r requirements.txt
# Make changes and test
python test_setup.py # Verify setup
# Commit and push
git commit -m "Add: your feature description"
git push origin feature/your-feature-name- Create Service Module: Add to
services/directory - Follow Patterns: Use existing services as templates
- Add Caching: Implement TTL-based caching
- Error Handling: Include try/catch and fallbacks
- API Endpoints: Add FastAPI endpoints in
app.py - UI Components: Add dashboard section in
dashboard.py - Documentation: Update README and API docs
- API Status: All endpoints include health monitoring
- Database: Cache database connectivity verification
- External APIs: Availability monitoring for all services
- Performance: Response time tracking
- CoinGecko: Comprehensive cryptocurrency data API
- OpenWeatherMap: Reliable weather information service
- IPInfo: Accurate IP geolocation services
- GitHub API: Repository and trending data
- Hacker News: Tech community discussions and stories
- Dev.to: Developer articles and tutorials
- FastAPI: High-performance async web framework
- Streamlit: Rapid data app development framework
- Plotly: Interactive data visualization library
This project is licensed under the MIT LICENSE. See LICENSE file for details.
- Documentation: Check this README and
/docsendpoint - Issues: Create GitHub issue with detailed description
- Features: Submit feature request with use case
- Security: Report security issues privately
- Discussions: GitHub Discussions for questions
- Contributions: Pull requests welcome
- Feedback: Issues and feature requests appreciated
- Responsive Layout: Works on all screen sizes
- Performance: Optimized CSS and resource loading
β Star this repository if you find it useful!
Built with β€οΈ by havoc using FastAPI, Streamlit.

