feat: add diagnostic web app shell

This commit is contained in:
user
2026-04-26 18:39:09 +09:00
parent 3493f8b5a5
commit ce38189f33
15 changed files with 763 additions and 9 deletions

View File

@@ -0,0 +1,38 @@
# Phase 7 Context: Web App Shell and Diagnostic Start
**Status:** Ready for execution
**Started:** 2026-04-26
## Goal
Serve the first browser UI from the Go backend and let a job seeker start
diagnostic practice without API tooling.
## Requirements
- WEB-01: User can open a web app served by the Go service.
- WEB-02: User can create a diagnostic interview session from the web app.
- WEB-03: User can answer a diagnostic question and see rubric feedback.
## UX Direction
Visual thesis: quiet interview coaching workspace, dense but readable, with one
clear green accent for action and readiness.
Content plan:
- left rail: learner setup
- main workspace: active diagnostic questions and answer input
- right context: grading feedback and evidence
Interaction thesis:
- loading states on API actions
- inline error region
- selected question state and answer result refresh
## Out of Scope
- Full progress view.
- Material/ontology workspace.
- Authentication.

View File

@@ -0,0 +1,36 @@
# Phase 7 Plan: Web App Shell and Diagnostic Start
**Status:** Ready for execution
**Phase Goal:** Create a working diagnostic web app shell.
## Tasks
### 1. Serve embedded web app
- Add `internal/webapp`.
- Embed static app assets.
- Register root and asset routes through the existing Go server.
### 2. Build diagnostic UI
- Add setup form for user id, target role, stack, and interview timeline.
- Create diagnostic session through the real API.
- Show returned questions.
### 3. Build answer and grading UI
- Let user select a question.
- Submit answer through the real API.
- Show overall grade, scores, follow-up, and evidence.
### 4. Verify
- Add HTTP tests for root web app and asset serving.
- Run Go tests, OpenSpec validation, line-count check.
- Smoke the rendered app endpoint and diagnostic API flow.
## Out of Scope
- Frontend build tooling.
- Authentication.
- Phase 8 progress panels.

View File

@@ -0,0 +1,27 @@
# Phase 7 Research: Web App Shell and Diagnostic Start
## Findings
The existing Go backend can serve static assets without adding frontend build
tooling. For the first MVP UI, plain HTML/CSS/JavaScript is enough and keeps
the repo dependency-light.
The diagnostic APIs already provide all Phase 7 data:
- `POST /api/v1/diagnostic-sessions`
- `POST /api/v1/diagnostic-sessions/{id}/answers`
- `GET /api/v1/diagnostic-sessions/{id}`
## Recommended Shape
- Add `internal/webapp` with embedded static assets.
- Register web app routes from `httpapi.Handler`.
- Keep frontend files small and focused.
- Use fetch calls directly against existing API routes.
## Risks
- A mock UI would not prove the backend loop. The UI must call real APIs.
- A marketing-style landing page would distract from the core product surface.
- Overbuilding a frontend stack before interaction validation would violate
YAGNI.

View File

@@ -0,0 +1,37 @@
# Phase 7 Summary
**Status:** Complete
**Completed:** 2026-04-26
## Delivered
- Added embedded web app serving from the Go backend.
- Added `GET /` app shell and `/assets/*` static asset handling.
- Built dependency-light HTML/CSS/JavaScript UI for diagnostic practice.
- Added setup form for user id, target role, stack, and timeline.
- Added real API-backed diagnostic session creation.
- Added question selection, answer submission, and rubric feedback rendering.
- Added loading, error, empty, and selected-question states.
- Added web app route and asset tests.
## Verification
```powershell
gofmt -w cmd internal
go test ./...
openspec validate frontend-mvp --strict
openspec validate bootstrap-job-tutor-platform --strict
```
Additional smoke check:
- `GET /` returned the app shell.
- `GET /assets/app.js` returned the browser script.
- Diagnostic session creation and answer grading succeeded through the same
server used by the app.
## Deferred
- Progress panels for memory/readiness/next challenge.
- Material and asset workspace.
- Browser screenshot audit.

View File

@@ -0,0 +1,27 @@
# Phase 7 Verification
## Verdict
PASS
## Requirement Coverage
- WEB-01: PASS. The Go service serves the web app at `/`.
- WEB-02: PASS. The browser app can create diagnostic sessions through the real
backend API.
- WEB-03: PASS. The browser app can submit answers and render typed rubric
feedback, scores, follow-up, and evidence.
## Evidence
- `go test ./...` passed.
- `openspec validate frontend-mvp --strict` passed.
- `openspec validate bootstrap-job-tutor-platform --strict` passed.
- Live root/asset HTTP smoke passed.
- Live diagnostic create/answer smoke passed through the same server.
## Residual Risk
The UI was verified with HTTP/API smoke but not yet with a browser screenshot
audit. Phase 8 should add browser-backed checks once the progress view is
included.