How jogirohithkumar/factforge works
FactForge is a full-stack news-verification application. Users submit text or a URL through the Next.js interface; the API validates input, optionally extracts article text, runs model inference, persists a verdict, and returns it for display. The history endpoint supplies persisted results to the case-log sidebar. The README also documents an offline data-preparation and model-training workflow. Relationships involving unsampled frontend components are shown only where documented; the implementation of those component interactions was not excerpted.
Main entry points: predict.py Prediction endpoints · main.py FastAPI application · page.tsx FactForge interface · api.ts API client
Components 21
Web experience
- FactForge interface
frontend/app/page.tsx - Analyzer form
frontend/components/AnalyzerCard.tsx - API client
frontend/lib/api.ts - Verdict panel
frontend/components/ResultPanel.tsx - Verdict dial
frontend/components/VerdictDial.tsx - History sidebar
frontend/components/HistorySidebar.tsx
API and validation
- FastAPI application
backend/app/main.py - Application settings
backend/app/core/config.py - Request and response schemas
backend/app/schemas/prediction.py - Prediction endpoints
backend/app/api/routes/predict.py - History endpoint
backend/app/api/routes/history.py
Analysis services
- URL extraction
backend/app/services/scraper.py - Model inference
backend/app/services/ml_service.py - Model artifacts
backend/app/model
Persistence
- Database sessions
backend/app/db/database.py - Verification records
backend/app/db/models.py
Model training
- Data preparation
ml/data_preparation.py - Demo data generation
ml/generate_demo_data.py - Model training
ml/model_training.py - Demo model training
ml/train_demo_model.py
Other components
- User
Connections 25
- User → FactForge interface: submits check
README.md - FactForge interface → Analyzer form: offers analysis
- Analyzer form → API client: requests analysis
- API client → Prediction endpoints: POSTs text or URL
frontend/lib/api.ts - API client → History endpoint: fetches history
frontend/lib/api.ts - FastAPI application → Prediction endpoints: registers routes
backend/app/main.py - FastAPI application → History endpoint: registers routes
backend/app/main.py - FastAPI application → Database sessions: initializes database
backend/app/main.py - FastAPI application → Model inference: reports model status
backend/app/main.py - FastAPI application → Application settings: loads settings
backend/app/main.py - Prediction endpoints → Request and response schemas: validates requests
backend/app/api/routes/predict.py - Prediction endpoints → URL extraction: extracts URL text
backend/app/api/routes/predict.py - Prediction endpoints → Model inference: runs prediction
backend/app/api/routes/predict.py - Prediction endpoints → Verification records: persists verdict
backend/app/api/routes/predict.py - History endpoint → Verification records: reads recent records
backend/app/api/routes/history.py - Database sessions → Verification records: creates tables
backend/app/db/database.py - Model inference → Model artifacts: loads artifacts
README.md - Verdict panel → Verdict dial: renders dial
frontend/components/ResultPanel.tsx - FactForge interface → Verdict panel: displays verdict
- FactForge interface → History sidebar: shows case log
- History sidebar → API client: requests history
- Demo data generation → Demo model training: provides synthetic data
README.md - Data preparation → Model training: prepares dataset
README.md - Model training → Model artifacts: saves trained model
README.md - Demo model training → Model artifacts: saves demo model
README.md