Tinker Education Elearning App

The initial intention was to create ONLY a newsletter service for Tinker Education. However, things quickly changed. With enrollment starting late January 2023, there was an obvious need to create an eLearning app to provide content to participants in the program. The newsletter app has been extended to accommodate eLearning. See the updates section below to know more about the changes.

Background

Tinker Education, the company I work for, is set to launch a new program for kids in January 2023. Typically, Google Forms have been the default way used to capture potential clients' information.

This is fine, as the forms do exactly what they are expected to do. However, the challenge comes as the list of registered clients increases. Staff work burden increases ten-fold since they have to keep up with reaching out to all signed up clients via email either:

  • To acknowledge that the client has successfully registered
  • To send periodic emails with updates about what to expect from the new program

Think for a moment: this is an additional task that does not in any way improve their productivity or make life easier. This is where the need for a newsletter came in. From a management perspective, something needed to be done. With a newsletter application, staff do not have to worry about:

  • Organizing client data
  • Sending individual and personalized emails to an endless list of potential clients

Such an application can easily automate all these tasks if the needs of the company at this point are to be fully factored in. The solution would relieve the staff of extra but equally important tasks. They can focus on what they do best.

Interesting Facts About The Tinker Education Elearning App

  • It is written in Python
  • JavaScript is sparingly used in the dashboard design
  • Built using the Flask micro-framework
  • Uses the PostgreSQL database to store user-generated data
  • Google reCaptcha is sparingly used to protect the forms from spam
  • Custom admin dashboard to accurately manage the blog
  • Optional two-factor authentication is implemented in the blog
  • Email verification to ensure a client has access to their email
  • Automated sending of newsletters periodically
  • Admin can privately follow up with a potential client via email right from the dashboard
  • Hosted on Linode

Challenges Faced

User Roles

The use of roles to define what permissions the application's users have was a big issue at first. Currently, the application has an anonymous client, and two types of admins:

  • Superadmin: He can register other admins; has the ability to delete database content
  • Normal admin: Can do all things except register other admins and delete application data

I tried to use other role-specific flask packages such as Flask Principle and Flask User but with various difficulties. In the end, I ended up implementing my own custom role functionality, heavily inspired by these packages.

Cron Jobs

The main purpose of a newsletter application is to send out emails periodically. Depending on the subscription status of a user, the application should know what email to send out and when. All Unix-based distributions, thankfully, have the cron utility available.

The challenge comes when implementing cron jobs. Among the many newletters, which one should be sent out first? How can subsequent email newsletters be sent out? How does the application invoke a command that will initiate this process? How do you even invoke this command?

Eventually, I figured out there are three things that I can do to implement this feature:

  • Create the task
  • Create the command to send out emails in the context of the application
  • Schedule the job

As soon as this feature worked out, I documented my entire thought process in a simple tutorial called Understanding Cronjobs in Flask.

Deployment

The other main challenge was how to use a PostgreSQL database in a live Linux Server. Given that this was a Python-powered backend, I had to use a virtual machine. I settled on Linode because I have used them before, and I am familiar with the deployment process. I believe, though, that the process to deploy any app on a virtual machine is fairly the same across all providers.

Deployment was not the issue. The biggest challenge was how to set up PostgreSQL on this server. A lot of changes had to be made to the PostgreSQL configuration in the server to make it work, something I had no clue about. First, it was through trial and error. Nothing worked. Then, I decided to learn what changes needed to be done. For example:

  • Modifying PostgreSQL configuration to use the application's new IP address
  • Updating the server's firewall to allow for PostgreSQL's port 5432
  • Enforcing access management on the database by various database users

In the end, once I had cracked the task, I had to document the entire process. You can read more from my article on Medium.

Updates

As mentioned earlier, the original idea of limiting the application to a newsletter service was extended to accommodate eLearning. Below, I will share changes made to the app to give you an idea of where it all started versus where it is now.

Landing Page (Version1) Dashboard (Version1)
Newsletter App Landing Page Version1 Newsletter App Dashboard Version1
Login (Version1) Performance Analysis (Version1)
Newsletter App Landing Page Version1 Newsletter App Dashboard Version1

The user interface of Version1 is based on Bootstrap. Version2 below is also based on Bootstrap, but with a bit more bells and whistles to give it a far fresher look.

Landing Page (Version2) Dashboard (Version2)
Newsletter App Landing Page Version2 Newsletter App Dashboard Version2
Login (Version1) Performance Analysis (Version1)
Newsletter App Landing Page Version1 Newsletter App Dashboard Version1

Conclusion

The use of the newsletter app (now the Tinker eLearning App) has been such a timely solution. It simplified everyone's tasks, including my own. All the staff could now gracefully continue doing what they do best as the software does the rest for them.


Comments (0)