Git Product home page Git Product logo

moody's Introduction

Moody

             

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/

MoodSelection

MoodEntry

JournalEntry

Entries

Features

  • NextAuth with Google
  • Track mood, influences, feelings, and journal entries
  • View historical entries
  • Delete mood entries

Development

Local Environment

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:

  1. In the Storage tab, create a new db
  2. Run npm i -g vercel@latest to install the Vercel CLI
  3. 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:

  1. Go to https://console.cloud.google.com/
  2. Click APIs & Services
  3. Create a new project
  4. Go to Credentials > Create Credentials > Oauth Client Id
  5. Under Authorized Callback URIs, add your local environment: http://localhost:3000/api/auth/callback/google
  6. 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/

Deployment

Configuration

  • 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 and CLIENT_SECRET

Vercel

Your PostgresSQL variables should already be setup in Vercel.

  1. In Vercel, go to Settings > Environment Variables
  2. Add the variables you added to .env above

moody's People

Contributors

darnocer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.