/mood

WIP: Journal built with NextJS, Postgres/Prisma, OpenAI, TailWind, and more

Primary LanguageTypeScript

Create

Node version 18.x.x and Next.js version 13.4.5.

Install Clerk

Clerk is the third-party authentication provider for the application

npm i @clerk/nextjs

Add Clerk secrets to .env.local

NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_XXXXXXXX
CLERK_SECRET_KEY=sk_test_XXXXXX
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/journal
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/new-user

Supabase Postgres Setup

  1. Create an Supabase.com account
  2. Create .env file in the root of the project
  3. Follow directions to setup Prisma with Supabase

Prisma ORM

  1. Install Prisma Client: npm i @prisma/client
  2. Install Prisma as dev dependency: npm i prisma --save-dev
  3. Initialize Prisma: npx prisma init

OpenAI API Account Setup

  1. Create an openai.com account
  2. Select the API App.
  3. Create an API Key
  4. Copy/Paste the key into your into .env.local using the variable OPENAI_API_KEY