Skip to content

feat: Add dynamic web portal for workshop module selection#5

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/build-new-ui-workshop
Draft

feat: Add dynamic web portal for workshop module selection#5
Copilot wants to merge 4 commits intomainfrom
copilot/build-new-ui-workshop

Conversation

Copy link

Copilot AI commented Mar 6, 2026

Workshop content was only accessible as static markdown files with no way for attendees to build a personalized agenda or filter exercises by language preference. This adds a Node.js/Express portal that serves the workshop dynamically.

Portal structure (portal/)

  • Express app — Helmet security headers, morgan logging, express-session, CSRF double-submit cookie (csrf-csrf), EJS templating
  • Module servicegetAllModules(), getModuleById(), filterByLanguage() over 7 hardcoded module definitions (module-00 → module-06) with duration, format, objectives, and language support metadata
  • Routes
    • GET / — Home page with language toggle (Java / JavaScript) and per-module checkboxes
    • GET /modules, GET /modules/:id — Module listing and detail (throws NotFoundError on unknown id)
    • GET /agenda, POST /agenda — Personalized agenda built from selected modules + language; POST validates language against allowlist and redirects to GET with query params
  • Error classesNotFoundError (404) and ValidationError (400) each carry a numeric statusCode; error handler maps err.statusCode to response status and hides internals for untrusted errors
  • UI — GitHub dark theme (#0d1117 / #161b22), module cards with duration/format badges, "Always Included" indicator for required modules (welcome, wrap-up), language tag chips
  • Tests — 10 Jest/Supertest tests covering service functions and all routes including a realistic CSRF-aware POST flow using request.agent

Security notes

  • CSRF protection is unconditionally applied; the POST test fetches a real token via request.agent before submitting
  • Session cookie is secure + sameSite: strict in production; SESSION_SECRET read from env
  • Language input validated against ['javascript', 'java'] allowlist before being reflected into the redirect URL

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Copilot AI and others added 3 commits March 6, 2026 18:45
- Express + EJS portal with GitHub-inspired dark theme
- Routes: home (/), modules (/modules, /modules/:id), agenda (/agenda)
- 7 workshop modules (module-00 through module-06) via moduleService
- Custom NotFoundError / ValidationError classes with HTTP status codes
- Helmet security headers, morgan logging, express-session for preferences
- CSRF protection via csrf-csrf double-submit cookie pattern
- Session cookie with sameSite:strict, secure flag tied to NODE_ENV
- 9 passing Jest/Supertest tests across routes and service layers

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ced error handling

Co-authored-by: raykao <860691+raykao@users.noreply.github.com>
… first

Co-authored-by: raykao <860691+raykao@users.noreply.github.com>
Copilot AI changed the title [WIP] Build a new UI for workshop web app feat: Add dynamic web portal for workshop module selection Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants