How isayulee/csa-id works
CSA Digital Profile is a Google-authenticated business-card editor and private Peer Adviser workspace. The main journey is sign-in, draft editing and permanent slug claim, publication, then public /id/<slug> viewing with social links and an evaluation link. Separate portal capabilities cover adviser operations, course and teaching-kit administration, and directory access; reporting and profile moderation are additional branches. The graph reflects README-described capabilities where implementation excerpts are absent; those relationships are cited to the README rather than presented as inspected source calls.
Main entry points: schema.ts D1 database · profile-images.ts Image storage and policy · route.ts Draft and slug API · page.tsx Published profile page
Components 27
Identity and access
- Login and OAuth routes
app/login/google/route.ts - OAuth callback
app/login/google/callback/route.ts - Session management
lib/auth/session.ts - Current account
lib/auth/current-user.ts
Profile lifecycle
- Profile editor
components/dashboard-editor.tsx - Draft and slug API
app/api/profile/route.ts - Draft and slug data
lib/profile-data.ts - Publish controls
app/api/profile/publish/route.ts - Publication lifecycle
lib/profile-lifecycle.ts - Published profile page
app/id/[slug]/page.tsx - Evaluation form
lib/evaluation-form.ts - Image upload endpoint
app/api/uploads/[kind]/route.ts - Image storage and policy
lib/images/profile-images.ts
Adviser workspace
- Adviser workspace
components/portal/adviser-desk.tsx - Portal APIs
app/api/portal - Peer adviser approvals
app/api/admin/peer-advisers - Courses and teaching kits
lib/portal/courses.ts - Advising requests
lib/advising-request-parsing.ts - Reports and review
app/api/reports/route.ts - Admin operations
lib/admin.ts
Data and integrations
- Cloudflare bindings
lib/cloudflare.ts - D1 database
lib/db/schema.ts - Image KV
Other components
- Peer Adviser
- Advisee
- Administrator
- Google sign-in
Connections 30
- Peer Adviser → Login and OAuth routes: signs in
- Google sign-in → Login and OAuth routes: authenticates
- Login and OAuth routes → OAuth callback: redirects
- OAuth callback → Session management: creates session
app/login/google/callback/route.ts - Session management → D1 database: reads and writes
lib/auth/session.ts - Peer Adviser → Profile editor: edits profile
- Profile editor → Draft and slug API: saves draft
components/dashboard-editor.tsx - Draft and slug API → Current account: checks account
app/api/profile/route.ts - Draft and slug API → Draft and slug data: reads and saves
app/api/profile/route.ts - Draft and slug data → D1 database: reads and writes
lib/profile-data.ts - Peer Adviser → Publish controls: publishes profile
- Publish controls → Publication lifecycle: publishes or unpublishes
app/api/profile/publish/route.ts - Publication lifecycle → D1 database: updates snapshots
lib/profile-lifecycle.ts - Advisee → Published profile page: opens slug
- Published profile page → D1 database: loads published profile
app/id/[slug]/page.tsx - Published profile page → Evaluation form: links evaluation
app/id/[slug]/page.tsx - Peer Adviser → Image upload endpoint: uploads images
- Image upload endpoint → Image storage and policy: replaces image
app/api/uploads/[kind]/route.ts - Image storage and policy → D1 database: updates image keys
lib/images/profile-images.ts - Image storage and policy → Image KV: stores image
lib/images/profile-images.ts - Image storage and policy → Cloudflare bindings: uses bindings
app/api/uploads/[kind]/route.ts - Peer Adviser → Adviser workspace: uses workspace
- Adviser workspace → Portal APIs: manages advising · Inferred; not shown in the code that was read.
- Portal APIs → Advising requests: handles requests · Inferred; not shown in the code that was read.
- Portal APIs → Courses and teaching kits: serves course data · Inferred; not shown in the code that was read.
- Administrator → Peer adviser approvals: approves advisers · Inferred; not shown in the code that was read.
- Administrator → Courses and teaching kits: manages kits and courses · Inferred; not shown in the code that was read.
- Administrator → Reports and review: reviews reports
app/api/reports/route.ts - Reports and review → D1 database: records reports
app/api/reports/route.ts - Administrator → Admin operations: moderates profiles · Inferred; not shown in the code that was read.