The Dawn of Times
"The best thing about the future is that it comes one day at a time" - Abraham Lincoln.
From data types in C (signed/unsigned int, char, float, void, etc.) to fundamental concepts like pointers, static and dynamic memory allocation, and further to data structures and algorithms (arrays, linked lists, trees, etc.), and our basic collaborative projects in C—printf, Simple Shell, and Monty interpreter (my favorite)—I had always wondered, "to what end?". Little did I know that these formed the basic foundation for entering the world of software engineering, restructuring my mind, and equipping me with invaluable technical skills to tackle significant problems using today's ever-advancing technologies.
Today, I present to you a piece of my hard work, a product of my endurance, an evidence of #DoingHardThings - SupplyTrackPlus. This is a web based desktop application (for now) designed to simplify the vendor management experience. It enables business owners to effortlessly register and manage their vendors, orders and even rate products on delivery - all in one place. And in this article I will be explain some of my challenges and victories during the course of development.
The Motivation
While performing my duties at work, I always sought a solution to the challenge of searching through numerous Excel sheets to find and calculate vendor supplies every month. At first, It started as an interactive console application where I can easily create vendors, assign orders to vendors and retrieve my data with ease. As I progressed in my Software Engineering course with ALX, I began envisioning the possibility of transitioning this to a web-based application with additional features, allowing other users to leverage this idea for their businesses. When the requirement for an end-of-foundations portfolio project arose, I whispered to my console application, "Your time has come.
Accomplishments
So far, I have been able to put up a simple web infrastructure design for SupplyTrackPlus
For the front-end I used HTML, CSS and JavaScript(JQuery) for a simple and responsive design while the back-end was developed with Python, Flask (framework), communicating with the database (MySQL). I decided to use flask - a lightweight and flexible web framework, to expose myself to the basic back-end business logic and implementation of RESTful API with less abstraction. This application's static content is served with NginX while the dynamic content with gunicorn. Since it is a demonstration project I decided to deploy to just one web server and therefore had no need for a load balancer. And right there, the whole infrastructure is monitored with with DataDog - A cloud monitoring service provider. As my first solo web app project, I could not have thought better!
With these features, users can seamlessly register and start enjoying our services without hassles.
Challenges and Victories
One of the outstanding challenges I countered during the initial development of this project which cannot elude my senses was encountered while working on creating a new review for a delivered order. I had wanted to dynamically display orders associated with a vendor when the user picks a vendor in the select field. Prior to this time I had tried as much as possible to avoid JQuery and AJAX due to my limited knowledge in there implementation (also considering the limited time assigned for this project). I had successfully retrieved the correct data from the database and had tried to render them using jinja 2 templating only to discover that the form must be submitted first before the route can retrieve the vendor id the user selected before retrieving and serving the order choices for the flask-WTF VendorForm. After numerous trials and research which involved communicating with my peers, I yielded to the powers of JQuery and AJAX. After the inevitable research and studies, with JQuery I graciously retrieved the vendor selected by the user and with AJAX, communicated to my back-end application route which handles this request, processes it and return orders that had not been previously reviewed by the user and yet associated with the selected vendor. Finally it updates the select options with the retrieved data even before the user clicks on the 'select order' box.
Another notable challenge arose when I discovered that my routes.py file (where I had defined my API routes) had more than 500 lines of code, making it difficult to find and trace individual codes/routes. I have to make my program modular - I thought. Then I fully understood the powers of flask blueprints. They had sounded as coding beauty context before now. The major challenge was in renaming my routes from "@app.route" to their respective blueprints.routes. It also required I change all arguments in my / url_for() functions both in all the HTML templates and the routes.
Technical Takeaway
Truer words have not been said in "experience is the best teacher".
I had spent more than 24 hours looking for a "flask" solution to the first challenge I narrated above. Was it worth it? yes! because I learnt an invaluable lesson - Never to say, I must use technology A or B for this project. It pays to be open minded to using different technologies that "Solves the problem", after-all that is the end goal. I also enjoyed the knowledge and experience of JQuery and AJAX because I later employed them in developing more user-friendly features in other parts of the application.
Another take-away is - A man who dreams big but must start somewhere must embrace modularity. It is easier to learn and stick to best practice than destroying and rebuilding what should have been avoided.
Lets Connect
https://www.supplytrackplus.me/