05 Aug 2019

Building a chat application - part 1

Detailing how I want to build a new chat application to help people learn new languages

Motivation

Learning a language is hard. Note that here I’m not talking about a programming language, but an actual human language. In my case, as I’m living in Finland for the past 2 years, I have decided that I want to be able to fluently talk in Finnish.

From my point of view, to be able to learn properly a language you need to be able to learn the grammar and know a large vocabulary. The former can be learned through books and classes and the latter can be learned through repetition, where you can use some apps like Memrise or WordDive. Once you know basic grammar (which takes a long while for Finnish) and know many words, it’s time to start putting things into practice. And that’s exactly where a problem comes to my mind.

Since I like to be able to study something by myself, I would like to have a way that I can talk/chat with someone to improve my communication skills in Finnish. I’ve tried a couple of apps like HelloTalk and iTalki, but I always felt that something was missing. What I want is an app/website where I can talk to someone and which corrects my mistake. A platform that I can find new content in different languages for different levels which can always teach me something. A place where while I’m learning, I can help other people that are facing issues that I have faced before. That is how I ended up deciding to build my own solution.

Solution

Finding a solution for a language learning issue also combines my desire to build a bigger project by myself. I know that with the time that I will need to invest in this, I could apply to proper studies. But with this project, I wish to be able to learn about different AWS Services, improve my skills in building Frontend applications together with learning how to build a proper mobile application.

After some thinking, I have decided to start building a chat application that allows people learning languages to talk to each other. This platform should allow people to talk one-to-one, have a group of friends discussing and also create topics so people can discuss, about some recent news for example. Once this simple version can be built and tested, it will be possible to analyze more what people learning a language need and start focusing on those topics more and more. So now let’s discuss how I think this platform should be built.

Technology

Building a chat app is something that many have done before and many will continue doing. As I already said, I’m not trying to invent the wheel, but mainly trying to build something focuses specifically on language learning. As I have been using AWS for a couple of years, I want to continue using it to learn and try out some different services. With that in mind, I have decided to build this application as the following chart described.

architecture

Basic Architecture

Both the Web and Mobile version of this application will use AWS Cognito to handle the authentication and store the user information. This will be done through User Pools and Identity Pools, but there is no need to go in details at the moment.

With the users being authenticated, we will fetch data using AppSync, which is a managed service that uses GraphQL to fetch data from our main data source, which is DynamoDB. Scalability and low operation overhead were important features that helped me to decide for such NoSQL database, but the ability to use DynamoDB Streams was a key for solving this problem.

With these Streams, it is possible to capture all of the table’s activity, i.e. all messages written, in real-time and add some processing. This will be the key to create a Lambda using AWS Translate that will provide all needed translations and store again on our data source. This will make the app feel faster, as all translations are done in the background, improving then the user experience.

Conclusion

Now that the idea is set, all I need to do is start building. For that, I will deliver a new post every two weeks, so that I have enough time to create content and describe it here.

At first, I will start building both the backend and the frontend at the same time, and once the basis is done I can start working on the mobile application as well.

I’m looking forward to building it :)


See you on the next part