How sahidularif/bd_geolocation_api works
Project type and purpose
• This is a Node.js‐based RESTful API (“bd_geolocation_api”) whose sole purpose is to serve administrative boundary data for Bangladesh (divisions, districts, upazilas).
• Key indicators:
• “index.js” and “database.js” – typical Express/DB startup files
• “Models/…”, “controller/…”, “routes/route.js” – an MVC‐style structure
• A JSON file (“BD_GEOLOCATION.json”) – likely seed data or fallback
File structure
• Top level:
• index.js – entry point; likely configures Express server
• database.js – sets up DB connection (MongoDB, SQL, etc.)
• BD_GEOLOCATION.json – raw geodata
• package.json / package-lock.json – dependencies
• Directories:
• Models/ – data‐access layer (Districts.js, Divisions.js, Upazilas.js)
• controller/ – business logic for each resource
• routes/ – defines HTTP endpoints and binds them to controllers
• This follows a classic MVC pattern:
• Router → Controller → Model → Database
README
• Minimal content, but confirms one of the API routes (“get all divisions”).
• Implies similar routes for districts and upazilas.