How mathusigans/newschorin_back works
NewsChorin is a Tamil-news backend: source spiders collect articles, a sync workflow classifies and optionally paraphrases them before storing them, and APIs serve public news and admin moderation. The graph preserves classification, image handling, operations, and authentication as distinct capabilities. Some links are grounded in README statements or SOURCE INDEX references rather than complete excerpts; those references show named dependencies, not necessarily the exact runtime call sequence.
Main entry points: main.py FastAPI application · admin_service.py Moderation workflow · sync_service.py Article sync workflow · operations.py Operations routes
Components 27
HTTP API
- FastAPI application
app/main.py - Public news routes
app/api/routes/news.py - Admin routes
app/api/routes/admin.py - Authentication routes
app/api/routes/auth.py - Operations routes
app/api/routes/operations.py - Classification routes
app/api/routes/classification.py - System routes
app/api/routes/system.py
News workflows
- Public news workflow
app/services/news_service.py - Moderation workflow
app/services/admin_service.py - Article sync workflow
app/services/sync_service.py - Scraper service
app/services/scraper_service.py - Image service
app/services/image_service.py
Collection pipeline
- News spiders
spiders/base_news.py - Scraped article data
Persistence and media
- News repository
app/repositories/news_repository.py - PostgreSQL
- Image files
- DB connection
app/db/connection.py - Schema management
app/db/schema.py
Classification and integrations
- Classification service
app/services/classification_service.py - Tamil classifier
classifier.py - Category keywords
category_keywords.py - Gemini paraphrasing
app/integrations/gemini_client.py - Access control
app/core/security.py
Other components
- News reader
- Admin / operator
- Scraper runner
run_all.py
Connections 43
- FastAPI application → Public news routes: registers
app/main.py - FastAPI application → Admin routes: registers
app/main.py - FastAPI application → Authentication routes: registers
app/main.py - FastAPI application → Operations routes: registers
app/main.py - FastAPI application → Classification routes: registers
app/main.py - FastAPI application → System routes: registers
app/main.py - News reader → Public news routes: requests news
README.md - Admin / operator → Admin routes: moderates articles
README.md - Admin / operator → Authentication routes: authenticates
README.md - Admin / operator → Operations routes: runs operations
README.md - Public news routes → Public news workflow: delegates to
app/api/routes/news.py - Admin routes → Moderation workflow: delegates to
app/api/routes/admin.py - Operations routes → Article sync workflow: delegates to
app/api/routes/operations.py - Operations routes → Moderation workflow: delegates to
app/api/routes/operations.py - Classification routes → Classification service: delegates to
app/api/routes/classification.py - Admin routes → Access control: checks access
app/api/routes/admin.py - Authentication routes → Access control: uses access control
app/api/routes/auth.py - Operations routes → Access control: checks access
app/api/routes/operations.py - Public news workflow → News repository: queries articles
app/services/news_service.py - Moderation workflow → News repository: reads and updates
app/services/admin_service.py - Article sync workflow → News repository: upserts articles
app/services/sync_service.py - News repository → PostgreSQL: reads and writes
- Public news workflow → DB connection: opens connection
app/services/news_service.py - Moderation workflow → DB connection: opens connection
app/services/admin_service.py - Article sync workflow → DB connection: opens connection
app/services/sync_service.py - FastAPI application → Schema management: initializes schema
app/main.py - Schema management → PostgreSQL: creates tables
app/db/schema.py - Moderation workflow → Classification service: reclassifies articles
app/services/admin_service.py - Article sync workflow → Classification service: classifies articles
app/services/sync_service.py - Classification service → Tamil classifier: delegates classification
app/services/classification_service.py - Tamil classifier → Category keywords: uses keyword fallback
classifier.py - Article sync workflow → Gemini paraphrasing: requests paraphrasing
app/services/sync_service.py - Moderation workflow → Gemini paraphrasing: requests paraphrasing
app/services/admin_service.py - Scraper runner → News spiders: runs configured spiders
README.md - News spiders → Scraped article data: writes scraped data
README.md - Scraper runner → Article sync workflow: syncs results
- Scraped article data → Article sync workflow: reads article data
app/services/sync_service.py - Scraper runner → Scraper service: can invoke workflow
- Scraper service → Image service: uses image service
app/services/scraper_service.py - Image service → News repository: normalizes image paths
app/services/image_service.py - Image service → Image files: inspects image directory
app/services/image_service.py - Moderation workflow → Image files: saves uploaded images
app/services/admin_service.py - News reader → Image files: loads article images