Personal preference determines the choice of technology stack, this is normal! I personally don't prefer Next.js. Its single-language argument doesn't apply to me. I prefer to develop in multiple languages.
I have developed many React applications, but now I don’t use React very often. Currently I mainly use Go (Echo or Fiber), Django and Laravel (Go is my favorite language!).
Recently I needed to build a small app, consisting mainly of CRUD operations, with some dynamic functionality... I considered trying Next.js. I briefly built an application with Next.js a year ago, so I have a general understanding of the framework.
It turned out to be a painful experience!
I spent about an hour trying to use: https://www.php.cn/link/b0eec27361a2a03d4480b560df531df7
The documentation sucks! It assumes you deploy to Vercel. I just want to run it locally.
Anyway, I decided to try it from scratch...
I created a blank Next.js project with almost nothing in it! I had to set up Drizzle manually and even copy-pasting the code from the documentation didn't quite work.
I ran into some annoying bugs that I can't remember now, but all in all I had to read the logs and debug it myself, which is a blur on my memory.
To be fair, I’m already rusty, it’s my technical issues.
I don’t quite understand the point of Next.js, it’s just a meta-framework with router and caching built in. You can use Inertia for routing, skip all the tedious setup, and use React as usual.
My previous experience of using React in SPA made me hate SPA. It was painful to deal with routing and Redux. I prefer to use a backend router and do minimal state management in React itself.
Next.js solves this problem to some extent, but I feel it is not complete enough and is too coupled to Vercel.
Time is tight, I need to complete the task, there is no time to worry. Maybe I'll try Next.js again in the future, but at that point, getting the project done quickly is crucial.
In 5 minutes I built a complete admin panel, including authentication! Just run a few CLI commands.
Since Backpack uses Laravel as its base, creating database tables is very easy. Just run:
<code>php artisan make:model Project -m</code>
This sets up the model and migration files for me. I just need to add my database fields in the migration file and run:
<code>php artisan migrate php artisan backpack:crud Project</code>
With 3 commands in total, I got a fully usable CRUD interface with search and sort capabilities.
Next, I need to handle some background tasks, such as sending emails and queuing tasks for later processing.
<code>php artisan make:model Project -m</code>
In order to make the Redis queue mechanism work normally, I only need a SystemCTL task:
<code>php artisan migrate php artisan backpack:crud Project</code>
To be honest, Laravel sometimes makes me annoyed because they continue to add functions, causing the framework to become very bloated now.
This is why I like the minimalist style of Next.js, but I think it is too extreme to me.
A framework should be worn at least from the router, database layer and queue, because almost all complex applications need these functions.
This depends on your experience. The convenience brought by Laravel may not always be good. Personally, before Laravel appeared, I had built an over -authentication system and framework from scratch, so re -inventing the wheel was a bit boring. What is the significance?
The above is the detailed content of I just cant! NextJS?. For more information, please follow other related articles on the PHP Chinese website!