- NextJS - React framework learn more
- Supabase - Providing PostgresSQL DB learn more
- Prisma - Database schema controller and ORM learn more
- SurveyJS - Library for making surveys learn more
- Node.js latest version installed
- GitHub account
- Git file versioning system
- Visual Studio Code - code editor
To get a copy of the code on your GitHub profile press Fork
-> Create fork
- Open
cmd
orVisual Studio Code -> Terminal
- Navigate to folder where to save the local project
cd PATH_TO_PROJECT
For example
cd desktop
- Clone the project (you can find the link in your repository under
Code
button)
git clone https://github.com/<your-username>/<repository-name>.git
cd <repository-name>
- Install dependencies
npm install
Setup Supabase
- Create new project
- You can find connection parameters in Project Settings -> Database
- Copy
.env.example
file and rename to.env
- Copy
Connection string
from Supabase - In
.env
for DIRECT_URL paste the string and replace [YOUR-PASSWORD] - For DATABASE_URL paste the string, replace [YOUR-PASSWORD] and change the end to
6543/postgres?pgbouncer=true&connection_limit=1
instead of5432/postgres
# example
DATABASE_URL="postgres://[DATABASE-USER]:[YOUR-PASSWORD]@aws-0-eu-central-1.pooler.supabase.com:6543/postgres?pgbouncer=true&connection_limit=1"
DIRECT_URL="postgres://[DATABASE-USER]:[YOUR-PASSWORD]@aws-0-eu-central-1.pooler.supabase.com:5432/postgres"
- In your project folder run:
npx prisma migrate dev --name init
- In your project folder run:
npm run dev
- Open http://localhost:3000 with your browser to see the result.
- Add new project
- Import the repository from GitHub
- Create Environment Variables (replace YOUR_DIRECT_URL and YOUR_DATABASE_URL with your values)
- Press Deploy