Moody is a simple Mood Tracking app! Keep track of timestamped mood entries, and associated feelings, influences, and notes.
Demo: https://moody-me.vercel.app/
- NextAuth with Google
- Track mood, influences, feelings, and journal entries
- View historical entries
- Delete mood entries
Connect Github Repo to Vercel:
- Push the code to a Github Repo
- Create a new Vercel project and connect to the Github repo
Install Dependencies:
npm install
Setup Vercel PostGres SQL Database:
- In the Storage tab, create a new db
- Run
npm i -g vercel@latest
to install the Vercel CLI - Pull down the environment variables:
vercel env pull .env
Create the database tables:
npx prisma db push
Generate the Prisma client:
npx prisma generate
Seed the database:
npm run prisma:seed
Run Prisma Studio:
npx prisma studio
View on
http://localhost:5555/
Setup Authentication:
- Go to https://console.cloud.google.com/
- Click APIs & Services
- Create a new project
- Go to Credentials > Create Credentials > Oauth Client Id
- Under Authorized Callback URIs, add your local environment: http://localhost:3000/api/auth/callback/google
- Add your production domain in the same format
Update .env
variables:
The Vercel PostgresSQL db variables should have already been synced. Ensure you have a .env.local
file with your local variables. Your .env
will store production variables.
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET
NEXTAUTH_URL
="http://localhost:3000"
SECRET
= Generate random string
Start Development Server:
npm run dev
View on
http://localhost:3000/
- Ensure your production domain is set in Google Oauth Authorized Callback URIs - https://your-domain.com/api/auth/callback/google
- Ensure your production domain is set as the
NEXTAUTH_URL
in.env
- You can utilize the same
CLIENT_ID
andCLIENT_SECRET
Your PostgresSQL variables should already be setup in Vercel.
- In Vercel, go to Settings > Environment Variables
- Add the variables you added to
.env
above