Taipo is a chat application that aims to help people to learn a new language. For more details on my motivation to build this, check my blog post.
This repository will keep track of the backend development. To see how I am building the whole application, please check the following repositories:
- 👾 Backend repository: jfcorsini/taipo-frontend
- 🎨 Frontend repository: jfcorsini/taipo-frontend
- 📱 Mobile repository: jfcorsini/taipo-mobile
The following sections will cover how to develop / maintain this application. More details should be added soon.
The following list describes all the access patterns that this application allows:
- Create a chat between two users.
- Create a group chat with multiple users.
- Return a list of chats that logged user can access.
- Add a message to a chat
- List all messages of a chat with pagination.
- Create / update a user details, e.g. last login time.
As the core of this application, there are two DynamoDB tables: users and chats. This could of course be done in a single one, but I prefered to separate the concerns at this level. Following DynamoDB Advanced Patterns, the design of the tables were done thinking about our access patterns.
The chats table will have the partition key being the chat identifier and the sort key will be different according to the need, as shown below:
PartitionKey | SortKey | Description |
---|---|---|
config | Provides details about the chat group | |
message__ | Details about the message | |
member_ | Contain data about the members of a group |
Meanwhile, the users table will have the partition key being the username of a user and sort key also being different according to the need, as shown below:
PartitionKey | SortKey | Description |
---|---|---|
config | Details about the user, like when was the last login |
Both tables will have a Global Secondary Index with the sortKey column being the primary key to allow extra queries. If needed, these and more indices will be described here.