How hajikhanovkh/backend-api works
CMR Analyzer accepts uploaded documents and returns structured CMR/invoice analysis. Its main workflow has two routes: OpenAI analyzes the uploaded file directly, while the Document AI route extracts page text, parses fields, and assembles CMR and invoice results. A separate registration-code lookup queries MySQL. The sampled server shows an in-memory analysis cache and these integrations; no README or other runtime source was provided.
Main entry points: server.js HTTP routes
Components 11
API workflows
- HTTP routes
server.js - Result assembly
server.js - NV lookup
server.js
Document analysis
- OpenAI analysis
server.js - Document AI OCR
server.js - Field extraction
server.js
Services and state
- Analysis cache
server.js - OpenAI API
- Google Document AI
- MySQL
Other components
- Upload client
Connections 12
- Upload client → HTTP routes: uploads file
server.js - HTTP routes → Analysis cache: checks cache
server.js - HTTP routes → OpenAI analysis: analyzes upload
server.js - OpenAI analysis → OpenAI API: requests analysis
server.js - HTTP routes → Document AI OCR: analyzes upload
server.js - Document AI OCR → Google Document AI: processes document
server.js - HTTP routes → Field extraction: parses page text
server.js - HTTP routes → Result assembly: assembles fields
server.js - HTTP routes → Analysis cache: stores analysis
server.js - HTTP routes → NV lookup: handles lookup
server.js - NV lookup → MySQL: queries NV data
server.js - HTTP routes → Upload client: returns JSON
server.js