forked from neondatabase/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3efb93d
commit eec204f
Showing
45 changed files
with
169 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<img width="250px" src="https://neon.tech/brand/neon-logo-dark-color.svg" /> | ||
|
||
# Getting started with Neon, Next.js, Drizzle and Vercel Edge | ||
|
||
## Clone the repository | ||
|
||
```bash | ||
npx degit neondatabase/examples/with-nextjs-drizzle-edge ./with-nextjs-drizzle-edge | ||
``` | ||
|
||
Run the command below to copy the `.env.example` file: | ||
|
||
``` | ||
cp .env.example .env | ||
``` | ||
|
||
## Store your Neon credentials | ||
|
||
Store your Neon credentials in your `.env` file. | ||
|
||
``` | ||
POSTGRES_URL="postgresql://neondb_owner:[email protected]/neondb?sslmode=require" | ||
``` | ||
|
||
- `user` is the database user. | ||
- `password` is the database user’s password. | ||
- `endpoint_hostname` is the host with neon.tech as the [TLD](https://www.cloudflare.com/en-gb/learning/dns/top-level-domain/). | ||
- `dbname` is the name of the database. “neondb” is the default database created with each Neon project. | ||
- `?sslmode=require` an optional query parameter that enforces the [SSL](https://www.cloudflare.com/en-gb/learning/ssl/what-is-ssl/) mode while connecting to the Postgres instance for better security. | ||
|
||
**Important**: To ensure the security of your data, never expose your Neon credentials to the browser. | ||
|
||
Run the command below to install project dependencies: | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
Run the Next.js application using the following command: | ||
|
||
``` | ||
npm run dev | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<img width="250px" src="https://neon.tech/brand/neon-logo-dark-color.svg" /> | ||
|
||
# Getting started with Neon, Next.js, Prisma and Vercel Edge | ||
|
||
## Clone the repository | ||
|
||
```bash | ||
npx degit neondatabase/examples/with-nextjs-prisma-edge ./with-nextjs-prisma-edge | ||
``` | ||
|
||
Run the command below to copy the `.env.example` file: | ||
|
||
``` | ||
cp .env.example .env | ||
``` | ||
|
||
## Store your Neon credentials | ||
|
||
Store your Neon credentials in your `.env` file. | ||
|
||
``` | ||
POSTGRES_PRISMA_URL="postgresql://neondb_owner:[email protected]/neondb?sslmode=require" | ||
POSTGRES_URL_NON_POOLING="postgresql://neondb_owner:[email protected]/neondb?sslmode=require" | ||
``` | ||
|
||
- `user` is the database user. | ||
- `password` is the database user’s password. | ||
- `endpoint_hostname` is the host with neon.tech as the [TLD](https://www.cloudflare.com/en-gb/learning/dns/top-level-domain/). | ||
- `dbname` is the name of the database. “neondb” is the default database created with each Neon project. | ||
- `?sslmode=require` an optional query parameter that enforces the [SSL](https://www.cloudflare.com/en-gb/learning/ssl/what-is-ssl/) mode while connecting to the Postgres instance for better security. | ||
|
||
**Important**: To ensure the security of your data, never expose your Neon credentials to the browser. | ||
|
||
Run the command below to install project dependencies: | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
Next, run the command below to seed the database: | ||
|
||
``` | ||
npm run prisma:initiate | ||
``` | ||
|
||
Finally, run the Next.js application using the following command: | ||
|
||
``` | ||
npm run dev | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,49 @@ | ||
# Neon with Next.js and Prisma | ||
<img width="250px" src="https://neon.tech/brand/neon-logo-dark-color.svg" /> | ||
|
||
This app is built using the following technologies: | ||
- Neon as the Postgres database | ||
- Next.js as the fullstack framework | ||
- Prisma as the ORM | ||
# Getting started with Neon, Next.js and Prisma | ||
|
||
First, clone the project locally and install the project dependencies by running the following commands: | ||
## Clone the repository | ||
|
||
```bash | ||
git clone | ||
cd with-nextjs-prisma | ||
npm install | ||
npx degit neondatabase/examples/with-nextjs-prisma ./with-nextjs-prisma | ||
``` | ||
|
||
Run the command below to copy the `.env.example` file: | ||
|
||
Next, update the .env file with your database credentials. | ||
``` | ||
cp .env.example .env | ||
``` | ||
|
||
## Store your Neon credentials | ||
|
||
```bash | ||
npm run setup | ||
``` | ||
Store your Neon credentials in your `.env` file. | ||
|
||
Next, run the following command to setup your project: | ||
|
||
```bash | ||
npm run setup | ||
``` | ||
DATABASE_URL="postgresql://neondb_owner:[email protected]/neondb?sslmode=require" | ||
``` | ||
|
||
This commands creates an initial migration and seeds the database with some initial data. | ||
- `user` is the database user. | ||
- `password` is the database user’s password. | ||
- `endpoint_hostname` is the host with neon.tech as the [TLD](https://www.cloudflare.com/en-gb/learning/dns/top-level-domain/). | ||
- `dbname` is the name of the database. “neondb” is the default database created with each Neon project. | ||
- `?sslmode=require` an optional query parameter that enforces the [SSL](https://www.cloudflare.com/en-gb/learning/ssl/what-is-ssl/) mode while connecting to the Postgres instance for better security. | ||
|
||
Finally, run the following command to start the development server: | ||
**Important**: To ensure the security of your data, never expose your Neon credentials to the browser. | ||
|
||
```bash | ||
npm run dev | ||
Run the command below to install project dependencies: | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
When you navigate to [http://localhost:3000](http://localhost:3000) you should see the following: | ||
Next, run the command below to seed the database: | ||
|
||
<img width="1920" alt="Arc-001513" src="https://user-images.githubusercontent.com/27310414/221444176-3e3c8d24-a2f8-40e5-bb81-313b03d22606.png"> | ||
``` | ||
npm run setup | ||
``` | ||
|
||
Finally, run the Next.js application using the following command: | ||
|
||
``` | ||
npm run dev | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.