Skip to content

Instantly share code, notes, and snippets.

@pete-murphy
Last active May 17, 2019 15:46
Show Gist options
  • Save pete-murphy/670dfd2dbbbb9dfbcff3477822aa9f82 to your computer and use it in GitHub Desktop.
Save pete-murphy/670dfd2dbbbb9dfbcff3477822aa9f82 to your computer and use it in GitHub Desktop.
Labs Development Journal

At the start of this week I worked with other teammates to create a universal set of ESLint and Prettier configurations that all of us can use across our editors and IDEs. The idea is to get us on the same page formatting-wise so that we can avoid unnecessary merge conflicts that arise from different editor configurations. I feel like this would be particularly important in this project, because we are all going to be editing much of the same files. I also contributed to editing the product canvas.

This week has been mostly researching AWS services that we might integrate into our app. We started looking at AWS Amplify for bootstrapping an app with authentication and API's with code generation for all possible handlers. This is a nice approach, and it seems to be how AWS services are designed to be used--all or nothing.

Currently I am looking into how to use AWS solely for authentication using their Cognito service. Cognito user pools would essentially take the place of our users table, which is not the prescribed usage of the service, but seems like a viable solution. Cognito also provides federated authentication through Facebook and Google.

I have set up our app on Google, still need to create a Facebook App ID. At this point I am looking into creating a basic React app with a public and private route, as a minimal proof-of-concept for using Cognito in isolation from other AWS services. I have yet to find documentation that supports using the service this way, but I think it should be feasible and may actually reduce complexity overall as it would allow us to continue work on the backend using a familiar technology stack, and only use Cognito for user authentication.

Individual Accomplishments

I worked on the user registration flow. This consists of at least two parts that are themselves pretty complicated:

  • The wizard form is a multi-part form that a new user of the app has to go through before they can create a profile. It consists of four multiple choice questions followed by a confirmation page where the user can change or confirm each of their choices. In addition to the state of the form being tracked locally in the app, we also wanted to maintain form state in localStorage---in the event that a user might refresh the page, we wanted to be able to retrieve the answers they had completed as well as the current step of the form that they were on so that they ended up in the exact same state. Keeping track of state in two places always adds complexity, but I think David and myself arrived at a decent solution.
  • The user registration form is nested in the confirmation page and completion of which kicks off a series of asynchronous events that need to be chained sequentially: first we fire off a sign-up action, which will trigger AWS to send an email to the user with a confirmation code, so we switch to a confirmation code input form. On submission of that, we handle the success of that by signing the user in (using stored credentials from the sign up form) then create a house associated with the user and then redirect the user.

Team Dynamic

Our group dynamic has been great, I think that everyone has done a solid job of jumping around to different roles while still maintaining ownership of the parts of the codebase that they have authored. We have also done a lot of pair programming which has been very effective as a means of keeping everyone on task and goal-oriented. It has also been a great learning opportunity for collaboration process and just learning from the skillsets of others. Always walk away from a pair programming session having learnt something.

Detailed Analysis

I spent quite a bit of time learning the AWS ecosystem and am still a bit overwhelmed by it. Running into a bug currently that seems very difficult to debug: the AppSync generated query for e.g. listItems (for whatever resource) sometimes returns an empty array despite there being rows in the database (for example getItem by ID for a valid ID will return the item). Not really sure where to start with debugging, but one possible solution would be to maintain our own users table, which is not ideal as it would add a lot of complexity and undermine the motivation for using AppSync in the first place.

Individual Accomplishments

This week started with debugging an issue that we were having last week. After digging around, I arrived at the solution of re-writing our backend to include a Users model (effectively adding a Users table in our DynamoDB instance). This added a bit of complexity because much of our app logic (for signing up a user and creating a house) had to be re-written to accommodate the new schema. Also got back into working on some CSS/responsive layout with adding the sidebar drawer functionality, which was a refreshing change. Next up is working on storage for user profile and house images, which is going to be challenging to implement.

Team Dynamic

We continue to do a lot of pair programming: learned a lot from Gabe who has great design skills and from Anthony who has years of domain specific knowledge. I think we're set up to complete MVP comfortably ahead of schedule. I look forward to having time to spend on some stretch tasks and adding tests.

Detailed Analysis

Implementing the new schema and registration flow was a lot of work. I'm realizing now that I think something like redux-saga is typically used for this type of complicated async control flow. The actions that happen after a user completes the wizard form now look like:

Screen Shot 2019-05-06 at 10 19 19 AM

It was a bit of a challenge to get those all to fire off one after the other and then do the redirect to the dashboard; a lot of async state to keep track of.

Individual Accomplishments

This week felt a bit unproductive. Most of my tasks were centered around implementing storage using AWS S3. It's been sometimes overwhelming navigating all the AWS services and infrastructure, sometimes hard to find the documentation for the specific API that I'm focused on, but I think I'm getting better at that and its for sure valuable knowledge as familiarity with AWS will no doubt be a relevant skillset for years to come. This week in particular I've been setting up S3 storage for images. An amusing bug arose because of my misunderstanding of how S3 buckets work, which is different from other APIs in our backend in that they're not scoped to the Cognito user. Instead any objects (resources) placed in the bucket can be read/created/updated/deleted by anyone who is logged in, unless you explicitly tag the object with { level: "private" } metadata. This could be good if we end up making this a social network kind of app, but for now its not really desired behavior. The solution is to tag each object with a virtual "directory" specific to that user (though S3 buckets don't really have directories), and that seems to be working so far. In any case, though AWS has been frustrating at times, I'm glad to have the opportunity to learn so much about it and I probably wouldn't have been motivated to do so if I was just working on a personal side project.

Team Dynamic

I think we're all collaborating very effectively. Didn't have many opportunities for pair-programming this week and I felt that I missed that as a means of keeping myself on task. Also we've been occasionally running into issues with the Git workflow. I think the firstname-lastname naming convention makes things difficult when working on more than one feature at a time, which is rare but happens. If I were to start the project over, I would definitely push for having a development branch so that we would have easier control of how our individual contributions get merged. Right now the burden is on our PM to deal with merge conflicts and handle code review. This has worked OK so far but I think in a bigger project it could get out of hand, and it doesn't seem to be reflective of how real world projects are managed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment