https://github.com/clpi/dcode
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/clpi/dcode
- Owner: clpi
- Created: 2021-12-20T06:29:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-20T06:59:01.000Z (over 4 years ago)
- Last Synced: 2025-01-29T19:49:43.662Z (over 1 year ago)
- Language: JavaScript
- Size: 11.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
title: NextJS Prisma
description: A NextJS app using Prisma with a PostgreSQL database
tags:
- next
- prisma
- postgresql
- typescript
---
# NextJS Prisma Example
This example is a [NextJS](https://nextjs.org/) todo app that uses
[Prisma](https://www.prisma.io/) to store todos in Postgres.
[](https://railway.app/new?template=https%3A%2F%2Fgithub.com%2Frailwayapp%2Fexamples%2Ftree%2Fmaster%2Fexamples%2Fnextjs-prisma&plugins=postgresql)
## ✨ Features
- Prisma
- NextJS
- Postgres
- TypeScript
## 💁♀️ How to use
- [Provision a Postgres container on Railway](https://dev.new)
- Connect to your Railway project with `railway link`
- Migrate the database `railway run yarn migrate:dev`
- Run the NextJS app `railway run yarn dev`
## 📝 Notes
This app is a simple todo list where the data is persisted to Postgres. [Prisma
migrations](https://www.prisma.io/docs/concepts/components/prisma-migrate#prisma-migrate)
can be created with `railway run yarn migrate:dev` and deployed with `railway run yarn migrate:deploy`. The Prisma client can be regenerated with
`yarn generate`.
[swr](https://swr.vercel.app/) is used to fetch data on the client and perform optimistic updates.