How ecyx00/summaryfinance works
Project Type and Purpose
• This is a full-stack news-aggregation and summarization system.
• Components:
• Spring Boot backend (Java 17) for news collection, scheduling, persistence, and REST/SSE APIs
• Python AI Service (FastAPI) for content scraping, AI analysis, and summary generation
• Static frontend (HTML/CSS/JS) for displaying results
• PostgreSQL database for persistence
• External news APIs (NYTimes, Guardian)
File Structure
• Top-level directories:
• backend/ (Maven-based Spring Boot code under src/main/java)
• ai_service/ (Python FastAPI service under src/)
• frontend/ (static files: index.html, JS, CSS)
• docs/ (API docs)
• Notice MVC-style layering in backend: controllers, services, repositories, entities, config, scheduler, clients
• Python AI service modules: core (config, logging), db (models, CRUD), processing (scraper, analyzer, preparer, sender), main entry point
• Tests exist for both backend and ai_service
README Insights
• Two main components described under “Proje Yapısı”
• Tech stack listed: Java/Spring Boot, Python/FastAPI, PostgreSQL, newspaper3k
• Startup instructions hint at how the pieces run and communicate (FastAPI on uvicorn, Spring on port 8080)
Main Components & Interactions
• Frontend (Static Web UI)
• Backend (Spring Boot service)
• AI Microservice (FastAPI Python service)
• Database (PostgreSQL)
• External News APIs (NYTimes, Guardian)
b. Relationships & data flows:
1. Scheduler (backend) periodically invokes NewsSourceClient → fetches articles
2. Backend persists raw News entities → downstream triggers AI processing
3. Backend calls AI Service HTTP endpoint to analyze and summarize
4. AI Service scrapes content, runs Gemini analyzer, stores results, and notifies backend (or writes back to DB)
5. Backend merges AI results into database via ProcessedAiResultsService → persisted Summary entities
6. Frontend pulls or subscribes (SSE) to backend endpoints (SummaryController, SseNotificationController) to display updated summaries
c. Architectural patterns & design principles:
• Microservice separation (backend vs AI)
• Layered architecture in backend (Controller → Service → Repository → DB)
• Configuration/externalization (.env and application.properties)
• Asynchronous scheduling via Spring’s @Scheduled jobs
• RESTful and SSE for push notifications
d. Key technologies to annotate:
• Spring Boot, Maven, Java 17
• FastAPI, Uvicorn, Python 3.x, newspaper3k
• PostgreSQL
• HTTP/REST, Server-Sent Events
Essential Details to Capture
• Scheduling flow (NewsScheduler)
• Where config files (.env, application.properties) feed into respective services