Why I Started Using Next.js

Introduction

Its been over 3 years since I have been working as a software engineer. I primarily started out with HTML and CSS to build basic static sites. Eventually I learned how to do cool animations and interactions with JavaScript. Since then I have gradually kept seeking new ways to implement my ideas, leading me to explore different web frameworks.

I have worked with react, Flask, Django, Astro, Wordpress, & Elementor to build all kinds of websites to fit my specific use cases. Overtime I have developed a strong affinity towards Django, for more complex and dynamic features. Recently I have found myself looking for a fully integrated JavaScript framework that handles both front and backend, to really mimic Django's monolithic architecture. Personally, I loath the overhead of separating by backend from my front end and communicating via an API, so after hearing the hype I finally decided to give Next a shot.
 

The Problem

The first reason I left my Django Habitat was for one reason and one reason alone, deployment. Python applications are frustrating to deploy for one reason or another, leaving the only two options, using docker or figuring out how to deploy your python app on any given server. Recently, I had a client who needed their service in a very short period of time, and after sleepless nights, I got the application working on my laptop but failed to deploy in time. I now have to use cookie cutter to create my Django apps, but I had to find a framework that would handle both the front and backend, and most importantly could be deployed in seconds.


This led me to Next.js, the hot kid on the block. I had used react before so I figured that this would not be hard to adopt. Heading over to the get started button on the Next.js page, I was immediately blown away with the focus on the developer experience. Next was open, but it also had its ecosystem. It was so easy for me to connect to Supabase, use tailwind, and work with typescript. Just looking at these three features alone, I was blown away. As a developer I felt like Guillermo Rauch, CEO of Vercel, really had developers like me in mind when his team developed Next.
 

CSR & SSR

Firstly Next does everything React does with CSR (Client Side Rendering) and reusable components for your SPA (Single Page App). With Next, you can not only do CSR but SSR (Server Side Rendering). The convenience of easily defining what is rendered on the server or the client is just phenomenal. Recently they also included partial pre-rendering.
 

Unique Features

Page routing in Next can either be static or dynamic. Next also has a very clean hierarchical file structure, that makes it very easy to implement static page routing. Next also has a really robust image tag that handles image optimization. The good people at vercel also have some really great APIs specifically for Next. Next also has a lot of inbuilt features such as next auth, and caching.
 

Conclusion

When I deployed my first Next app to Vercel, It literally took less than a minute. I am now figuring how to include an ORM like drizzle, and integrate a CRM like payload. I also will soon me experimenting with Next as a front-end for my Django app. Otherwise, if you are looking for a one-size fits all JavaScript framework with an emphasis on developer experience, Next is for you.

References

  • https://news.ycombinator.com/item?id=27168403
  • https://rauchg.com/about
  • https://discuss.python.org/t/does-python-have-two-major-problems-deployment-and-libraries/50000

Comments

Popular posts from this blog

The Building Blocks of IOT

GitHub Streaks