@waiyanmt/next-prisma
v1.0.4
Published
Create a Next.js app with Prisma ORM and Tailwind CSS
Maintainers
Readme
Create Next Prisma
A modern Next.js template with Prisma ORM, PostgreSQL, Tailwind CSS, and TypeScript. Perfect for building full-stack applications with a robust database layer.
Quick Start
Create a new Next.js + Prisma project:
npx @waiyanmt/next-prisma my-app
# or if installed globally
create-next-prisma my-app
cd my-appWhat's Included
- Next.js 16 with App Router
- Prisma ORM with PostgreSQL adapter
- Tailwind CSS v4 for styling
- TypeScript for type safety
- ESLint for code quality
- Pre-configured User and Post models
- Database connection setup
- API routes example
Setup
Install dependencies (already done by the CLI):
npm installSet up your database: Copy
.env.exampleto.envand update your database URL:cp .env.example .envEdit
.envwith your PostgreSQL connection string:DATABASE_URL="postgresql://username:password@localhost:5432/myapp?schema=public"Run database migrations:
npx prisma migrate dev --name initGenerate Prisma client:
npx prisma generateStart the development server:
npm run dev
Open http://localhost:3000 to see your app.
Available Scripts
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpx prisma studio- Open Prisma Studionpx prisma migrate dev- Create and apply migrations
Project Structure
├── app/ # Next.js App Router pages
│ ├── api/ # API routes
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
├── lib/ # Utility functions
│ ├── prisma.ts # Prisma client
│ └── utils.ts # Helper functions
├── prisma/ # Database schema and migrations
│ └── schema.prisma # Prisma schema
├── public/ # Static assets
└── tests/ # Test filesDatabase Schema
The template includes two basic models:
- User: id, email, name, posts, timestamps
- Post: id, title, content, published, author, timestamps
Customization
- Modify
prisma/schema.prismato add your own models - Update the UI in
app/page.tsxto match your design - Add authentication, API routes, or other features as needed
Learn More
Contributing
This is a template repository. To modify the template:
- Make your changes
- Test with:
npm run dev - Update this README if needed
- Publish to npm:
npm publish
License
MIT
