Backend Setup Review Ticket
Accomplishments π
Positives
- Successfully set up a backend server using Flask.
- Implemented CORS to handle cross-origin requests effectively.
- Created an endpoint (
/api/ahaan) to fetch and display user information dynamically. - Achieved smooth communication between the frontend and backend with
fetchAPI.
Postman Successes
- Used Postman to test backend API endpoints efficiently.
- Verified response structure and ensured the data matched expected formats.
- Debugged minor issues in real-time using Postmanβs response and error messages.
Struggles π
Negatives
- Initial difficulty with setting up CORS properly, leading to
CORS Policyerrors. - Took time to debug the
fetchcall URL mismatch between frontend and backend. - JSON parsing issues with unexpected response structures caused minor delays.
Postman Struggles
- Occasionally forgot to update headers or body in Postman, leading to incorrect test results.
- Faced confusion distinguishing between
GETandPOSTrequest setups in some tests.
Journey π
- Backend Initialization
- Started with a basic Flask server setup.
- Added the
/api/ahaanroute to serve a JSON response.
- CORS Integration
- Installed and configured Flask-CORS.
- Tested frontend-backend communication with updated headers.
- Frontend Testing
- Used Postman to test endpoint functionality before integrating it with the frontend.
- Confirmed data transfer and response parsing worked correctly.
- Final Connection
- Linked the frontend to the backend API.
- Validated everything by displaying fetched data on the webpage.
Postman π οΈ
- Learned Tools:
- Testing with
GETrequests and ensuring correct endpoint URL. - Debugging responses and understanding error codes (e.g.,
404,500). - Quickly iterating on backend changes and retesting.
- Testing with
- Best Practices Adopted:
- Double-checking headers and body configurations before sending requests.
- Maintaining consistency in endpoint paths between Postman and frontend.
Improvements for Next Time π§
- Documentation
- Create a clear checklist for backend setup to avoid repeating mistakes.
- Postman Usage
- Save frequently used requests in Postman collections for reusability.
- Error Handling
- Add more robust error handling for backend endpoints to return clear messages.
- Debugging Workflow
- Improve coordination between Postman tests and frontend integration to minimize delays.
This review reflects the lessons learned and the growth achieved during the backend setup process.