Next generation of quanghuy.dev

This blog is my personal space to express myself in a weird way, like writing stuff nobody can understand. People ask me why I don't use WordPress or Medium and instead built an entire website just to serve some simple things. Anyway, I am going to rebuild this blog (again) using something I am interested in.

Motivation

Even though this website was built with Next.js (version 11 at the time) and served by the Vercel platform, things are changing every day, and the entire technical stack I originally used is now outdated, which does not make me happy.

Secondly, I want to use and leverage my enterprise knowledge to build something on a large scale. This opportunity would enhance my portfolio. Since then, I have fallen in love with the Cloudflare platform, so I would like to apply my existing knowledge to this developing platform.

There are also areas I want to improve, such as performance best practices, caching, high availability, pagination and more advanced integrations.

How?

Ok then, what do you mean by large scale application?

Originally, this website was the only thing that served content from the DatoCMS service, and it was optimized by the Vercel Platform. That's great. But since I want to implement the application myself, I want to replace those services with custom implementations.

Let's consider each aspect one by one. DatoCMS is great, but it's limited (yeah, I am not paying anything), so I want to build the entire Content API and run it on Cloudflare Workers & the D1 database. To explain in-depth, Cloudflare Workers is a serverless computing service that can host my backend functions and serve them on demand. The Cloudflare D1 database is a SQLite database that has been around for just a couple of years. I can tell you, service binding is one of the most impressive features I've seen, since they integrate tightly and don't incur the overheads of traditional HTTP protocols.

Replacing DatoCMS means I have to build a new user management system. However, Auth0 is one of the leading authentication services and provides some of the best integrations I can think of. But yeah, I have to build the entire Admin console myself, which is a fun job.

I have also used GraphQL before, as it comes as the default option with DatoCMS. But this time around, I don't think I want to use it anymore. I still prefer REST API as it's more friendly and easier to interact with.

Finally, I am going to keep using NextJS because I don't want to lose everything I've written for the current site. Also, the React and NextJS ecosystem is huge, and I think there's a ton of support out there that I can continue to use. Or maybe not; I am not sure if I will consider using something else.

Cloudflare's infrastructure is not that mature. Workers, D1, and Pages functions are very new to the industry, but they are promising.

Rough Roadmap

There's lots of thing, but here is what's in my mind right now:

  1. Auth0 initialization and setup.
  2. Content API: Using Hono, Zod and serve by Cloudflare workers and D1.
  3. Admin Dashboard: Using NextJs, authentication with Auth0.
  4. Blog: Using NextJs, with public access.

What does this mean for end users?

It's nothing new at the user perspective, since most of the thing are changed behind the infrastructure.

New opputunities

Conclusion

Thanks for reading.


More posts

Truyện ngắn: Những hồi ức chưa gặp

Dưới bóng cây mít cổ thụ, tình yêu của Linh và An nở hoa như những cánh hoa dịu dàng trong lành. Định mệnh gửi lời mời qua một quả mít, mở ra một thế giới mới và đồng thời đánh cắp Linh đi mãi mãi. Tình yêu của họ không chỉ là một câu chuyện ngọt ngào dưới ánh nắng chiều tà, mà còn là bản nhạc thiết tha của những kí ức, vẫn vang vọng dưới cây mít cổ thụ độc đáo. Bất chấp thời gian, tình yêu ấy vẫn tồn tại, như một hình bóng lấp lánh giữa những tia nắng vàng.

My gaming in 2023: A delightful year

A delightful year for gaming personally in 2023, started with Zelda ALBW, and ended with another Zelda TOTK.