diff --git a/docs/CURRENT_SPRINT_ISSUES.md b/docs/CURRENT_SPRINT_ISSUES.md new file mode 100644 index 0000000..dac4633 --- /dev/null +++ b/docs/CURRENT_SPRINT_ISSUES.md @@ -0,0 +1,279 @@ +# Current Sprint Issues Ongoing with `teacher-workspace-pg` Migration +The following issues are to be considered alongside the migration of the commits in `teacher-workspace-pg`, to ensure minimal merge conflict and dependencies. + +Issues here are grouped by status: Issues in Review, Issues in Progress, Issues Ready to be Taken Up, and Open Pull Requests (N) + +Updated as of: 5/21/2026 4.03PM + +# ISSUES IN REVIEW + +# [#132](https://github.com/String-sg/teacher-workspace/issues/132) Request logging middleware (method, URL, status, duration) + +## Overview + +Implement a middleware in the Go backend that logs every request with: HTTP method, URL path, response status code, and total request duration. Logs are structured JSON in production. + +## Business value + +- Provides visibility into platform usage and errors. Without request logging, diagnosing production issues (slow responses, unexpected errors, failed requests) requires guesswork. +- Enables operational monitoring — teams can track error rates, latency trends, and usage patterns from logs. + +## Engineering value + +- Structured JSON logs integrate cleanly with log aggregation and monitoring tools. +- Middleware approach ensures consistent logging across all routes without handler-level boilerplate. +- Straightforward to implement — method, URL, status, and duration are all available in Go middleware without needing to parse the request body. + +## Deferral tradeoff + +- Could technically be deferred, but debugging production issues without request logs is painful and time-consuming. The effort to implement is low relative to the value it provides from day one. + +# [#175](https://github.com/String-sg/teacher-workspace/issues/175) Add production session Store backed by Valkey + +## Overview + +Implement a `valkeystore` that satisfies the session `Store` contract using Valkey as the backing store. Intended for production deployments where session state must outlive a single process. + +## Goals + +- `valkeystore` implementation of the session `Store` contract backed by Valkey + +# ISSUES IN PROGRESS + +# [#40](https://github.com/String-sg/teacher-workspace/issues/40) Stateful session management + +## Overview + +Implement stateful session management using Valkey. The middleware must handle session creation on login, session validation on every incoming request, and session destruction on logout. + +## Goals + +- Typed session abstraction with in-memory store +- Production session `Store` backed by Valkey +- Session middleware + +# [#140](https://github.com/String-sg/teacher-workspace/issues/140) Migrate from Flow to Shadcn + BaseUI + +## Overview + +Replace the current internal organisation design system, Flow, with [Shadcn](https://ui.shadcn.com/) + [BaseUI](https://base-ui.com/). Migrate all existing components built on Flow to their Shadcn + BaseUI equivalents, align the theme tokens with UX (converting Flow's design tokens to the Shadcn convention), and set up the new design system as the foundation for all TW frontend work. + +## Existing components to migrate + +- Buttons +- Dropdown +- Menu +- Sidebar (mainly theme changes — sidebar was built in-house, may not need to be replaced) +- Card +- Tooltip + +## Engineering rationale for moving away from Flow + +- **Central ownership creates a delivery bottleneck.** Component fixes, adjustments, or additions go through the Flow team's backlog, build pipeline, and release process. A change that might take a TW engineer an hour can take days or weeks. The Flow team's position is that maintenance should be shared across consumers, but this assumes every team has engineers with bandwidth to work within Flow's internals (build system, token pipeline, slot-based styling, release process). The TW team does not have this bandwidth. + +- **Customising components is disproportionately expensive.** Flow's styling system has multiple internal layers. For example, changing a button's hover colour requires knowing which "slot" the hover style lives in (a button has four: root, icon, content, spinner), writing a nested override object that targets the right slot for the right variant at the right state, and understanding whether the override will win against the built-in style via Flow's custom class-merging system. In Shadcn, the same change is: open the button file, change the class, done. TW's product has its own theme with custom colours selected by UX, meaning colour overrides are needed on almost every component — this is the default workflow, not a one-off cost. + +- **Custom token vocabulary conflicts with industry-standard Tailwind.** Flow resets Tailwind's entire default theme (`--color-*: initial`, `--spacing-*: initial`, `--font-*: initial`) and replaces it with its own token vocabulary. Standard classes like `text-red-500`, `p-4`, `text-lg` stop working. Engineers must learn Flow-specific equivalents (`p-md` instead of `p-4`, `bg-btn-fill-brand-enabled` instead of `bg-blue-600`). Flow's no-reset option keeps Tailwind defaults alongside Flow tokens, but then both systems are active simultaneously with no guidance on which to use, leading to inconsistent code reviews and codebase drift. Shadcn uses one system: standard Tailwind extended with a small set of semantic CSS variables (`--primary`, `--secondary`, `--destructive`). + +- **End-to-end ownership.** As the main team working on the teacher vertical, TW should own the entire design system end to end rather than depending on an external team's roadmap. + +## Theme alignment with UX + +The current design tokens (colours, typography, spacing) follow Flow's convention. As part of this migration, the team will work with UX to convert these tokens into the Shadcn convention. This is a one-time, bounded collaboration — once the tokens are converted and set up, the work is complete. + +## Business value + +- Faster iteration on UI changes — engineers can fix or customise components in hours instead of waiting days or weeks for the Flow team. +- The TW team gains full control over the design system, removing an external dependency that has historically slowed delivery. +- A clean, single design token system reduces engineer confusion and code review friction, leading to faster development overall. + +## Engineering value + +- Eliminates the cost of navigating Flow's slot-based styling and custom class-merging system for every customisation. +- Standard Tailwind knowledge transfers directly — no need to learn or maintain Flow-specific token vocabulary. +- Shadcn's "copy the code into your repo" model means all component code lives in TW, accessible to every engineer with no external dependency. +- Removes the need to coordinate with the Flow team for component changes, reducing cross-team friction. + +## Deferral tradeoff + +- Could technically be deferred past WPS launch by continuing to use Flow for the initial launch UI. However: + - Every customisation built on Flow before migration is throwaway work — it will need to be rebuilt against Shadcn + BaseUI later. + - The migration cost grows with every new component built on Flow. + - Ongoing UI work during the launch crunch will be slower with Flow's customisation overhead than with Shadcn. + - Deferring also delays UX collaboration on the token conversion, which is a prerequisite for the migration. + - Doing this before the bulk of UI work begins minimises rework and unblocks faster iteration during launch. + +# [#126](https://github.com/String-sg/teacher-workspace/issues/126) Recreate Email OTP flow to TW repository + +## Overview + +Code and logic for the Email OTP flow exist in a separate repository. This task involves pulling the backend logic and UI into the main TW repository with minimal refactoring. + +## Business value + +- Email OTP is the alternative sign-in method for teachers. While all teachers will have Edupass accounts, OTP provides a fallback when Edupass is unavailable or when teachers encounter issues with their Edupass credentials. +- Consolidating into the TW repository ensures the sign-in experience is consistent and maintained in one place. + +## Engineering value + +- Eliminates cross-repository dependencies for a critical auth flow. +- Simplifies deployment — OTP flow ships as part of the single TW build artifact. +- Enables shared tooling, linting, and CI/CD coverage from day one. + +## Deferral tradeoff + +- Cannot be deferred. OTP is a required fallback login method for WPS launch. Without it, there is no alternative sign-in path if teachers encounter issues with Edupass. + +# [#171](https://github.com/String-sg/teacher-workspace/issues/171) Create access whitelisting and master app code tables + +## Overview + +Create the access whitelisting table and the master `app_code` table via Atlas migration. + +## Goals + +- Atlas migration creating both tables +- Access whitelisting table: + - Columns: `app_code`, `school_code`, `created_at`, `updated_at` + - Composite unique on (`app_code`, `school_code`) +- Master `app_code` table (name and columns TBD during sprint planning) + +## Open questions for sprint planning + +- Names for both tables +- Columns for the master `app_code` table + +# [#176](https://github.com/String-sg/teacher-workspace/issues/176) Session middleware + +## Overview + +HTTP middleware that wires the session `Store` into the request pipeline: creates sessions on login, validates sessions on every request, and destroys sessions on logout. + +## Goals + +- Session creation on login +- Session validation on incoming requests +- Session destruction on logout + +# Issues Ready to Be Taken Up + +# [#131](https://github.com/String-sg/teacher-workspace/issues/131) Data Loading Foundations + +## Overview + +Build a production-quality proof of the full data loading flow described in [RFC 27 — Frontend Architecture](https://github.com/transformteamsg/design-documents/issues/27) and [RFC 28 — Backend Architecture](https://github.com/transformteamsg/design-documents/issues/28). + +1. **Frontend — Initial load hydration:** Server-provided bootstrap data injected via a JSON script tag (`