How rajsoni23/shree-rch-template-api works
This is a Vercel serverless API that turns a mother or child template request and Base64-encoded location data into an XLSX download. The workflow is request parsing, input validation and location-data decoding, workbook generation, then binary response. Workbook generation includes the documented Health Facility, SubCentre, and Village dropdowns, with dependent selections and no auto-filter. The sampled source supports these links; internal helper-level calls are grouped because they are all implemented in one file.
Main entry points: template.js Template handler
Components 7
Request handling
- Template handler
api/template.js - Body parser
api/template.js - Input validation and decoder
api/template.js
Workbook generation
- Workbook generator
api/template.js - ExcelJS
Response delivery
- XLSX attachment
api/template.js
Other components
- API caller
Connections 7
- API caller → Template handler: sends request
README.md - Template handler → Body parser: reads body
api/template.js - Template handler → Input validation and decoder: validates and decodes
api/template.js - Template handler → Workbook generator: generates workbook
api/template.js - Workbook generator → ExcelJS: creates workbook
api/template.js - Template handler → XLSX attachment: sends attachment
api/template.js - API caller → XLSX attachment: downloads result
README.md