Skip to content

linuxunsw/swap

Repository files navigation

swap 📝

Linux Society's portal for managing subcommittee applications.

Features

  • zID email OTP authentication
  • applicant-facing application flow and status timeline
  • admin dashboard for cycles, subcommittees, and applicant management
  • Cloudflare Worker deployment with Hyperdrive, KV, and rate limit bindings

Tech Stack

  • SvelteKit + Svelte 5
  • Better Auth (email OTP)
  • Drizzle ORM + PostgreSQL (Neon Serverless)
  • Cloudflare Workers + Wrangler
  • Tailwind CSS 4
  • Shadcn-Svelte UI components

Local Setup

  1. Install dependencies:
pnpm install
  1. Create local environment variables:
cp .env.example .env
  1. Fill in required values in .env (at minimum DATABASE_URL, auth secrets, and app origin).

  2. Start the dev server:

pnpm run dev

Running with Worker Bindings Locally

Run a preview against the development environment. This provides a simulated Cloudflare Worker runtime and local bindings (miniflare):

pnpm run preview:mode:dev

Database Workflow

Drizzle reads DATABASE_URL from the environment (.env), so ensure it targets the correct database before running commands. For now, Neon branch management is done through environment variables. In development, the DB connection fallback also uses DATABASE_URL, so it can point to either local Postgres or a Neon dev branch.

# create migration files from schema changes
pnpm run db:generate

# apply migrations
pnpm run db:migrate

# push schema directly (use with care)
pnpm run db:push

# open Drizzle Studio
pnpm run db:studio

Production Build and Preview

  1. Prepare production environment values:
cp .env .env.production
  1. Build:
pnpm run build
  1. Preview production worker locally:
pnpm run preview

Deploy

After confirming production env values and database state:

pnpm run deploy

About

subcommittee web application portal

Resources

License

Stars

Watchers

Forks

Contributors