Implement Backend APIs and Noise Report Management
Objective
Develop the backend functionality for the Noise Pollution Heatmap application using Flask. The backend will handle user-submitted noise reports, store data, and provide APIs for frontend integration.
Tasks
- Create Flask Backend Set up Flask application structure Configure routes and request handling Enable JSON communication between frontend and backend
- Implement API Endpoints Home Route Serve the main application page / Submit Report Route Accept POST requests from the noise reporting form Validate incoming data Store reports in reports.json /submit Fetch Reports Route Return all stored reports as JSON Support map visualization /data
- Data Management Read data from reports.json Append new reports Handle missing or empty files gracefully Ensure data persistence after server restart
- Error Handling Validate required fields Return meaningful error messages Prevent server crashes due to invalid input
- Testing Verify report submission functionality Verify data retrieval functionality Test API responses using browser and Postman Deliverables Functional Flask backend Working API endpoints Report storage mechanism Error handling implementation Updated documentation for API usage Acceptance Criteria Users can successfully submit noise reports Reports are stored in reports.json Data can be retrieved through API endpoints No server errors during normal operation Backend integrates correctly with frontend