How andrewmtz23/healthcheckback works
HealthCheck is a multi-service backend for health-news analysis, news management, accounts, and alerts. The main workflow sends a user’s text or article URL through the gateway to ML classification, which extracts and stores article data, assigns a topic and keywords, and returns a prediction. Users can also access the separately exposed news API, manage accounts and consultation history, and receive preference-based alerts. The graph includes documented capabilities whose implementation was not sampled; those relationships are based on the README rather than inspected runtime code.
Main entry points: app.ts News API · classify_routes.py Article classification · proxy.ts Service proxy · app.py ML API
Components 29
API gateway
- Gateway app
api-gateway/src/app.ts - Gateway routes
api-gateway/src/routes - Service proxy
api-gateway/src/routes/proxy.ts
Accounts
- Auth service
services/auth-service/src/app.ts - Account and OAuth
services/auth-service/src/controllers/authController.ts - Profile preferences
services/auth-service/src/profile/routes.ts
News management
- News API
services/news-service/src/app.ts - Articles and search
services/news-service/src/controllers/newsController.ts - Interactions
services/news-service/src/controllers/interactionController.ts - Reports
services/news-service/src/controllers/reportController.ts - Consultation history
services/news-service/src/controllers/historyController.ts
ML and collection
- ML API
services/ml-service/app.py - Article classification
services/ml-service/api/routes/classify_routes.py - Article extraction
services/ml-service/utils/article_extractor.py - BERT inference
services/ml-service/core/classify_service.py - Article persistence
services/ml-service/utils/db_utils.py - News scrapers
services/ml-service/scrapers - Model management
services/ml-service/api/routes/train_routes.py - Search chatbot
services/ml-service/api/routes/chatbot_routes.py
Notifications
- Notification API
services/notification-service/src/app.js - Send notifications
services/notification-service/src/controllers/notification.controller.js - Alert scheduler
services/notification-service/src/services/scheduler.service.js - Notification preferences
services/notification-service/src/services/preference.service.js - Email and SMS delivery
services/notification-service/src/services/notification
Other components
- Web client
- PostgreSQL
- Local BERT model
- OpenAI and Google Search
- SMTP and Twilio
Connections 38
- Web client → Gateway app: calls gateway
- Web client → News API: accesses directly
- Gateway app → Gateway routes: mounts routes
api-gateway/src/app.ts - Gateway routes → Service proxy: proxies requests
api-gateway/src/routes/ml.routes.ts - Service proxy → Auth service: forwards auth
- Service proxy → ML API: forwards ML
- Service proxy → Notification API: forwards alerts
- Auth service → Account and OAuth: mounts routes
services/auth-service/src/app.ts - Account and OAuth → Profile preferences: mounts profiles
services/auth-service/src/routes/authRoutes.ts - Account and OAuth → PostgreSQL: stores accounts
- Profile preferences → PostgreSQL: queries preferences
services/auth-service/src/profile/routes.ts - News API → Articles and search: serves news
- News API → Interactions: serves interactions
- News API → Reports: serves reports
- News API → Consultation history: serves history
- Articles and search → PostgreSQL: reads and writes
- Interactions → PostgreSQL: reads and writes
services/news-service/src/controllers/interactionController.ts - Reports → PostgreSQL: reads and writes
services/news-service/src/controllers/reportController.ts - Consultation history → PostgreSQL: reads history
- ML API → Article classification: registers routes
services/ml-service/app.py - ML API → Model management: registers routes
services/ml-service/app.py - ML API → Search chatbot: registers routes
services/ml-service/app.py - Article classification → Article extraction: extracts article
services/ml-service/api/routes/classify_routes.py - Article classification → BERT inference: predicts news
services/ml-service/api/routes/classify_routes.py - Article classification → Article persistence: stores analysis
services/ml-service/api/routes/classify_routes.py - Article classification → News scrapers: dispatches scraping
services/ml-service/api/routes/classify_routes.py - BERT inference → Local BERT model: loads model
- Model management → PostgreSQL: updates model records
services/ml-service/api/routes/train_routes.py - Article persistence → PostgreSQL: reads and writes
- Search chatbot → OpenAI and Google Search: searches with
- Notification API → Send notifications: routes requests
- Notification API → Alert scheduler: starts scheduler
services/notification-service/src/app.js - Send notifications → Email and SMS delivery: dispatches delivery
services/notification-service/src/controllers/notification.controller.js - Send notifications → PostgreSQL: stores notifications
services/notification-service/src/controllers/notification.controller.js - Alert scheduler → Notification preferences: loads preferences
services/notification-service/src/services/scheduler.service.js - Alert scheduler → Email and SMS delivery: dispatches alerts
services/notification-service/src/services/scheduler.service.js - Alert scheduler → PostgreSQL: queries alert data
services/notification-service/src/services/scheduler.service.js - Email and SMS delivery → SMTP and Twilio: sends email or SMS