3 KiB
Go Guess frontend
React and TypeScript recruitment workspace built with Vite.
Commands
npm install
npm run dev
npm run typecheck
npm run lint
npm run format
npm run format:check
npm test
npm run build
Run one test:
npm test -- src/App.test.tsx -t "shows answer inputs"
API integration
Vite proxies /api to http://localhost:8080. Login stores the returned JWT in
sessionStorage; protected requests send it as Authorization: Bearer <token>. API failures are
shown in the UI and are never replaced with demo data.
Supported routes:
POST /api/auth/loginGET|POST /api/jobsGET /api/jobs/:idPATCH /api/jobs/:idfor interview status and durationPOST|DELETE /api/jobs/:id/questions/:questionIdGET /api/jobs/:id/candidatesGET|POST /api/jobs/:id/invitationsGET /api/jobs/:jobId/invitations/:invitationIdfor protected answer reviewGET|POST /api/questions(GETaccepts?search=)PUT /api/questions/:idto update question text, type, options, reference answer, and code snippetPATCH /api/questions/:idto deprecate or restore a questionGET|POST /api/participantsGET /api/participants/:idGET /api/participants/:id/photoGET /api/participants/:id/cvGET /api/interviews/:tokenPOST /api/interviews/:token/acceptPUT /api/interviews/:token/answers/:questionIdPOST /api/interviews/:token/finish
Participant creation uses multipart fields firstName, lastName, birthday, email,
contactInfo, photo, and cv.
Interview workflow
Authenticated interviewers create and edit reusable questions at /questions, configure job
status and duration, attach active library questions, and generate invitations for each eligible
participant from a job detail page. Multiple-choice and radio questions require at least two
explicitly added options.
Detaching a question removes only the job association; questions can be deprecated but not deleted.
Open-answer and code-review questions include an interviewer-only reference answer that is never
rendered in the participant interview. Code-review questions also require a code snippet.
Accepted and completed invitations can be opened from the job to review every participant answer,
possible choice options, reference answers, and code-review context; unanswered questions are
called out explicitly.
Participants open the generated /participant/:invitationId URL without signing in. The opaque
invitation ID authorizes the existing /api/interviews/:token API. Code-review questions are shown
in a pull-request-style code panel with a review comment field. Answers are saved when navigating
between questions and as they change, then Submit completes the interview. The countdown is
derived from the backend acceptedAt timestamp plus the job duration so refreshing cannot reset
it. Questions stay hidden until the participant explicitly accepts the invitation.
Container
Build with docker build -t go-guess-frontend .. The production Nginx server serves the SPA and
proxies /api to the Docker Compose service api:8080.