realworld.io with Next.js (no htmx)
July 15, 2024
Another RealWorld project. Previously I have built a Laravel + HTMX and Go Fiber + HTMX. This time I'm doing it without HTMX, purely with Next.js 14 React Server Components and Server Actions.
The project: Next.js 14 + React Server Components and realworld.io
This was created to demonstrate a fully fledged fullstack application built with:
- Next.js 14 - App Router, Server Components, Server Actions
- Prisma - ORM (SQLite local / PostgreSQL production)
- iron-session - encrypted session cookies
- Zod - schema validation
- Tailwind CSS - styling
- that adheres to the RealWorld specification
Advantages:
- Server Actions, form logic co-located with the component
- RSC renders HTML on the server, zero client JS for page content
- loading.tsx gives instant skeleton states without extra libraries
- TypeScript end-to-end, no context switching between template and controller languages
The repository and live example can be accessed below:
RepositoryLive Example