AWS Amplify + Flutter

Over the last few weeks I have been working very hard on our capstone project. Which if you have been reading my blogs is a Flutter application combined with many Amazon web service backend tools. For example Amazon Amplify is the wrapper/service responsible for user authentication. I called it a wrapper because it encapsulates much of the aws Cognito functionality which is another service which assists with user authentication (login code, multi factor authentication, text message codes, email notifications, etc.). I have to say though that the experience has been quite difficult.

Apparently, we were unaware how new the amazon webservices libraries/packages and services are regarding their compatibility with flutter projects. The documentation is somewhat thorough, but it is not up to date and/or skips over crucial steps that might seem obvious to the creators, it didn’t help that a lot of the issues have no highly ranked stack overflow solutions/answers. The amount of effort (solid 20 hours minimum) navigating different resources (blogs, guides/tutorials, YouTube videos, documentations, stack overflow, github defect/bug tickets) to get the aws locally on my machine in sync with the remote aws instance was quite challenging and exhausting. 

In the end I was finally able to resolve all the issues but it is challenging working with this sparse and new aws flutter packages in a team environment. Doubly so when the updated packages are not being shared on GitHub. Technically we should be able to do ‘amplify pull’ from the terminal and get the latest updates from the remote but that doesn’t always work reliably. It has it’s quirks. Also I somehow had a corrupt version of npm(node package manager) which caused delays as well. Sorry for being a bit gloomy but this was a rough week of working on this project. Anyways, I/we have Aws amplify, Cognito, datastore, and storage/s3 working properly now on all our locals with the latest changes.

I then fixed/rewrote the routing logic for our flutter mobile app. It is slightly more organized and easy to read. Lots of fixes for the amplify configurations, flutter dependencies, updated ui for login page and updated the temporary home page screen so it is easier to navigate as well, renamed a few dart files with incorrect naming convention or marked the files as no longer in use, and resolved some of the many linting issues we have building up within the project.

Repository url where you can see all the commits and code changes: https://github.com/saveCraigslistTeam/craigslist

Over the next week I am planning to complete the full user authentication flow from ui to back end and back. Since aws is all setup, I was able to setup part of the authentication flow. Need to add the email confirmation code logic after a user sign up for the first time. Currently amazon Cognito will get the sign-up request and send out the confirmation code but there is nowhere on the ui for the user to enter the code and proceed to login. Afterwards, need to ensure all the different scenarios are in place. A registered account/user should not be able to create an account with the same name. Saving login data for future use, etc. etc. I would like to get at least very close to completing over the next week. Screenshots below for reference.

All in all, I think working on the project should start getting more fun since all the configurations are done(I hope lol) and I can focus on just the coding and logic of the craigslist app. Thank you for reading this far!

Draft UI Login Screen
AWS Cognito showing one unauthenticated user. i.e. user did not user the verification code they were sent to finish signing up/account creation.

Leave a Reply

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