Skip to content

A list with useOptimistic, server actions(...) to test client-side interation with postgresql server delaying

Notifications You must be signed in to change notification settings

zenWai/List-with-Postgres-and-useOptimistic-nextjs15-react19

Repository files navigation

This project started as a simple list application to experiment with React's useOptimistic, startTransition, and server actions.

I kinda overengineered a bit ¯_(ツ)_/¯

The goal of this app is to create an experience that simulates a client-side application while saving and updating data in the background using a PostgreSQL database on a server that is lagging.

https://nextjs15-react19-list-with-useoptimistic.vercel.app/

Key Features

  • 🚀 useOptimistic
  • 🔄 startTransition
  • 🌐 Next.js server actions
  • 👤 Unique accounts with middleware cookie handling.
  • ⚡ Immediate feedback on actions
  • 🔐 Next.js middleware for cookie handling, new user creation, and edge cases
  • 🛠️ PostgreSQL as DB
  • Experimental React 19 compiler.
  • 🔍 Sorting and Filtering with useOptimistic
  • 🛡️ Error handling
  • 📏 Zod

Run locally

Add your POSTGRES_URL= in a .env, follow the .env.example
POSTGRES_URL="postgres://default:xxx@xxx:PORT/xxx?sslmode=require"