How cept-vzg/digipin works
Project type and purpose
• This is a standalone, open-source Node.js/Express microservice that provides a RESTful API for encoding latitude/longitude into a 10-character “DIGIPIN” and decoding it back.
• It’s intended as a core backend component (“Address as a Service”) in India’s national geospatial infrastructure.
File structure
• Top-level:
• server.js – entry point that loads environment variables, spins up Express.
• package.json / package-lock.json – Node dependencies and scripts.
• swagger.yaml – API specification for interactive docs.
• docs/ – human-readable design docs (DIGIPIN_Technical_Document.md, images).
• src/:
• app.js – configures Express app, middleware, Swagger UI endpoint.
• routes/digipin.routes.js – defines /api/digipin/encode and /decode endpoints.
• digipin.js – core library containing DIGIPIN encode/decode algorithms.
Extract insights from the README
• Tech stack: Node.js v14+, Express v4.x, Swagger for documentation.
• Features: Encode, Decode, lightweight, production-ready, RESTful.
• Usage: environment-driven port, npm scripts (start, dev), interactive docs at /api-docs.