-
Notifications
You must be signed in to change notification settings - Fork 0
Add onboarding docs, DAL auth pattern, and GitHub templates #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5a3e49b to
31b8fe5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a comprehensive authentication overhaul, adds extensive developer onboarding documentation, and modernizes GitHub templates. The changes establish a unified token-based authentication system using the Data Access Layer (DAL) pattern, replacing the previous password-based approach with HMAC-signed tokens from the PRFC member portal.
Key Changes:
- Implemented token authentication with DAL pattern for unified admin and member access
- Added comprehensive onboarding documentation including architecture diagrams, ADRs, and first-exercise guide
- Replaced Markdown issue templates with structured YAML forms for better issue tracking
Reviewed changes
Copilot reviewed 42 out of 48 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/lib/dal.ts |
New Data Access Layer with HMAC token validation, session management, and admin authorization |
src/lib/auth.ts |
Deleted - replaced by DAL pattern |
src/middleware.ts |
Simplified to cookie presence check for UX optimization; real auth moved to DAL |
src/app/api/auth/callback/route.ts |
Token handoff endpoint receiving signed tokens from PRFC portal |
src/app/api/dev/token/route.ts |
Development-only token generation for local testing |
src/app/(public)/dev/mock-portal/page.tsx |
Mock authentication portal simulating production login flow |
src/app/api/referral/route.ts |
Updated GET endpoint to use requireAdmin() from DAL |
src/actions/referral.ts |
Updated toggleRedeemed action to use requireAdmin() |
test/api/referral-route.test.ts |
Updated tests to mock requireAdmin instead of verifyDatabaseAccess |
test/actions/referral.test.ts |
Updated tests to mock requireAdmin instead of verifyDatabaseAccess |
e2e/referral-database.spec.ts |
Updated E2E tests to use mock portal login flow |
src/lib/db.ts |
Added TiDB adapter for Vercel production environment |
src/env.ts |
Added PRFC_PORTAL_SECRET validation with 32-character minimum |
src/schema/error.ts |
Added FORBIDDEN error code for authorization failures |
src/utils/errors.ts |
Added 403 status mapping for FORBIDDEN error code |
docs/README.md |
New documentation index linking to all guides and ADRs |
docs/getting-started.md |
Comprehensive setup guide with fnm, Docker, and environment configuration |
docs/contributing.md |
Development workflow guide with CI/CD pipeline explanation |
docs/architecture.md |
System overview with diagrams, tech stack, and key patterns |
docs/style-guide.md |
Code conventions covering naming, imports, types, and error handling |
docs/first-exercise.md |
Onboarding exercise guiding new developers to create team page |
docs/decisions/*.md |
Four ADRs explaining Prisma/MySQL, Server Actions, auth patterns, and CI/CD choices |
test/README.md |
Test structure documentation with commands and mock descriptions |
src/README.md |
Source directory guide explaining folder structure and conventions |
.github/ISSUE_TEMPLATE/*.yml |
YAML forms for bug reports, feature requests, and onboarding issues |
.github/pull_request_template.md |
Simplified PR template focusing on changes and testing steps |
.github/workflows/ci.yml |
Added TypeScript type checking step before build |
package.json |
Added TiDB adapter dependencies and Node.js engine requirement |
.env.local.example |
Updated with PRFC_PORTAL_SECRET and removed DATABASE_PASSWORD |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
31b8fe5 to
b212609
Compare
b212609 to
f896d36
Compare
…and package-lock.json
…, and package-lock.json
Summary
Changes
Documentation
docs/README.md- Documentation indexdocs/architecture.md- System overview with diagramsdocs/first-exercise.md- First PR onboarding exercisedocs/decisions/- ADRs for Prisma, Server Actions, auth, CI/CDsrc/README.md,test/README.md- Directory guidesAuthentication
src/lib/dal.ts- Data Access Layer withverifySession(),requireAdmin(),validateToken()src/app/api/auth/callback/route.ts- Token handoff from PRFC portalsrc/app/(public)/dev/mock-portal/page.tsx- Mock portal for local devsrc/app/api/dev/token/route.ts- Dev token generationsrc/lib/auth.tsTesting
vitest.config.mts- Vitest configuration with environment globsvitest.setup.ts- Global setup with server-only mockGitHub Templates
new-issue.mdwith YAML form templatesbug-report.yml- Added environment fieldfeature-request.yml- Priority and acceptance criteriaonboarding.yml- Structured task breakdown with resource linksconfig.yml- Disables blank issuesDependencies
@tanstack/react-virtual- List virtualization@react-email/components,@react-email/render- Email templatesfuse.js- Fuzzy searchtwilio- SMS integrationcommand.tsx,alert-dialog.tsxTesting
npm audit)Token Format
Validated locally via HMAC-SHA256. No API round-trip to portal.
Mock Portal Desktop Viewport
Mock Portal Mobile Viewport