FinanceScraper is a C#-based background service that scrapes important financial news, summarizes it using AI, and delivers it to my inbox weekly. The project has been refactored into a clean, modular architecture with a separate API layer for future frontend integration.
The application is now structured as a modular monolith with clear separation of concerns:
-
Contains domain models, business logic, and shared services
-
Defines interfaces and contracts for the entire application
-
Includes scraping, AI summarization, and email services
-
Background service using Hangfire for reliable job scheduling
-
Runs the weekly scraping job (every Sunday at 6AM EST)
-
Handles job retries, monitoring, and failure recovery
Note: Currently wired to use Hangfire, but designed for flexibility
-
REST API built with ASP.NET Core
-
Provides endpoints for frontend consumption
-
Will serve as the backend for a React frontend application
GET /api/articles/{timeperiod}
Returns summarized financial articles for the specified time period.
Parameters:
- timeperiod: Weekly, Monthly, or Quarterly
-
Scheduled weekly scraping job (every Sunday at 6AM EST)
-
Concurrent web scraping using
HttpClientandHtmlAgilityPack -
AI-generated article summaries (summarizied by
Gemini Flash) -
Email delivery via
MailKit
Critical: Each module folder requires a .env file with the following variables:
Required Environment Variables:
GOOGLE_GEMINI_FLASH_API_KEY=your_gemini_api_key_here
FINANCE_Scraper_CONN_STRING=your_database_connection_string_here
- React Frontend: Separate client application to display articles
📌 Tech Stack C# (.NET)
-
Hangfirefor reliable background scheduling -
Playwrightfor scraping SPAs with dynamic content -
HtmlAgilityPackfor HTML parsing -
HttpClientfor data fetching -
MailKitfor email sending -
Gemini Flashintegration
Typically, I prefer built-in solutions, however, after conducting research I made following decisions:
- Picked
HangfireoverSystem.Timersfor retry support - Picked
MailKitinstead ofSmtpClientas it is becoming obsolete