Upload the manual. Practice with source-grounded tools. Pass the exam.
Unfold is a source-grounded exam coach for Alberta Basic Security Training students. It uploads the course manual to S3, recognizes the official demo PDF by SHA-256, then opens a curated exam practice path with 3D correction scenes, voice practice, discussion, movie generation, and progress tracking.
- Open the app. Upload the Alberta Basic Security Training PDF.
- Watch the upload flow: S3 upload, source verification, workspace loading, ready.
- Read tab opens. Module Five is fully rendered with callouts and sample reports.
- Toggle "Original PDF" to view the underlying manual pages 107–129.
- Start a focused exam. Pick 3 or 5 questions. The scene-trigger question is always included.
- Answer the kooky-victim question incorrectly, submit, click View 3D Correction.
- The 3D scene shows two side-by-side dioramas with the officer and citizen GLB models.
- Press Play to hear narration and watch subtle motion.
- Click Practice It. Speak your incident-report sentence into the mic.
- The first attempt always returns "Try again: Reports cannot include guesses." The second is correct.
- Complete practice — Progress shows Objective report writing as improved.
- Discussion and Movie tabs round out the surfaces.
npm install
npm run devOpen http://localhost:3000.
npm run lint
npm run typecheck
npm run buildTo bypass the upload screen for development, set NEXT_PUBLIC_SKIP_UPLOAD=true.
node scripts/extract-module-five.mjsRe-runs PDF extraction over public/manual/abst-manual.pdf and rewrites lib/data/moduleFiveContent.ts. The shipped file is hand-cleaned for demo readability.
Copy .env.example to .env.local. Fill in:
NEXT_PUBLIC_DEMO_MODE=true
NEXT_PUBLIC_DEMO_VIDEO_PATH=/videos/demo-report-writing.mp4
NEXT_PUBLIC_AWS_REGION=us-west-2
NEXT_PUBLIC_SKIP_UPLOAD=false
AWS_REGION=us-west-2
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
S3_BUCKET_NAME=
DETERMINISTIC_DOCUMENT_HASH=3cc730708278558b93aa77ad0a161a66ef280ea44ea15cd2db7e199e23e9c12b
DETERMINISTIC_DOCUMENT_ID=alberta-basic-security-training
ELEVENLABS_API_KEY=
ELEVENLABS_VOICE_ID=
ELEVENLABS_MODEL_ID=eleven_multilingual_v2- S3 bucket for uploaded PDFs
- IAM user with
s3:PutObject,s3:GetObject, ands3:ListBucket - The broader AWS setup guide is kept in
docs/AWS_SETUP.md, but the current runtime implementation only requires S3.
Recommended host: AWS Amplify Hosting.
- Push to GitHub.
- Connect the repo in Amplify Hosting.
- Use
amplify.ymlfor the build. - Add the variables from
.env.aws.example. - Deploy.
app/api/process-document/— PDF upload to S3 and SHA-256 recognition for the deterministic manualcomponents/layout/— upload screen, top bar, tabs, app shellcomponents/read/— Module Five reader and original PDF viewercomponents/exam/— focused/open-book exam, 3 or 5 questions, scene-trigger always includedcomponents/corrections/— animated 3D dioramas with GLB models, voice practicecomponents/discussion/— Lawrence's class-discussion surfacecomponents/movie/— prompt + style + storyboard fallbackcomponents/progress/— readiness, weak areas, recommendationslib/aws/— AWS service boundaries; S3 is the only live runtime dependency for the demolib/data/moduleFiveContent.ts— curated Module Five source contentlib/store.ts— global state and exam shufflepublic/models/—officer.glb,citizen.glbpublic/manual/abst-manual.pdf— original manualscripts/extract-module-five.mjs— PDF extraction utility
- Module Five is the curated learning path. Other modules show recognized activities/concepts only.
- The official manual is recognized by SHA-256 and mapped to curated content after S3 upload.
- The Movie tab uses the local video at
public/videos/demo-report-writing.mp4if present, otherwise storyboard cards. - Voice practice is deterministic: first attempt → "Try again", second attempt → pass. ElevenLabs narrates scene playback when configured; browser speech synthesis remains the fallback.
- Next.js 14 retained per project spec.