This repo is intentionally small. Two tests are failing on purpose.
pnpm install
pnpm testOptional (run UI + API):
pnpm devAPI: http://localhost:3000
Web: http://localhost:5173
Route: POST /api/users/register
Expected behavior:
- Missing
telegramId-> 400 - New user -> 201
- Existing user (same telegramId) -> 200 and same user id
Route: POST /api/notes
Expected behavior:
titlerequired, max 120 -> 400 when invalidexternalIdrequired- First create -> 201
- Duplicate
externalId-> 200 and same note id - Concurrent requests must not create duplicates
Implement a minimal UI:
- Form:
externalId,title - Show list of notes
- Show error state on failure
- Do not refactor unrelated code.
- Keep changes focused and minimal.
- Ensure idempotency behavior is covered by tests.
- Share the repo link or PR.
- If something is incomplete, say what and why.
There are TODO markers in the code to guide you.