Project 3 — Small shop in Go (Golang)
Built with ports and adapters (hexagonal). Roles, file uploads, and money that must not be lost.
- 01Project 3 — Small shop: what we are buildingProducts, images, a cart and a checkout. This is where roles, files and transactions arrive.
- 02Step 1 — Setup and the schemaEvery command to get from an empty folder to a running server with tables.
- 03Step 2 — Products and the admin roleA second middleware, because knowing who somebody is does not tell you what they may do.
- 04Step 3 — Uploading a product imageThe endpoint with the most ways to go wrong, and the four defences that fix them.
- 05Step 4 — Serving images, and what io gives youSend the file back safely, and see why one-method interfaces make everything fit together.
- 06Step 5 — The cartPer-user rows again, plus one SQL trick that removes a whole branch of Go.
- 07Step 6 — Checkout, and what a transaction is forFive things must all happen, or none of them. This is what transactions exist for.
- 08Step 7 — Orders, and getting it ready to deployThe last endpoints, then logging, limits, a container and the hardening pass.