Skip to content

ScrubinScheduling/scheduling-app

Repository files navigation

README

Scheduling App Monorepo

Web, Mobile, and API for a team scheduling app.

  • Web: Next.js 15 + Tailwind
  • Mobile: Expo (React Native)
  • API: Node.js (Express) + Prisma (PostgreSQL)
  • Auth: Clerk

Prerequisites

  • Node.js 22+
  • pnpm 10+
  • Docker (for local PostgreSQL) OR Supabase CLI (optional alternative)

Quick start (local)

  1. Clone and enter the repo
git clone https://git.cs.usask.ca/team-scooby/scheduling-app.git
cd scheduling-app
  1. Start PostgreSQL (Docker)
docker compose up -d

Clerk setup with screenshots

The following screenshots are referenced from docs/images/:

  1. Create a Clerk account at https://dashboard.clerk.com/sign-in
  2. Create application and get keys (view screenshots below)
    • Web and API will need the Secret Key. Web and Mobile need a Publishable Key.
    • Where to get them (Clerk dashboard → Configure → API keys):

Clerk application settings and IDs

Clerk API keys for Web and API

Clerk application creation

Screenshot 2025-12-02 at 2.55.14 PM.png

Copy Clerk API Keys posted on section 2 here and paste them in apps/web/.env file in the cloned repo locally

Screenshot 2025-12-02 at 2.55.32 PM.png

Screenshot 2025-12-02 at 2.55.57 PM.png

Copy the api keys here and paste them into apps/api/.env

Screenshot 2025-12-02 at 2.56.34 PM.png

Copy the api keys here and paste them into apps/mobile/.env

Ngrok Setup

  1. Create an ngrok account at https://dashboard.ngrok.com/login
  2. Install and authenticate ngrok using instruction provided for your OS Platform

ngrok install and auth token

  1. After that click on domains and copy that url

ngrok dev domain management

Clerk Webhook Setup

  1. Create a webhook endpoint
    • Clerk → Configure → Webhooks → Add Endpoint
    • Subscribe to at least user.created (you may also include user.updated, user.deleted)
    • Set URL to https://<your-ngrok-domain>/clerk/webhook
    • See screenshots below for assistance

Create webhook endpoint and select user events

Screenshot 2025-12-02 at 3.03.33 PM.png

Screenshot 2025-12-02 at 3.05.01 PM.png

Screenshot 2025-12-02 at 3.05.45 PM.png

Copy the the signing secret into the apps/api/.env like this CLERK_WEBHOOK_SIGNING_SECRET=whsec_xxx

  1. Create environment files BEFORE installing dependencies

The API runs Prisma on install, so make sure these files exist first.

  • apps/api/.env

# Please check Clerk Setup to get these keys
CLERK_SECRET_KEY=sk_test_xxx 
CLERK_PUBLISHABLE_KEY=pk_test_xxx
CLERK_WEBHOOK_SIGNING_SECRET=whsec_xxx

# PostgreSQL
DATABASE_URL=postgresql://schedulinglocal:scooby@localhost:5432/schedulingdb
DIRECT_URL=postgresql://schedulinglocal:scooby@localhost:5432/schedulingdb

#Cors
FRONTEND_ORIGIN=http://localhost:3000,exp:<Metro bundler IP>:8081

# Server
PORT=4000
  • apps/web/.env.local
# Please check Clerk Setup to get these keys
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxx
CLERK_SECRET_KEY=sk_test_xxx

# API base URL
NEXT_PUBLIC_API_BASE_URL=http://localhost:4000
  • apps/mobile/.env
# Please check Clerk Setup to get these keys
EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxx
  1. Install dependencies (workspace root)
pnpm install
  1. Run the apps (in separate terminals)
pnpm dev:api
pnpm dev:web
pnpm dev:mobile
  1. Run ngrok http —url=<ngrok-url> 4000

Scripts reference

Root (package.json):

"scripts": {  "dev:web": "pnpm -F web dev",  "dev:mobile": "pnpm -F mobile start",  "dev:api": "pnpm -F api dev",  "build": "turbo run build",  "build:web": "pnpm -F web build",  "build:api": "pnpm -F api build",  "postinstall": "pnpm -F api-client build; pnpm -F schemas build",  "build:api-client": "pnpm -F api-client build",  "db": "pnpm -F api db"}

API (apps/api/package.json):

"scripts": {  "build": "tsc -p tsconfig.json",  "dev": "tsx watch src/index.ts",  "start": "node dist/index.js",  "seed": "tsx prisma/seed.ts",  "db": "pnpx supabase start",  "postinstall": "prisma generate  && prisma db push"}

Web (apps/web/package.json):

"scripts": {  "dev": "next dev",  "build": "next build",  "start": "next start",  "lint": "eslint"}

Mobile (apps/mobile/package.json):

"scripts": {  "start": "expo start --clear",  "android": "expo run:android",  "ios": "expo run:ios",  "web": "expo start --web --clear"}

Useful URLs


Project structure

  • apps/
    • api/ — Express + Prisma
    • web/ — Next.js app (Clerk SSR + middleware)
    • mobile/ — Expo app
  • packages/
    • api-client/ — typed API client wrapper used by Web/Mobile
    • schemas/ — shared schema/types