How abhinittripathi/mf-document-registery-bfc-capital works
This is a mutual-fund document registry: a scheduled SEBI collection workflow stores AMC, scheme, and document records, while an authenticated API lets clients search schemes and retrieve their latest filings. The graph also preserves API-key administration and the SEBI scraping spike. Source excerpts show the API search and ingestion writes directly; some scheduled-job and route wiring is supported only by the source index, so uncertain edges are omitted or marked unverified.
Main entry points: index.route.ts API routing · auth.controller.ts Key administration · scheme.controller.ts Scheme search · sebi-scraper.job.ts SEBI scraper
Components 27
Runtime and API
- Server startup
src/index.ts - HTTP app
src/app.ts - API routing
src/routes/index.route.ts - Scheme route
src/routes/scheme.route.ts - API responses
src/utils/api-response.util.ts - Async handler
src/utils/async-handler.util.ts - Environment config
src/utils/env.util.ts - Logging
src/utils/logger.util.ts
Client security
- Admin routes
src/routes/auth.route.ts - Key administration
src/controllers/auth.controller.ts - Key authentication
src/middlewares/auth.middleware.ts - Client rate limits
src/middlewares/rate-limit.middleware.ts - Client and key records
src/models - Key generation
src/utils/api-key.util.ts
Document registry
- Scheme search
src/controllers/scheme.controller.ts - Mongo connection
src/db/mongo.db.ts - Registry records
src/models - Search and normalization
src/utils/search.util.ts
SEBI collection
- Scrape scheduling
src/jobs/sebi-schedule.job.ts - SEBI scraper
src/jobs/sebi-scraper.job.ts - SEBI HTTP
src/jobs/sebi-http.job.ts - SEBI parser
src/jobs/sebi-parser.job.ts - Scraped document types
src/jobs/sebi-types.job.ts - Document ingestion
src/jobs/sebi-ingest.job.ts - Worker entry
scripts/worker.script.ts
Scraper spike
- Scraper prototype
research/spikes/test-scraper-SEBI-1/sebi-common.js
Other components
- API client
Connections 29
- Server startup → Mongo connection: connects
src/index.ts - Server startup → HTTP app: starts
src/index.ts - HTTP app → API routing: mounts
src/app.ts - API routing → Key authentication: authenticates
src/routes/index.route.ts - API routing → Client rate limits: rate limits
src/routes/index.route.ts - API routing → Admin routes: mounts
src/routes/index.route.ts - API routing → Scheme route: mounts
src/routes/index.route.ts - Scheme route → Scheme search: routes to
src/routes/scheme.route.ts - Admin routes → Key administration: routes to
src/routes/auth.route.ts - API client → HTTP app: sends requests
- Key administration → Client and key records: creates and updates
src/controllers/auth.controller.ts - Key administration → Key generation: generates keys
src/controllers/auth.controller.ts - Key authentication → Client and key records: checks and records
src/middlewares/auth.middleware.ts - Key authentication → Key generation: hashes key
src/middlewares/auth.middleware.ts - Scheme search → Registry records: queries
src/controllers/scheme.controller.ts - Scheme search → Search and normalization: builds search
src/controllers/scheme.controller.ts - Scheme search → API responses: returns results
src/controllers/scheme.controller.ts - Scheme search → Async handler: wraps handler
src/controllers/scheme.controller.ts - Key administration → API responses: returns results
src/controllers/auth.controller.ts - Key administration → Async handler: wraps handlers
src/controllers/auth.controller.ts - Worker entry → Mongo connection: connects
scripts/worker.script.ts - Worker entry → Scrape scheduling: starts job
scripts/worker.script.ts - Scrape scheduling → SEBI scraper: runs collection
src/jobs/sebi-schedule.job.ts - Scrape scheduling → Document ingestion: persists results
src/jobs/sebi-schedule.job.ts - SEBI scraper → SEBI HTTP: fetches pages
src/jobs/sebi-scraper.job.ts - SEBI scraper → SEBI parser: parses pages
src/jobs/sebi-scraper.job.ts - SEBI scraper → Scraped document types: produces records
src/jobs/sebi-scraper.job.ts - Document ingestion → Registry records: upserts records
src/jobs/sebi-ingest.job.ts - Scraper prototype → API client: collects SEBI filings