Sometimes you just need a dead-simple CRUD app to poke at a database without committing to one vendor, or as a learner starter or test app. This little starter is exactly that: a Next.js 14 app with Prisma wired up, styled with Tailwind, and intentionally SQL-agnostic so you can point it at Postgres, MySQL, SQLite, or SQL Server by swapping env vars. It exposes REST-y routes (e.g., /api/testTable/{id}) and a basic UI to create/read/update/delete rows—nothing fancy, just the useful bits.
Why I built it
I’ve been bouncing between Postgres, SQL Server, and SQLite for different projects and wanted a single, minimal codebase that could follow me around. Prisma makes the adapter hop easy; the rest is just clean scaffolding and a couple of API handlers. The goal: a starter I can drop into a new environment, change one connection string, and done. This was also my first exposure to Prisma as an ORM and I have to say – it’s super easy to deal with.
What’s Inside:
- Next.js 14 (App Router) for the UI and API routes.
- Prisma ORM for DB access; swap providers via
.env. - Tailwind CSS for quick styling.
- Universal SQL: Postgres/MySQL/SQLite/SQL Server supported by changing
DATABASE_PROVIDERandDATABASE_URL. - RESTful endpoints that follow the
/api/testTable/{id}pattern.
Quick start
Works locally or in the cloud; just bring a database and a connection string.
- Clone & install
git clone https://github.com/macroflux/simple-nextjs-prisma-crud
cd simple-nextjs-prisma-crud
npm install
- Configure
.env
Pick your provider and set the URL. Examples from the README:
# Postgres
DATABASE_PROVIDER="postgresql"
DATABASE_URL="postgresql://user:password@localhost:5432/dbname"
# MySQL
DATABASE_PROVIDER="mysql"
DATABASE_URL="mysql://user:password@localhost:3306/dbname"
# SQLite (file-based)
DATABASE_PROVIDER="sqlite"
DATABASE_URL="file:./dev.db"
# SQL Server (Azure SQL etc.)
DATABASE_PROVIDER="sqlserver"
# DATABASE_URL="sqlserver://..."
- Generate Prisma client (and run migrations if you’ve got schema changes)
npx prisma generate
# dev iteration:
npx prisma migrate dev --name init
# or to apply existing migrations:
npx prisma migrate deploy
# optional visual DB browser:
npx prisma studio
- Run it
npm run dev
# app on http://localhost:3000
How the CRUD flows
The UI lives in the Next.js App Router and talks to /api routes for create/read/update/delete actions.
Routes follow a resource-centric shape (think /api/testTable and /api/testTable/{id}) so it’s easy to plug into any front-end view or external script.
Because Prisma abstracts the dialect, swapping databases is typically just a driver install + new DATABASE_URL. (README calls out the multi-provider design explicitly.)
Deploy/infra notes
The README sketches both local and cloud setups and nudges toward storing secrets in a vault (Azure Key Vault is mentioned as a future integration), which is the right call if you eventually host on Azure App Service, Vercel, etc. You can start with plain .env for dev, then promote to a secret manager in prod.
Check it out here! https://github.com/macroflux/simple-nextjs-prisma-crud
Other Notes
Be sure to check out Prisma’s very cool features, like their DB browser, etc. Not to downplay sequelize but – this is a pretty cool ORM.
Prisma: https://www.prisma.io
