The primary objective of this application is to demonstrate my expertise and knowledge in software development. Consider this a showcase of my technical abilities.
The application's front end is developed using TypeScript and the React library. For styling purposes, Sass has been employed. The front end is served to the back end via Django static files.
The back-end is divided into three Django templates:
The first two templates are responsible for authentication and are slightly modified versions of Django's default UserCreationForm
and login view. The final template is where the core application is served using React, adhering to most of the principles of a RESTful API.
The Messager API primarily consists of two custom database models in addition to the default "User" model: Chat
and Message
. These models are designed with the following fields. (As a side note I am using the Aura theme on Vscode which I strongly recommend )
This project utilizes Unit Testing to ensure the robustness and reliability of its backend models. The comprehensive suite of tests can be explored in the main/tests.py
file. These tests play a crucial role in validating the functionality of our models, contributing to the overall stability and performance of the project.
The backend of the Messager API includes a critical component known as chatConsumer
. This consumer enables users to connect to WebSocket channels, each associated with a specific chat, and transmit updates regarding message changes within that particular chat. The front-end application then responds to these updates by adjusting the message state accordingly.
The front end of this application is structured around eight distinct components, with the more critical ones showcased below:
-
ListChats
: This component is responsible for fetching and displaying all the chats in which the current user is involved. -
Chat
: TheChat
component serves as the parent element for several smaller elements. Its primary responsibilities include managing WebSocket connections and receiving data related to the current chat. -
ListMessages
: This is the only Class component within the project. This structural choice allows for control over scrolling behaviour, especially following changes to the message state. -
CreateMessage
: As its name implies, theCreateMessage
component facilitates the creation and updating of messages.
Feel free to explore these components to gain a better understanding of how the Messager API is structured and functions.