Skip to content

Latest commit

 

History

History
63 lines (42 loc) · 1.15 KB

File metadata and controls

63 lines (42 loc) · 1.15 KB

Speed Task — Tasks & Rewards

This repo is intentionally small. Two tests are failing on purpose.

Quick Start

pnpm install
pnpm test

Optional (run UI + API):

pnpm dev

API: http://localhost:3000 Web: http://localhost:5173

Tasks

1) Fix: validation + status codes

Route: POST /api/users/register

Expected behavior:

  • Missing telegramId -> 400
  • New user -> 201
  • Existing user (same telegramId) -> 200 and same user id

2) Feature: idempotent notes

Route: POST /api/notes

Expected behavior:

  • title required, max 120 -> 400 when invalid
  • externalId required
  • First create -> 201
  • Duplicate externalId -> 200 and same note id
  • Concurrent requests must not create duplicates

3) Frontend

Implement a minimal UI:

  • Form: externalId, title
  • Show list of notes
  • Show error state on failure

Rules

  • Do not refactor unrelated code.
  • Keep changes focused and minimal.
  • Ensure idempotency behavior is covered by tests.

Submission

  • Share the repo link or PR.
  • If something is incomplete, say what and why.

There are TODO markers in the code to guide you.