A beautiful, modern web application built with Flask that aggregates data from multiple APIs into one stunning, interactive dashboard. No database required for basic features - everything runs in your browser!
- Global Trending News from 13 countries
- Local News Detection - Auto-detect your location for city-specific news
- 7 News Categories with emoji icons (Tech, Business, Sports, Health, etc.)
- Real-time Search with smart filtering
- Load More pagination for endless browsing
- GPS Auto-Detection - One-click location detection
- Save Unlimited Cities - Quick-access to your favorite locations
- 5-Day Detailed Forecast - Temperature, humidity, wind, and more
- Beautiful Weather Icons - Visual weather representation
- Sunrise/Sunset Times - Plan your day better
- Live Prices for 100+ cryptocurrencies
- Portfolio Management - Track your crypto investments
- Profit/Loss Calculations - See real-time gains and losses
- Price Alerts - Get notified when prices hit your targets
- Trending Coins - Discover what's hot in crypto
- No API Key Required - Uses free CoinGecko API
- Search Millions of Repos - Find any public repository
- Trending Repos - Daily, weekly, and monthly trends
- Language Filtering - Browse by programming language
- Detailed Analytics - Stars, forks, contributors, and more
- Works Without Token - 60 requests/hour (perfect for personal use)
- โจ Modern Glassmorphism UI - Frosted-glass effect cards
- ๐จ Purple Gradient Background - Eye-catching aesthetic
- ๐ซ Smooth Animations - Fade-in effects and hover transitions
- ๐ฑ Fully Responsive - Perfect on mobile, tablet, and desktop
- ๐ฏ Intuitive Navigation - Clean, easy-to-use interface
- โก Fast Loading - Optimized for performance
git clone https://github.com/b5119/flask-api-dashboard.git
cd flask-api-dashboard
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txtTakes 5 minutes total! See SETUP_GUIDE.md for detailed instructions.
- NewsAPI (2 min): https://newsapi.org/register
- OpenWeatherMap (2 min): https://openweathermap.org/api
- GitHub Token (1 min, optional): https://github.com/settings/tokens
- CoinGecko: No key needed! โจ
SECRET_KEY=your-super-secret-key-change-this
NEWSAPI_KEY=your_newsapi_key_here
OPENWEATHER_API_KEY=your_openweathermap_key_here
GITHUB_TOKEN=optional_github_token
FLASK_ENV=developmentpython run.pyVisit: http://localhost:5000 ๐
flask-api-dashboard/
โโโ app/
โ โโโ __init__.py # Application factory + extensions initialization
โ โโโ models.py # SQLAlchemy models (User, Articles, CryptoHoldings, etc.)
โ โ
โ โโโ api/ # External API integrations (service layer)
โ โ โโโ news_api.py # NewsAPI service wrapper
โ โ โโโ weather_api.py # OpenWeatherMap service wrapper
โ โ โโโ crypto_api.py # CoinGecko client utilities
โ โ โโโ github_api.py # GitHub REST API wrapper
โ โ โโโ tracker.py # Crypto alerting + portfolio tracking tools
โ โ โโโ github_analytics_core.py # GitHub repo analytics engine
โ โ
โ โโโ routes/ # Route handlers (controllers)
โ โ โโโ main.py # Dashboard home view
โ โ โโโ news.py # News routes
โ โ โโโ weather.py # Weather routes
โ โ โโโ crypto.py # Crypto tracking routes
โ โ โโโ github.py # GitHub stats/explorer routes
โ โ
โ โโโ templates/ # Jinja2 HTML views
โ โ โโโ base.html # Shared base layout
โ โ โโโ index.html # Main dashboard UI
โ โ โโโ news.html # News UI
โ โ โโโ weather.html # Weather UI
โ โ โโโ crypto.html # Crypto portfolio UI
โ โ โโโ github.html # GitHub analytics UI
โ โ
โ โโโ static/ # Frontend assets
โ โ โโโ css/
โ โ โ โโโ style.css # Global styling
โ โ โโโ js/
โ โ โ โโโ main.js # Interactive UI logic
โ โ โโโ img/ # Logos, screenshots, icons
โ โ
โ โโโ __init__.py # Package init
โ
โโโ config.py # Configuration classes (Production, Dev, Test)
โโโ run.py # App entry point
โโโ requirements.txt # Python dependency list
โ
โโโ SETUP_GUIDE.md # How to install & run the project
โโโ IMPROVEMENTS.md # Future upgrade notes
โโโ README.md # Project documentation
| Technology | Version | Purpose |
|---|---|---|
| Flask | 3.0.0 | Web framework |
| Flask-SQLAlchemy | 3.1.1 | Database ORM |
| Flask-Migrate | 4.0.5 | Database migrations |
| Requests | 2.31.0 | HTTP library |
| Python-dotenv | 1.0.0 | Environment variables |
| Technology | Purpose |
|---|---|
| Bootstrap 5 | Responsive CSS framework |
| jQuery 3.7.1 | DOM manipulation & AJAX |
| Font Awesome 6.4 | Beautiful icons |
| Google Fonts (Poppins) | Modern typography |
| Custom CSS | Glassmorphism effects |
| API | Cost | Usage Limit | Purpose |
|---|---|---|---|
| NewsAPI | FREE | 100 req/day | News articles from 90+ sources |
| OpenWeatherMap | FREE | 1,000 req/day | Weather data & forecasts |
| CoinGecko | FREE | Unlimited โจ | Cryptocurrency prices |
| GitHub | FREE | 60 req/hour (5K with token) | Repository data |
- 13 Countries Supported: ๐บ๐ธ ๐ฌ๐ง ๐จ๐ฆ ๐ฆ๐บ ๐ฉ๐ช ๐ซ๐ท ๐ฏ๐ต ๐ฎ๐ณ ๐จ๐ณ ๐ง๐ท ๐ฟ๐ฆ ๐ณ๐ฌ ๐ฐ๐ช
- 7 Categories: General, Business, Technology, Entertainment, Health, Science, Sports
- Real-time Search: 500ms debounce for efficient API usage
- Smart Filtering: Combine country + category + search
- Load More: Infinite scroll with pagination
- GPS Detection: Browser geolocation API
- City-Specific News: Get news from your location
- Smart Fallback: Shows country news if city news unavailable
- One-Click Location: "Detect Location" button
Example Usage:
1. Click "Local News" tab
2. Click "Detect Location" โ Allow browser permission
3. See news specific to your city!
4. Filter by category for focused content
- Auto-Detection: Uses browser GPS to find your city
- Save Cities: Unlimited favorite locations in localStorage
- 5-Day Forecast: Detailed predictions with hourly breakdown
- Visual Icons: Weather-specific icons (sun, cloud, rain, etc.)
- Detailed Metrics: Temperature, humidity, wind, pressure, cloudiness
- Default City Memory: Remembers last searched city
- Quick Switch: Click any saved city badge for instant weather
- Beautiful Cards: Modern forecast cards with daily summaries
- Sunrise/Sunset: Plan your day around daylight hours
Example Usage:
1. Click "My Location" โ Auto-loads your weather
2. Search "Tokyo" โ See Tokyo's weather
3. Click "Save" โ Tokyo added to favorites
4. Click "Tokyo" badge anytime โ Instant weather
- Add Holdings: Track any cryptocurrency you own
- Real-time Valuation: See current value of your portfolio
- Profit/Loss Tracking:
- $ gain/loss per holding
- % gain/loss with color coding
- Total portfolio P/L
- Purchase History: Remember when and at what price you bought
- Set Targets: Alert when price goes above/below target
- Multiple Alerts: Unlimited price alerts
- Easy Management: View and remove alerts anytime
- LocalStorage: No server required, saved in browser
- Top 50 Coins: Sorted by market cap
- Search Coins: Find any crypto quickly
- Quick Add: One-click portfolio addition from price table
- Detailed Metrics: Price, 24h/7d change, market cap
- Auto-Refresh: Updates every 60 seconds
Example Usage:
Portfolio:
1. Go to "My Portfolio" tab
2. Enter: bitcoin, amount: 0.5, price: $40,000
3. Click "Add to Portfolio"
4. See real-time value and profit/loss!
Alerts:
1. Go to "Alerts" tab
2. Enter: bitcoin, target: $50,000, condition: above
3. Create alert
4. Get notified when Bitcoin hits $50K
- Repository Search: Find any public repository
- Trending Repos: See what's hot (daily/weekly/monthly)
- Language Filter: Browse by programming language
- Detailed Info: Stars, forks, description, language
- Repository Details: Full metadata
- Contributors: See who's building the project
- Languages: Code language breakdown
- Commits: Recent activity
- Issues & PRs: Development status
No Token Required: Works out-of-the-box with 60 requests/hour!
All user preferences saved in browser (no server-side database needed):
localStorage.setItem('weather_saved_cities', ['London', 'Tokyo', 'Paris']);
localStorage.setItem('weather_default_city', 'London');localStorage.setItem('crypto_portfolio', [{
id: 1234567890,
coinId: 'bitcoin',
amount: 0.5,
purchasePrice: 40000,
purchaseDate: '2025-01-01'
}]);
localStorage.setItem('crypto_alerts', [{
coinId: 'ethereum',
targetPrice: 3000,
condition: 'above'
}]);- โ No Database Setup: Works immediately
- โ Privacy-Friendly: Data stays on your device
- โ Instant Access: No server round-trips
- โ Offline-Ready: Saved data available offline
- โ No Authentication Required: Start using immediately
- Glassmorphism: Frosted-glass effect with backdrop blur
- Gradient Background: Purple gradient (667eea โ 764ba2)
- Poppins Font: Modern, clean typography
- Smooth Animations: CSS transitions and keyframes
- Hover Effects: Scale transforms and shadow effects
- Toast Notifications: Non-intrusive success/error messages
- Loading Spinners: Animated while fetching data
- Empty States: Helpful messages when no data
- Error Handling: Clear error messages with recovery options
- Responsive Design: Mobile-first approach
- Color contrast ratios meet WCAG standards
- Keyboard navigation support
- Screen reader friendly
- Focus indicators on interactive elements
| API | Free Limit | Perfect For | Upgrade |
|---|---|---|---|
| NewsAPI | 100 req/day | โ Check news 4-5 times daily | $449/month |
| OpenWeatherMap | 1,000 req/day | โ Check every 2 minutes! | $40/month |
| GitHub (no token) | 60 req/hour | โ Casual browsing | FREE (5K with token) |
| CoinGecko | Unlimited | โ No restrictions! | Always free โค๏ธ |
๐ก Pro Tip: Free tiers are MORE than enough for personal use!
- Efficient API Calls: Batch requests where possible
- Error Handling: Graceful fallbacks for API failures
- Request Timeouts: 10-second timeout on all API calls
- Class-based APIs: Reusable, maintainable code
- Debounced Search: 500ms delay prevents excessive API calls
- Lazy Loading: Load data only when tabs are active
- Auto-Refresh: Smart refresh only for visible content
- Image Optimization: Placeholder images for missing content
- LocalStorage Caching: Reduce server requests
- Optimistic UI: Instant feedback before API response
- Progressive Enhancement: Works even if some APIs fail
- Graceful Degradation: Fallbacks for missing data
- Loading States: Visual feedback during data fetch
- โ
Environment Variables: Sensitive data in
.env - โ No API Keys in Frontend: All keys server-side
- โ CSRF Protection: Flask-WTF enabled
- โ SQL Injection Prevention: SQLAlchemy ORM
- โ XSS Protection: Jinja2 auto-escaping
- Change
SECRET_KEYto random string - Never commit
.envto version control - Use HTTPS in production
- Keep dependencies updated
- Validate all user inputs
# Visit this endpoint after starting server
curl http://localhost:5000/test-apis
# Expected response:
{
"news": "OK",
"weather": "OK",
"crypto": "OK",
"github": "OK"
}- Dashboard: Should show 4 stat cards with data
- News: Should load articles (may take 15s for weather key activation)
- Weather: Click "My Location" โ Should detect your city
- Crypto: Should show Top 50 coins immediately
- GitHub: Should show trending repositories
# Solution:
1. Check .env file exists in project root
2. Verify key names: NEWSAPI_KEY, OPENWEATHER_API_KEY
3. Restart Flask server after editing .env# Solution:
1. Wait 10-15 minutes after getting key (activation time)
2. Test key manually:
curl "https://api.openweathermap.org/data/2.5/weather?q=London&appid=YOUR_KEY"# Solution:
1. Click "Allow" when browser asks for location permission
2. Use HTTPS (geolocation requires secure context)
3. Try manual city search instead# Solution:
1. Check you selected correct country in dropdown
2. Try "Global" + different country combination
3. For local news, click "Detect Location" first- โ Global + Local News with GPS
- โ Portfolio tracker with P/L
- โ Price alerts system
- โ Weather GPS detection
- โ Save favorite cities
- โ Modern glassmorphism UI
- โ LocalStorage persistence
- User authentication (Flask-Login)
- Cloud-sync preferences
- Browser push notifications
- Export portfolio to PDF/CSV
- Dark mode toggle
- News article bookmarking
- Weather alerts
- Crypto price charts
- Mobile app (React Native)
- Real-time WebSocket updates
- Advanced analytics dashboard
- Social features (share portfolios)
- Multi-language support
- Machine learning predictions
- Tax calculation for crypto
Contributions are welcome! Here's how:
- Fork the repository
- Create a feature branch
git checkout -b feature/AmazingFeature
- Commit your changes
git commit -m 'Add: Amazing new feature' - Push to the branch
git push origin feature/AmazingFeature
- Open a Pull Request
- Follow PEP 8 style guide
- Add comments for complex logic
- Update README if adding features
- Test your changes thoroughly
- Keep commits atomic and descriptive
Frank Bwalya
- GitHub: b5119
- Email: [email protected]
- NewsAPI - For news article data
- OpenWeatherMap - For weather information
- CoinGecko - For cryptocurrency data
- GitHub API - For repository information
- Flask - Excellent web framework
- Bootstrap - Beautiful CSS framework
- Font Awesome - Amazing icon library
- jQuery - Simplified JavaScript
- Modern dashboard designs on Dribbble
- Glassmorphism UI trend
- Community feedback and suggestions
Need help? Here's how to get it:
- Check Documentation: Read SETUP_GUIDE.md
- Search Issues: See if someone had the same problem
- Open Issue: Describe your problem with error messages
- Email: [email protected]
If you find this project useful, please consider giving it a star! โญ
It helps others discover the project and motivates continued development.
Beautiful overview with real-time stats from all APIs
Global and local news with smart filtering
5-day forecast with GPS auto-detection
Track your investments with profit/loss calculations
This project demonstrates:
- โ Clean Flask architecture
- โ Modern UI/UX design
- โ Multiple API integrations
- โ LocalStorage for persistence
- โ Responsive design
- โ No database required for basic features
- โ Production-ready code
Perfect for:
- Learning Flask development
- Building API integrations
- Creating dashboards
- Portfolio projects
- Personal use
Made with โค๏ธ and Flask | ยฉ 2025 API Hub