Labs I - Startup

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

I anticipate that the first week went by different than most. Early on the first day, my group decided which tech stack to use, as expected. However, the rest of the day was spent figuring out the process for authentication. Although we didn’t get anywhere, it was helpful for me because moving forward I was responsible for authentication. Auth0 was our authentication provider of choice. I had experience applying it on the front-end, but not the back-end as we wanted. As a result, I dedicated my time to scouring the documentation in order to correctly implement it into our project. I came across a sample web application running auth0 on node which was crucial. It accessed other third-party libraries such as passport but overall it was easy to understand and utilize. After that, I encountered a problem with the ability to interact with an additional database. To ensure the correct user permissions, such as a signed in user being capable of editing and/or removing their own projects/reviews, data received from Auth0 must be recorded in our database. However, to correctly administer this, a “rule” must be executed in part of the authentication process to add user metadata to the user profile returned as a property on the request object. This could only be done with a deployed back-end. Following that discovery, I worked on the routes and models for projects. Upon completion, I documented all API endpoints to avoid confusion among the team. Afterwards, I handled authentication on the front-end by adding a sign up / sign in component to make a request to the sign in endpoint on the API. There is work yet to be done, but I believe it is headed in the right direction.

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
Create User Accounts Github: https://github.com/Lambda-School-Labs/Labs8-RateMyDIY/pull/5
Trello: https://trello.com/c/BjjW5ycL/20-create-user-accounts-sign-up
Project Endpoint Configuration Github: https://github.com/Lambda-School-Labs/Labs8-RateMyDIY/pull/18
Trello: https://trello.com/c/cNiZh2RA/46-project-endpoint-configuration
API Documentation Github: https://github.com/Lambda-School-Labs/Labs8-RateMyDIY/pull/28
Trello: https://trello.com/c/TC6dsawq/55-endpoint-documentation
Sign Up/Sign In Component Github: https://github.com/Lambda-School-Labs/Labs8-RateMyDIY/pull/32
Trello: https://trello.com/c/Ta0bdune/23-landing-page-users-can-sign-up

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: Create User Accounts

First, I setup the .env file on the server root to hold important auth0 information. Then I configured passport to use this information in its auth0 strategy. This authentication system would return an access token, a separate JSON web token, and the user profile. I then called the serialize user function to save the user profile on the request object.

Next, I assembled the middleware, including packages such as passport, cookie parser, and express sessions. I initialize passport and the session as well.

Ensuing that, I began to build the user routes. I required passport again, but also a new package called connect-ensure-login that does as implies and ensures a user is logged in. I created a sign in route using the passport authenticate middleware and passed an object with a scope property to determine what is returned on the user profile I get back. Unfortunately, the user metadata parameter has been discontinued in later versions of auth0 so I was unable to include that instead of the rule. The route redirects to a callback route to perform the final stage of authentication and redirects again to a previously requested URL or to a custom test route if none is found. This test route returns a JSON object containing the user with certain properties such as the split string of the userid to form an authid and a username. It had previously been prepared to add said user to our local database, but since the user must be unique this posed problems and couldn’t be done without the user metadata, so for now it was left out. Finally there is a signout route to sign out of the website.

As a part of your journal entry, write ¼ to ½ a page reflecting on your experiences forming a team. What did you do to help the team solidify as a group? What did you do that you now realize caused friction in this process?

Coming into labs, I was nervous about being divided into a group to work together on something as it made me quite anxious. I was worried about being slow in regards to working pace compared to everyone else in addition to perhaps lacking communication skills. I tend to err on the side of caution and stay quiet when I should be speaking up. This is amplified when surrounded by people I don’t know. However, I have been trying my best to break off of this pattern and this past week showed solid evidence that I’m making progress. To help the team solidify as a group, I suggested we do coding challenges together in our free time, I pair programmed a few times, and I was that guy that always asked the questions, no matter how stupid they may seem. For better or for worse, I believe that has gotten us to a deep understanding of each other despite only being a week into the program. In the end, I feel like our team works well together and will continue to improve in the weeks to come.

Stack Links
Front-end https://ratemydiy-frontend.herokuapp.com/
Back-end https://ratemydiy-backend.herokuapp.com/
User-accounts https://ratemydiy-backend.herokuapp.com/signin