Hello everyone, and welcome to the first blog post in 2024! Itâs been a while since I last posted here, so, Iâm glad to be back here sharing stories on my blog again!
Baby steps: CRUD API
During the past two or three months, Iâve been learning backend development and created 2 very simple APIs with Go and PostgreSQL as the database. The first one, which I affectionately named âFiber Student APIâ, is very very simple. You can use it to do CRUD operations on studentsâ data. Oh, and also I used basic auth to do it. I made with with Fiber, which is probably a bad idea, because by immediately using a framework, I donât understand the fundamentals. I should probably make another one with the net/http
standard package in the future, haha.
I made the second one, also with Go and Postgrres, for learning authentication with JWT (short for JSON Web Token). It was easier than I expected thanks to the jwt.io website, and I also came across this very useful ebook, on that site, which helped me a lot in understanding JWT.
Step up: auth, ORM
Now I titled the first section âbaby steps: CRUD APIâ but this next project Iâm working on is also a bit of a CRUD API. Yeah, whatever I guess.
So currently I am working on a massively more complicated API for Artisan Beverage Studio (made with Fiber and GORM and Postgres) where you can order food and drinks, (it doesnât handle payments, it doesnât need to anyway). The authentication scheme still uses JWT but now has the ability to distinguish between an anonymous user, a logged in user, and an admin. For now the repository is private, and I am planning on open-sourcing it after reaching MVP.
Just to be honest, when making this API, my impostor syndrome kicked in. I chose Fiber again for this project, which I know is not the best choice. From what iâve read, the Go community also does not like it, because itâs built on top of FastHTTP, which is not extensible from Goâs built in net/http
package. Then, I added GORM, which apparently the Go community also doesnât like, citing âunecessary complexityâ. They prefer writing raw prepared SQL statements. Nevertheless, I will carry on, because delivering an imperfect working MVP is better than not delivering a nonexistent, perfect product, right?
Hopefully I can continue this journey and become a fullstack dev soon! Wish me luck.
Update 07/04/2024
update 07/04/2024: Ialready open sourced ABS App a long time ago, But I only wrote about it now. Please criticize the code and open a PR if you can improve it, itâs still evolving. THANKS A LOT!