DataSeed is a developer-friendly data pipeline that periodically ingests content from HackerNews, Reddit, GitHub, and ProductHunt, normalizes and deduplicates it into a PostgreSQL database, exposes a read-only FastAPI REST API, and ships a Streamlit mini-dashboard with analytics.
- Multi-Source ETL Pipeline: Automated extraction from public APIs (HackerNews, Reddit, GitHub, ProductHunt).
- Data Normalization: Pydantic-based validation, deduplication, and cleaning for consistent data quality.
- Public API: RESTful read-only API with filtering, search, and sorting capabilities.
- Mini Dashboard: Streamlit-based interface for data exploration and visualization.
- Scheduled Updates: Automated data refresh with retry/backoff mechanisms for reliability.
- Monitoring: Simple counters and health checks for pipeline status.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Docker and Docker Compose
- Python 3.12+
-
Clone the repository:
git clone https://github.com/jspenaq/DataSeed.git cd DataSeed -
Set up the environment variables:
Create a
.envfile by copying the example file.cp .env.example .env
Update the
.envfile with your actual credentials for the external APIs (Reddit, GitHub, ProductHunt). -
Build and run the services using Docker Compose:
docker-compose up --build
This will start the following services:
db: PostgreSQL databaseredis: Redis server for Celeryapi: FastAPI applicationworker: Celery worker for data ingestiondashboard: Streamlit dashboard
- API: The API will be available at
http://localhost:8000. You can access the auto-generated documentation athttp://localhost:8000/docs. - Dashboard: The Streamlit dashboard will be available at
http://localhost:8501.
The DataSeed Dashboard is a comprehensive Streamlit-based web interface that provides real-time insights and analytics for your data pipeline. It offers an intuitive way to explore content from all connected sources, monitor system health, and analyze trends.
- π Overview Page: Real-time KPIs, system health monitoring, trending items, and latest content with search and filtering
- π Sources Page: Data source management, ingestion statistics, health monitoring, and detailed run history
- π Analytics Page: Interactive charts, trend analysis, data export capabilities, and comprehensive filtering options
- π Auto-Refresh: Configurable automatic data updates with rate limiting awareness
- π± Mobile Responsive: Optimized interface that works seamlessly on desktop, tablet, and mobile devices
- π€ Data Export: CSV, JSON, and Excel export functionality for all data tables
- π― Advanced Filtering: Search, source filtering, time windows, and custom queries
To run the dashboard locally:
# Using Docker Compose (recommended)
docker-compose up dashboard
# Or run directly with Streamlit
streamlit run dashboard/main.pyThe dashboard will be available at http://localhost:8501.
The dashboard requires the following environment variables:
| Variable | Description | Default | Required |
|---|---|---|---|
API_BASE_URL |
Base URL for the DataSeed API | http://localhost:8000 |
No |
DASHBOARD_TITLE |
Custom title for the dashboard | DataSeed Dashboard |
No |
TELEMETRY_ENABLED |
Enable telemetry logging | true |
No |
TELEMETRY_LOG_FILE |
Path to telemetry log file | dashboard_telemetry.log |
No |
Example .env configuration:
API_BASE_URL=http://localhost:8000
DASHBOARD_TITLE=My DataSeed Dashboard
TELEMETRY_ENABLED=true
TELEMETRY_LOG_FILE=logs/dashboard_telemetry.logOverview Page
- System health indicators (API, Database, Redis)
- Key performance indicators (total items, success rate, ingestion lag)
- Trending items from the last 24 hours
- Latest content with real-time search and filtering
- Export functionality for search results
Sources Page
- Overview of all configured data sources
- Health status monitoring for each source
- Detailed ingestion statistics and run history
- Performance metrics and error tracking
- Source-specific filtering and analysis
Analytics Page
- Interactive time-series charts showing ingestion trends
- Source comparison and distribution analysis
- Score distribution histograms
- Trending content analysis
- Advanced filtering by time window, sources, and search queries
- Comprehensive data export capabilities
The dashboard includes intelligent auto-refresh functionality:
- Configurable Intervals: 15 seconds to 10 minutes
- Rate Limiting Awareness: Automatically pauses when API rate limits are hit
- Manual Controls: Pause, resume, and manual refresh options
- Visual Indicators: Progress bars and countdown timers
- Mobile Optimized: Touch-friendly controls on mobile devices
The dashboard includes built-in telemetry for monitoring user interactions and system performance:
- Page Views: Track navigation patterns
- User Actions: Monitor feature usage and interactions
- API Performance: Track request durations and success rates
- Rate Limiting: Monitor and alert on API rate limit events
- Export Activity: Track data export usage patterns
Telemetry data is logged to console and optionally to file for analysis.
The dashboard is fully responsive and optimized for mobile devices:
- Adaptive Layouts: Automatically adjusts to screen size
- Touch-Friendly Controls: Optimized buttons and interactions
- Collapsible Sidebar: Space-efficient navigation on mobile
- Readable Typography: Optimized text sizes and spacing
- Fast Loading: Optimized for mobile network conditions
For detailed usage instructions and screenshots, see the Dashboard Guide.
The DataSeed API provides several endpoints for accessing content items, statistics, and trending data. Here are comprehensive examples using curl:
1. Get the latest items from all sources (offset pagination):
curl http://localhost:8000/api/v1/items/2. Get the latest items from a specific source:
curl http://localhost:8000/api/v1/items/?source_name=hackernews3. Search for items with a query:
curl http://localhost:8000/api/v1/items/?q=artificial%20intelligence4. Paginate results (get 5 items, skipping the first 10):
curl http://localhost:8000/api/v1/items/?limit=5&offset=105. Combine filters (search for "Python" in "github" source):
curl http://localhost:8000/api/v1/items/?source_name=github&q=Python6. Get items using cursor-based pagination (recommended for large datasets):
curl http://localhost:8000/api/v1/items/cursor7. Get next page using cursor from previous response:
curl "http://localhost:8000/api/v1/items/cursor?cursor=MjAyNC0wMS0xNVQxMDozMDowMFo6MTIzNDU%3D"8. Search with cursor pagination:
curl "http://localhost:8000/api/v1/items/cursor?q=machine%20learning&limit=10"9. Get overall statistics for the last 24 hours:
curl http://localhost:8000/api/v1/items/stats10. Get statistics for a specific time window (7 days):
curl http://localhost:8000/api/v1/items/stats?window=7d11. Get statistics for a specific source:
curl http://localhost:8000/api/v1/items/stats?source_name=hackernews&window=24h12. Get trending items from the last 24 hours:
curl http://localhost:8000/api/v1/items/trending13. Get trending items from the last week:
curl http://localhost:8000/api/v1/items/trending?window=7d14. Get trending items using hot score algorithm:
curl http://localhost:8000/api/v1/items/trending?use_hot_score=true&window=24h15. Get trending items from a specific source:
curl http://localhost:8000/api/v1/items/trending?source_name=reddit&window=24h&limit=1016. Check API health:
curl http://localhost:8000/api/v1/health17. Get available data sources:
curl http://localhost:8000/api/v1/sources18. Get overall system statistics:
curl http://localhost:8000/api/v1/stats19. Complex filtering with multiple parameters:
curl "http://localhost:8000/api/v1/items/?source_name=hackernews&q=AI&limit=20&offset=0"20. Get trending items with hot score for multiple sources:
curl "http://localhost:8000/api/v1/items/trending?window=24h&use_hot_score=true&limit=50"All endpoints support JSON responses and include appropriate HTTP caching headers for optimal performance.
To run the tests, you can execute the following command:
docker-compose run --rm api pytestDataSeed/
βββ app/ # Core application logic (FastAPI, models, services, workers)
βββ dashboard/ # Streamlit dashboard application
βββ migrations/ # Alembic database migrations
βββ config/ # Configuration files (e.g., source definitions)
βββ tests/ # Unit, integration, and API tests
βββ docker/ # Docker-related files (Dockerfile, docker-compose.yml)
βββ scripts/ # Utility scripts
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Make your changes.
- Ensure your code adheres to the project's coding style and passes all tests.
- Commit your changes (
git commit -m 'feat: Add new feature'). - Push to the branch (
git push origin feature/your-feature-name). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.