Design patterns, load balancers and a white screen
Buzz is a discussion forum my team of three built for a uni software unit: React on the front end, Node.js and Express on the back end, and MongoDB.
Patterns that earned their place. I built admin announcements. An admin post is pinned to the top, shown with a red outline, and sends a notification to every user. A Factory decides whether a new post is a regular post or an admin post, so the controller never has to care which one it’s handling. Notifications use an Observer, so creating a post triggers notifications without the post code knowing how they’re sent. Before this project, design patterns felt like exam material. Here they kept the code readable.
I also added likes, comments with GIF support (Giphy API) and a sort toggle for the feed.
Testing. I wrote backend functional tests with Mocha, Chai and Sinon. The hardest part was stubbing the database properly so tests didn’t depend on a live connection. It made the difference between unit tests and integration tests click for me.
Deployment pain. We deployed to two AWS EC2 instances behind an Application Load Balancer, with nginx, PM2 and a GitHub Actions pipeline. It did not go smoothly:
- One instance was set up wrong and showed as unhealthy, so the load balancer barely sent it traffic. We rebuilt it.
- Every reset brought new problems: permissions, missing files, the frontend not rendering.
- An intermittent white screen never fully went away.
Close to the deadline, we decided as a team to stop making changes rather than risk breaking more. Knowing when to stop turned out to be one of the more useful lessons.