Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/2color/next-prisma-incremental

A demo showing how to leverage next.js incremental generation
https://github.com/2color/next-prisma-incremental

jamstack next prisma

Last synced: 15 days ago
JSON representation

A demo showing how to leverage next.js incremental generation

Awesome Lists containing this project

README

        

# Jamstack with Prisma and Next.js - Incremental Static-Regeneration

This is an example blog app showing how to work with Prisma in Next.js.

The blog compares the two rendering approaches that Next.js supports – **static generation with incremental static re-generation** and **server-side rendering** for post pages.

## Installation

Clone the repo and install the dependencies:

```bash
# with npm
npm i
```
## Start the database

```bash
docker-compose up -d
```

## Set DATABASE_URL

Create `prisma/.env`

```bash
touch prisma/.env
```

And add the following to the file

```
DATABASE_URL="postgresql://test-user:test-password@localhost:5432/my-blog?schema=public"
```

## Create the database

```bash
npx prisma db push --preview-feature
```

## Run the App

```bash
# with npm
npm run dev
```

## License

MIT