When I was sixteen, my IT teacher hired me to build a photography website. The site needed galleries, a booking system, a dashboard, and payment functionality.
Most of the project was going fine until I started running into problems with the payment integration.
The Problem
I was using PayPal for payments, with webhooks communicating with a separate backend.
The backend could go to sleep when it wasn’t being used, which meant requests sometimes had to wait for the server to start again. Combined with the way I had set up my API routing, this caused webhook timeouts and problems with payments being processed more than once.
This was one of the first times I had to think seriously about what happens when separate parts of an application don’t communicate reliably.
Making Things Worse
I spent a lot of time trying to fix the backend and eventually turned to an AI coding agent for help.
Around the same time, my computer’s SSD failed. I was two weeks away from the client’s deadline, and getting the computer repaired cost me around $300.
I was without it for about a week. During that time, I continued working with a school Chromebook.
The payment integration was still something I needed to fix, and I couldn’t afford to keep experimenting with the same approach.
Changing the Architecture
I eventually moved away from keeping the payment backend separate from the frontend.
Instead, I brought the server-side functionality into the main application using a backend-for-frontend approach. I also moved file storage to an external service.
This reduced the number of independently deployed parts I had to manage and made the payment workflow easier to work with.
I finished the website in time for the deadline.
What I’d Do Differently
Looking back, I would spend more time designing the payment flow before implementing it.
Payment providers can retry webhook deliveries, servers can become unavailable, and network requests can fail. A reliable integration needs to account for those possibilities instead of assuming every request will succeed exactly once.
I’d also build in better logging and idempotency handling from the beginning.
I originally thought having a separate backend was automatically a better architectural decision. That experience made me more careful about introducing complexity before I actually need it.
Thanks for reading.
More field notes