Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Tech Stack

Planner - Tech Stack

Setup

Planner requires Node v16+ and Python3.10. It also requires local environment variables since it uses Neon (hosted PostgresDB service), a SMTP server, and Discord as authentication provider.

...

  1. Copy .env.example file to .env:

    Copy the contents of the .env.example file at the root of the repo to a new file called .env.

  2. Setting up Neon:

    Neon is a hosting service for PostgreSQL.

    1. Install the Neon CLI.

    2. Run neonctl auth and follow the on-screen prompts to login or create an account.

    3. Run neonctl projects create --name planner-dev to create a Neon project for Planner.

    4. Copy the string listed under 'Connection Uri' (ex: postgres://my-user:my-password@my-project-id.us-east-2.aws.neon.tech/neondb) and update the DATABASE_URL and DIRECT_DATABASE_URL variables in your .env file, as shown below.

      Code Block
      languagebash
      # Prisma
      DATABASE_URL="<your connection uri here>"
      DIRECT_DATABASE_URL="<your connection uri here>"
  3. Apply database migrations:

    Code Block
    languagebash
    npx prisma migrate dev
  4. Setting up an auth provider. You need at least one of these to log in. We recommend you only add Discord for convenience.

Expand
titleAdd Discord Authentication
  1. Go to Discord Developer Portal — My Applications

  2. Click on New Application

  3. Type "planner"

  4. Agree to their terms of service

  5. Click to create

  6. Click on OAuth2

  7. Click on reset the secret

  8. Click on "Yes, do it!" and copy the generated secret

  9. Click on "Add Redirect"

  10. Paste "http://localhost:3000/api/auth/callback/discord" into input

  11. Click on save changes at the bottom

  12. Copy and paste your secret and clientID (also on the OAuth2 page) into your .env:

    Code Block
    languagebash
       # Next Auth Discord Provider
       DISCORD_CLIENT_ID=<discord-client-id-goes-here>
       DISCORD_CLIENT_SECRET=<discord-secret-goes-here>

...

Code Block
languagebash
# DEGREE VALIDATOR
VALIDATOR=<http://localhost:5000>
  1. For any unused variables in your .env file, give them random values or comment them out.

  2. Generate Prisma client and run web server:

...