Journey into GSoC — Part 6

Omal Vindula
SCoRe Lab
Published in
3 min readJun 29, 2020

In this week I was mainly focussing on user registration and authentication features of the flutter application. As a start, I created a user registration component along with the required flask endpoints. This allows any user of the community to get signed up in the dengue stop platform. The finished component looks as follows.

User Registration Screen

When a user is signed up, their password will be hashed using PBKDF2 which is a key derivation function with a randomly generated salt at the time of registration. Then, whenever a user is logged in, their password is cross-checked with the hashed original password to authenticate them. This allows me to authenticate users without storing their passwords.

Once a user is created they can simply log in with their telephone number and password from the login screen which you can see below.

User Login Screen

Once they are logged in, the users will be provided with a JWT by the flask server which allows users to send authenticated requests to the Flask server. This will make sure that any unauthenticated user without a token is restricted of communicating the server. Once the JWT is provided, it is stored in the secure storage of the smartphone using Flutter Secure Storage package and will be only accessed when a user is trying to make a request to the server.

I have also implemented a user profile screen which allows users to view and edit their profile information. The users can edit any of their information except their telephone number as that’s what is being used to track a user and their activity throughout the system.

User Profile Screen

I have also altered the home screen from last week slightly to give users a logout option and an event filtering option (which is yet to be implemented).

Updated Home Screen

One of my mentors also suggested me to use Flask-Migrate which allows having version controlling on the database! This was a really great extension which handles SQLAlchemy database migrations for Flask applications using Alembic. This made my life so easy as the database would automatically alter and change its schema based on the SQLAlchemy DB model classes and their properties defined. So, I was able to integrate this extension into the project within this week.

With these features, the flutter app is now almost complete. Now it's just a matter of ironing out the kinks and then I will be developing the react web application for the admin users of the platform. But that’s all for this week. Until then, stay safe… cheers!

--

--