How chan-stephane/map-data-server works
Project type and purpose
• This is a backend-only RESTful API microservice (“Map Data Server”) built with Node.js and Express.
• Its sole responsibility is to serve precomputed map data (bus lines, stops, ways, line types) as JSON over HTTP for use by a map editor or other client.
File structure
• Top level:
• Dockerfile, docker-compose.yml, .env.example → containerization and configuration
• package.json / package-lock.json → Node dependencies and scripts
• README.md → usage, endpoints, data specifications
• netlify.toml + functions/app.js → optional Netlify Functions deployment
• Directories:
• routes/ → Express route definitions (map.route.js)
• services/ → business logic / data-loading layer (dataloader.service.js)
• utils/ → shared helper functions (helpers.js)
• data/ → static JSON data sources (antananarivo.json, busLines.json, etc.)
• logs/ → placeholder for runtime logs
• images/ → assets used in README only
• Other files:
• swagger.js → OpenAPI documentation setup
• eslint.config.mjs → linting rules
README for additional insights
• Lists all public endpoints under /api (lines, stops/:lineName, ways/:lineName, busLines, lineTypes, busStops).
• Describes data origin and JSON schema.
• Shows usage via npm scripts or Docker Compose.
• Exposes Swagger UI at /api-docs for interactive docs.