Next.js + Google Apps Script Web App + Google Sheets/Drive/Gmail 的學生申訴送件與學權組織協作系統。
- Next.js App Router, TypeScript, Tailwind CSS, shadcn/ui
- Auth.js Google OAuth for staff login
- Apps Script Web App for public case intake
- Google Sheets for case data, members, drafts, reviews, and audit logs
- Google Drive for uploaded attachments
- Gmail/MailApp from Google Apps Script for notifications
- Tiptap rich-text editor
pnpm install
pnpm devCopy .env.example to .env.local and fill in:
NEXT_PUBLIC_APP_URLNEXT_PUBLIC_CASE_FORM_URLGOOGLE_APPS_SCRIPT_WEB_APP_URLGOOGLE_APPS_SCRIPT_SHARED_SECRETAUTH_SECRETAUTH_GOOGLE_IDAUTH_GOOGLE_SECRET
The Apps Script source lives in apps-script/ and is managed with clasp.
完整部署操作請看 docs/DEPLOYMENT.md。
- Create or clone an Apps Script project.
- Copy
apps-script/.clasp.json.exampletoapps-script/.clasp.jsonand setscriptId. - Push the Apps Script source:
pnpm gas:push- In Apps Script, set script property
APP_URLto the deployed Next.js URL. - Run
setupCampusVoice()once and authorize the script. - Deploy the script as a web app.
- Copy the
/execURL to bothNEXT_PUBLIC_CASE_FORM_URLandGOOGLE_APPS_SCRIPT_WEB_APP_URL. - Copy the logged
SHARED_SECRETtoGOOGLE_APPS_SCRIPT_SHARED_SECRET.
The public form is rendered by apps-script/Index.html through Apps Script doGet(). It supports PDF, Word, PNG, and JPG uploads up to 8MB each, then stores files in the generated Drive folder.
Staff authorization is controlled by the Members tab in the generated Google Sheet.
ministercan manage members and approve reviews.membercan work cases and submit reviews.
The email used for Google OAuth must match an email in Members.
pnpm lint
pnpm test
pnpm build