Jan 2022 - May 2022
Skills: Python • Flask • Microservices • Docker • Kong API Gateway • VueJS • Tailwind CSS • MySQL • REST API
Coursework Project
7 min read
This project was done as part of a requirement for the module IS213 - Enterprise Solution Development (ESD). It’s main focus was to facilitate the learning of concepts such as the microservices and service oriented architecture (SOA), containerization, writing, and documenting Representational State Transfer (RESTful) APIs.
The key learning outcome of the project was for the team to build an enterprise solution that is based on the microservice architecture for a business scenario.
Other requirements include:
The central problem that my team tackled was that hawker centers are always packed with long queues during peak hours, with customers having to stand and wait after ordering.
The team’s solution was to develop a web aplpication that can replace both the manual ordering and payment processes, aiming to reduce the congestion and hassle experienced in hawkers during peak hours.
Our main technical stack and their use cases
A user is synonymous with a customer, and the main action a user performs is to browse the hawkers and menu, followed by placing an order.
Functionalities include:
A hawker is a tenant in a hawker center, and the main actions the hawker performs include accepting, rejecting, and completing food orders, updating their food menu, and viewing all orders and order history.
Let’s go through a possible scenario of placing an order.
When a customer places an order, the following steps happen:
Subsequently, a hawker will receive the order and can choose to either accept or reject the order.
Main takeaway for this project was definitely learning how to write and document APIs, while designing a solution based on the microservices architecture, which allows services to be loosely coupled and independently deployable.
Working in a collaborative environment has highlighted to me the importance of proper documentation and standardization across the board, reducing the time and resources spent on tasks such as figuring out how the code works, or debugging a certain error that can be easily solved with proper documentation.
Another big takeaway was making use of containerization platform such as Docker, isolating applications so that developers do not have to deal with dependency and configuration issues which are pre-defined within Dockerfiles and yaml files.
FROM python:3-slim
WORKDIR /usr/src/app
COPY ./requirements.txt ./amqp/amqp.reqs.txt ./
RUN python -m pip install --no-cache-dir -r requirements.txt -r amqp.reqs.txt
COPY ./place_order.py ./invokes.py ./amqp/amqp_setup.py ./
CMD [ "python", "./place_order.py" ]
With the implementation of microservices, comes the usage of an API gateway, which in this case we used Kong as it has an accompanying Graphical User Interface (GUI) which made it simple and easy to configure and manage our services. However, due to the steep learning curve and a lack of time, we were unable to dive too deep and fully utilise the benefits of having an API gateway in our application, but nevertheless, the exposure to such a software is a learning point in itself.
Finally, this project also allowed me to learn a little more about the Advanced Message Queuing Protocol (AMQP) and RabbitMQ (message broker), but again, due to the lack of time and low priority, we were unable to explore and fully maximise the benefits of these technologies.
I thoroughly enjoyed and took away many lessons from this module, and it is without a doubt one of my favorite module in SMU. However, for a simple project such as this, making use of microservices may be a little bit of an overkill and I doubt I will be applying many concepts learnt here on other projects. But hey, it doesn’t hurt to learn new things, does it? 😄
This is just a introductory module to the world of backend development and hosting applications, just to get our feet wet. I know that the project is (in many ways) neither perfect nor well-written, so do take this post as just a personal reflection and documentation of my journey!