Skip to content

gyarab/2024-4e-kratochvil-prachsocial

 
 

Repository files navigation

PrachSocial

Installation

npm i --legacy-peer-deps
  1. Create Project
  2. Copy Secret and App ID under Legacy
Fill in these values into .env

Get Stream

  1. Create App
  2. Copy Key and Secret under App Access Keys
  3. Turn off Threads & Replies under Chat Messaging > Channel Types > messaging
Fill in these values into .env
  1. Create Project

OAuth Consent Screen

  1. Select External

  2. Fill in required fields

  3. Add .../auth/userinfo.email and .../auth/userinfo.profile under Scopes

  4. Publish Project

Credentials

  1. Create OAuth client ID
  2. Select Web Application type
  3. Add http://localhost:3000/api/auth/callback/google under Authorized redirect URIs
  4. Copy Client ID and Client secret
Fill in these values into .env

Create .env file

POSTGRES_USER="username"
POSTGRES_HOST="host"
POSTGRES_PASSWORD="password"
POSTGRES_DATABASE="database"

UPLOADTHING_SECRET='UploadThing Secret Key'
NEXT_PUBLIC_UPLOADTHING_APP_ID='UploadThing App ID'

NEXT_PUBLIC_STREAM_KEY='Stream Key'
STREAM_SECRET='Stream Secret'

GOOGLE_CLIENT_ID='CLIENT_ID.apps.googleusercontent.com'
GOOGLE_CLIENT_SECRET='CLIENT_SECRET'

CRON_SECRET='Random String'
NEXT_PUBLIC_BASE_URL='http://localhost:3000'

Setup Prisma

npx prisma generate
npx prisma db push

Setup Cron Job for Clearing Orphaned Uploads

crontab -e
0 2 * * * curl -X GET "http://localhost:3000/api/clear" -H "Authorization: Bearer [CRON_SECRET]"
Replace [CRON_SECRET] with yours from .env

Running Development Server

npm run dev

About

Next.js FullStack Social Media

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.9%
  • CSS 1.7%
  • JavaScript 0.4%