Prerequisites
Required to hook everything up.
Installing the application ships the guestbook user interface and default Supabase wiring.
You'll need to first:
- Install Node.js.
- Configure a Supabase project.
- Hook up Google OAuth 2.0 to enable admin.
Install Node.js with npm
Download the 22 LTS Windows installer from nodejs.org. The installer includes npm.
Or, install fnm (fnm-windows.zip), then call:
fnm install 22
fnm use 22
Confirm that you have the right versions:
# Should return v22.23.2
node -v
# Should return 10.9.8
npm -v
Download the 22 LTS macOS installer from nodejs.org. The installer includes npm.
Or install nvm, restart the terminal, then call:
nvm install 22
nvm use 22
Confirm that you have the right versions:
# Should return v22.23.2
node -v
# Should return 10.9.8
npm -v
Create Supabase Project
Create an account and organization with Supabase, then on the Create a new project screen:
-
Enter in your Organization, Project name, and Database password.
Hang on to your Database password — we'll need to enter this into your
.env.localfile under yourDATABASE_URLto replace[YOUR-PASSWORD]. -
Select a Region.
-
Under Security, check off:
- Enable Data API
- Enable automatic RLS
-
Click Create new project.
When your project is ready:
-
In the left sidebar, click Project Settings, then select API Keys.
-
Under Publishable and secret API keys, copy the Publishable key to your clipboard.
Hang on to this — we'll need to enter this into your
.env.localfile under yourNEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY:NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=sb_publishable_<your-publishable-key> -
Under Publishable and secret API keys, copy the Secret key to your clipboard.
Hang on to this — we'll need to enter this into your
.env.localfile under yourSUPABASE_SECRET_KEY:SUPABASE_SECRET_KEY=sb_secret_<your-secret-key>
-
In the Settings left sidebar, select Data API.
-
Under Overview, copy the API URL to your clipboard. You'll need to clip the
rest/v1/portion from the end of the URL.Hang on to this — we'll need to enter this into your
.env.localfile and to hook up Supabase and Google OAuth 2.0:NEXT_PUBLIC_SUPABASE_URL=https://<your-database-url>.supabase.co -
In the top navigation, click the Connect button.
-
Select Direct, then under Connection Method, click Transaction pooler.
Leave the Type as
URI. -
Under Connection string, copy the Shared pooler to your clipboard.
Hang on to this — we'll need to enter this into your
.env.localfile under yourDATABASE_URL(replace with[YOUR-PASSWORD]):DATABASE_URL=postgresql://postgres.<your-database-url>:[YOUR-PASSWORD]@<your-database-region>.pooler.supabase.com:<port>/postgres
Create Google Cloud Project
Log in to your Google Cloud console:
-
When the project is ready, select your new project.
-
In the left sidebar, click APIs & Services, then select OAuth consent screen.
-
In OAuth Overview, click Get started.
-
Configure your project, then click Create. For example, enter your:
- App Information
- Audience (for personal Google accounts, select
External) - Contact Information
- Finish (to agree to the Google API Services: User Data Policy)
-
Click Create.
-
In the left sidebar, click Audience.
-
Under Test users, click + Add users then add the Google account email address you'll use to log into your admin dashboard.
-
Click Save.
-
In the left sidebar, click Clients.
-
Click + Create client.
-
In the Application type drop-down, select
Web application. -
Give your application a Name.
-
Under Authorized JavaScript origins, enter any URLs you'll use to access your application. For example:
- Local host:
http://localhost:3000 - Vercel deployment:
https://<your-vercel-project-name>.vercel.app
- Local host:
-
Under Authorized redirect URIs, enter your Supabase project's callback URL based on your
NEXT_PUBLIC_SUPABASE_URL. For example:https://<your-database-url>.supabase.co/auth/v1/callback -
Click Create.
-
On the OAuth client created popup, copy the Client ID and Client secret to your clipboard. Hang on to these — we'll need to enter this into Supabase to connect Google OAuth 2.0 in the next section.
Connect Supabase and Google
After you have your Google OAuth client credentials, within Supabase:
-
In the left sidebar, click Authentication, then select Sign In / Providers.
-
Under Auth Providers, click Google.
-
Toggle Enable Sign in with Google to ON.
-
Replace the Client IDs with your Google OAuth client ID.
-
Paste in your Client Secret (for OAuth).
-
Click Save.
What's Next
Fork the starter repository or drop the guestbook kit into your existing Next.js app: