Blog Post #4


Hello all and welcome back to my tech blog! It’s been a few weeks since the last update and yet again our team has made tremendous progress on our capstone project.

During this sprint, we did some code reviewing as well as a major refactoring of the Flask API. We started by going over the database methods and grouping the code for each entity into its own file to improve legibility and reduce file size. Next we added error handling using try except blocks which allowed us to throw more useful error messages which are passed on to the client. Lastly, we abstracted several database functions such as queries and mutations and a few helpers to ensure our code complied with the DRY principal.

After cleaning up the database code we moved on to the routes. First we refactored some of the logic and improved the formatting, variable names and added comments. Next we made sure the request and response bodies lined up with those sent and received by the frontend client. Furthermore, we added custom middleware for handling auth token validation which allowed us to protect specific routes. Finally, we began the implementation of AWS S3 for uploading and persisting images.

On the React side, we finally began integrating some of the endpoints including the authentication flow and some of the “experience” CRUD operations. Users now have the ability to register an account and log in. This allows us to protect routes on the client such as creating, updating and deleting experiences and trips as well as writing comments and reviews. We also added components to display error messages returned by the API server.

Going forward we hope to continue integrating the frontend with our API endpoints including finishing up the experience editor and then moving on to the trip builder which will be the main feature of the application. Our codebase is getting quite large and complex now so it’s critical for us to refactor our code frequently and adhere to proper styling guides to make sure the codebase doesn’t turn into spaghetti! Next sprint will be challenging as we still have a lot of work to do to get our application production ready.

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *