"99 little bugs in the code, 99 little bugs. Take one down, patch it around, 117 little bugs in the code."
This blog post explores the development of a .NET 9 API project for a local foundation, showcasing a seamless integration of advanced text editing tools, scalable backend solutions, and cloud hosting.
Creating My First Client Project: A .NET 9 API Solution
Section One: Overview
Recently, I had the opportunity to collaborate with a local foundation to develop a .NET 9 API project that enhanced the functionality of their existing website. For context, the foundation's website was built using Hostinger's website editor and hosting platform.
Hostinger is an excellent choice for non-developers, as it enables easy website design and publishing at a lower cost and complexity than custom-coded solutions. Its drag-and-drop tools, simple form builders, and redirect link options provide a straightforward way to create a functional site. However, this simplicity comes with limitations. Hostinger's built-in tools can restrict customization and advanced functionality, leaving websites primarily front-facing with constrained interactivity.
Section Two: The Problem
The client wanted to implement a form that donors could use to write personalized letters to recipients. While Hostinger's form builder allowed for basic text inputs, it lacked advanced text editing and formatting tools necessary for creating styled, personalized messages. This presented a challenge: how to deliver a rich text editing experience within the constraints of Hostinger's platform.
During my research, I discovered Hostinger's Code Block feature, which allows custom front-end elements and logic. Leveraging this feature, I began developing a solution.
Section Three: The Solution
Part One: The Form
After testing different approaches, I created a custom form using HTML, CSS, and Bootstrap. To meet the client's requirements for rich text editing, I integrated the TinyMCE text editor plugin, which offers robust text formatting options. (For more details on how I implemented this plugin, check out my previous blog post.)
With the form complete, I turned my attention to its business logic. Using JavaScript and jQuery, I implemented an asynchronous AJAX call to the API's POST method. This handled letter creation, sending emails via Gmail's SMTP service, and saving the letters to an Azure SQL database. To ensure a seamless user experience, success or error messages were displayed based on the outcome of the email submission.
Part Two: The API
The API was built using .NET 9 Core to handle POST requests from the Hostinger form. Both the app service and database were hosted on Azure, leveraging GitHub Actions for continuous integration and deployment. This automated the publishing process and ensured a smooth workflow.
The project adhered to RESTful principles, using JavaScript and JSON for efficient data handling. Despite my prior experience with .NET Core development, this project marked my first time working with .NET 9, a technology released only weeks before I started. Limited documentation and examples added complexity to the project.
As this was my first client project, I approached it differently from the traditional method of tackling unfamiliar technologies. Typically, creating a project with limited experience involves extensive research, watching tutorials, and consulting with more experienced developers. This process can be time-consuming and often redundant. However, I relied exclusively on AI tools like ChatGPT to streamline the development process. By crafting effective prompts, I was able to significantly reduce the time spent on research and code writing, allowing me to focus more on understanding the project's architecture and ensuring it met the client's requirements.
Section Four: Closing Remarks and AI
Emerging AI tools, particularly ChatGPT, were instrumental in planning, creating, debugging, and finalizing the project to meet client specifications. By crafting clear and effective prompts, I generated both front-end and back-end code without manually writing a single line. This allowed me to focus on high-level project management and gaining hands-on experience with Azure's platform.
AI significantly increased my productivity while facilitating learning. However, as I’ll discuss in a future blog post, using AI tools comes with limitations that require thoughtful management.
This project marked an important milestone in my career. It was the first time I independently designed and developed a solution tailored to a client’s needs, introduced me to various new technologies, and provided a valuable learning experience. I consider it a resounding success.
0 Comments