Labs V - Polish

Labs8 - RateMyDIY

Provide a paragraph (5-8 sentences) summarizing the work you did this week, the challenges you faced, the tools you used, and your accomplishments.

This week was very stressful, as I ran into blockers with almost every task I worked on. I began with the feature of utilizing our Lambda function to display thumbnail images rather than the images themselves, but to no avail. It wasn’t a total waste of time, as during this process I practiced fundamental javascript concepts such as callbacks while interfacing with Amazon’s API. After two days of searching the internet for answers, I could not overcome an access denied error when attempting to access an object’s link from our s3 data storage. According to the CLI, we were both the owner of the object and the bucket, so I was confused as to why it was blocked when everything was set to public. Alas, after this fiasco I moved on to backend testing where I ran into trouble testing authenticated routes. From there it was frontend testing, where I ran into issues testing with redux. As a result, I scrapped that for this week and prioritized responsive design and styling. This contributed to a more polished product.

List the tasks you pulled this week, and provide a link to the successfully merged PR completing that task and the trello card for that task. You must have at least one front end and one back end. The expected total is 6 with a minimum of 4.

PR Links
Backend Testing Github: https://github.com/Lambda-School-Labs/Labs8-RateMyDIY/pull/130
Trello: https://trello.com/c/SvdL2Lzq
Update API Documentation Github: https://github.com/Lambda-School-Labs/Labs8-RateMyDIY/pull/132
Trello: https://trello.com/c/Owd8OcLN
Update Responsive Design Github: https://github.com/Lambda-School-Labs/Labs8-RateMyDIY/pull/138
Trello: https://trello.com/c/lxdzACjU
Account Page Styling Github: https://github.com/Lambda-School-Labs/Labs8-RateMyDIY/pull/140
Trello: https://trello.com/c/98ip5COk

Pick one of your tickets and provide a detailed analysis of the work you did. This should be approximately ¼ page of text, and at least three screenshots.

PR chosen: Backend Testing

Polish week called for the testing of our application. Although we test our code on each and every PR we submit through continuous integration and deployment practices, it was time to take it to the next step. I installed jest and supertest as development dependencies on the server side and went from there. First I setup the test suite to accept environmental variables. Although these test variables could be declared in a separate .env file, I decided to use a different method instead. I utilized a built in jest function called reset modules which resets the module registry, or the cache of all required modules. This is useful to isolate modules where local state might conflict between tests. The way this was done with environmental variables is shown below.

Next I implemented callback functions to migrate and seed the database on each test. This allowed me to test the same data despite some tests altering that data. For this, I also used global methods such as before each, after each, and after all. In each one, we call the callback after each function has completed. Evidence of this is shown below.

This environment allowed me to test various endpoints for the third-party APIs within our app, as well as our own API. However, I ran into problems testing authenticated endpoints. After some research I discovered a library called superagent to test exactly that. However, it involved sending user information in the request body, which our Auth0 system doesn’t accept. Consequently, I could not test our API in this way. I defaulted to creating a seed user in the local database and in the Auth0 database, then logging in with said user and locating the cookie assigned to them from the server. After that, I would input the cookie value into a variable to store it for testing purposes. This solution was very hacky and didn’t really solve the problem, but it sort of worked. Given more time, I would’ve liked to come up with something better.

As a part of your journal entry, write ¼ to ½ a page reflecting on your experiences working with a team to bring an application to completion. The 90-90 rule is a quip referencing the very real difficulty of truly completing a project. Describe some of the final tasks that were the most difficult for your team to resolve - challenging bugs, layout and presentation woes, or anything else that was easy to get mostly working, but hard to get perfect

By the time an app is near completion, there are so many moving parts. If it was written in bad code, meaning there wasn’t many pure functions and said functions had many side effects, it would be easy to break things on the smallest change. Thankfully because of React, this wasn’t an issue. Our app is made up of many different components that return one item. This allowed us to make both functional and styling altercations throughout the week. As a result, our app allows users to successfully create a new DIY project, add to that project with new image or text posts, and review other users’ projects. Users can search, sort, and rate other projects, makers, and reviewers. This instantiates a new community built upon qrafting unique ideas and solutions to common problems. I believe it is a fantastic portfolio piece as it is relevant to people from all walks of life and could potentially have a great audience. Although some minor features need functionality tweaks, there is the presence of prevalent bugs, and the styling isn’t cohesive throughout the site yet, I am proud of the work we’ve done and will enjoy sharing it with others. After all, it has a sweet logo! Link can be found below, many thanks to @AnnieRuygt.

Feature Links
Landing Page https://ratemydiy.netlify.com
Search https://ratemydiy.netlify.com/search
Project List https://ratemydiy.netlify.com/projectlist
Review List https://ratemydiy.netlify.com/reviewlist
Settings https://ratemydiy.netlify.com/settings
Logo https://dribbble.com/shots/2205794-Raft-Logo