This example shows how you can use a Postgres database to support your Next.js application and style by Tailwind CSS.
In neon, the string like this:
postgres://<role>:<password>@<hostname>/<database>
Copy the .env.local.example
file in this directory to .env.local
(which will be ignored by Git):
cp .env.local.example .env.local
Then set each variable on .env.local
:
DATABASE_URL
should be the Postgres connection string you got from step 1.
npm install
npm run dev
# or
yarn install
yarn dev
Your app should be up and running on http://localhost:3000! If it doesn't work, post on GitHub discussions.
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.