How naren-kanchi/riten-graph works
RITEN-GRAPH is a historical, partly synthetic research application for exploring semiconductor trade, restrictions, AI infrastructure, energy, macroeconomic indicators, and technology companies. Analysts use a Next.js interface to query a FastAPI service, which serves relational analysis from PostgreSQL and graph questions from Neo4j; users can also curate records and administer access. Its data workflow validates and loads CSV sources, projects graph data, and produces a quality report. Source excerpts establish several backend calls; some frontend and ETL connections are documented only in the README, so those edges cite it.
Main entry points: main.py FastAPI application · db.py PostgreSQL access · run.py ETL orchestration · graph.py Graph queries
Components 29
Analyst experience
- Research interface
frontend/app - API client
frontend/lib/api.ts - API route proxy
frontend/app/api/[...path]/route.ts - Sign-in
frontend/app/login/page.tsx
API and access
- FastAPI application
backend/riten/main.py - Authentication
backend/riten/routers/auth.py - Curation
backend/riten/routers/curation.py - Administration
backend/riten/routers/admin.py - Relational queries
backend/riten/routers/relational.py - Graph queries
backend/riten/routers/graph.py - Request validation
backend/riten/routers/params.py - Session security
backend/riten/security.py
Analytical services
- Shared read views
backend/riten/views.py - Graph discoveries
backend/riten/discovery.py - Cache and prefetch
backend/riten/cache.py - Prefetch worker
backend/riten/worker.py
Data stores
- PostgreSQL access
backend/riten/db.py - PostgreSQL
- Neo4j access
backend/riten/graphdb.py - Neo4j
- Redis cache
Data ingestion
- ETL orchestration
backend/riten/etl/run.py - Source contract
backend/riten/etl/contract.py - Data validation
backend/riten/etl/validate.py - Relational loading
backend/riten/etl/load.py - Graph projection
backend/riten/etl/graph.py - Quality report
backend/riten/etl/report.py
Other components
- Analyst
- Source CSVs
Connections 37
- Analyst → Research interface: explores
README.md - Research interface → API client: requests data
- API client → API route proxy: forwards requests
- API route proxy → FastAPI application: routes to API
- Sign-in → FastAPI application: signs in
- FastAPI application → Authentication: registers router
backend/riten/main.py - FastAPI application → Relational queries: registers router
backend/riten/main.py - FastAPI application → Graph queries: registers router
backend/riten/main.py - FastAPI application → Curation: registers router
backend/riten/main.py - FastAPI application → Administration: registers router
backend/riten/main.py - Authentication → PostgreSQL access: reads users
backend/riten/routers/auth.py - Authentication → Session security: issues tokens
backend/riten/routers/auth.py - Curation → PostgreSQL access: reads and writes
backend/riten/routers/curation.py - Relational queries → PostgreSQL access: queries records
backend/riten/routers/relational.py - Relational queries → Shared read views: uses shared views
backend/riten/routers/relational.py - Relational queries → Cache and prefetch: caches results
backend/riten/routers/relational.py - Graph queries → Neo4j access: runs graph queries
backend/riten/routers/graph.py - Graph queries → Graph discoveries: requests discoveries
backend/riten/routers/graph.py - Graph queries → Shared read views: uses graph views
backend/riten/routers/graph.py - Graph queries → Cache and prefetch: caches results
backend/riten/routers/graph.py - PostgreSQL access → PostgreSQL: queries
backend/riten/db.py - Neo4j access → Neo4j: runs Cypher
backend/riten/graphdb.py - Shared read views → PostgreSQL access: reads relational data
backend/riten/views.py - Shared read views → Neo4j access: reads graph data
backend/riten/views.py - Cache and prefetch → Redis cache: reads and writes
backend/riten/cache.py - Cache and prefetch → PostgreSQL access: gets data version
backend/riten/cache.py - Prefetch worker → PostgreSQL access: reads navigation
backend/riten/worker.py - Prefetch worker → Shared read views: computes prefetched views
backend/riten/worker.py - Prefetch worker → Cache and prefetch: stores prefetched results
backend/riten/worker.py - Source CSVs → ETL orchestration: provides inputs
README.md - ETL orchestration → Source contract: checks source contract
- ETL orchestration → Data validation: validates rows
- ETL orchestration → Relational loading: loads data
README.md - ETL orchestration → Graph projection: projects graph
README.md - ETL orchestration → Quality report: writes report
README.md - Relational loading → PostgreSQL: stores normalized data
README.md - Graph projection → Neo4j: populates graph
README.md