Time window 24 hours. Suggested effort about 4 hours.
Context
A small creative team wants to find and organise its design assets. Build a backend for asset metadata, search and archiving. This is an original PraxisAI product exercise for the Canva practice path, not an official Canva question, frontend assessment or timed interview simulation. All stages are visible up front.
Stage 1: clarify before building
The team has not decided what should happen when two assets have the same name. Choose either allowing duplicates or rejecting names that match after trimming and case folding. State your choice, its user-facing behavior and one trade-off in README.md before implementation. Tests and the API must agree with that choice. This decision is intentionally open; the contracts below are fixed.
Stage 2: build a working core
POST /assetsaccepts a non-empty name, kind (image,videoordocument) and a list of tags. Return 201 with an opaque ID and the stored metadata.- Trim names and tags. Tags are case-insensitive, stored lowercase, deduplicated and sorted. Reject empty tag values and invalid kinds with 400.
GET /assetssupportsq,kind,tag,limitandoffset. Search is a case-insensitive substring of the name. Filters combine with AND. Tag matching is exact after normalisation, not substring matching.- Return
{items, total, limit, offset}. Sort by normalised name, then ID as a deterministic tie-breaker. Default limit is 20, maximum 100. A limit outside 1..100 or negative/non-integer offset returns 400. Total is before pagination. PATCH /assets/:idchanges the name or tags while preserving fields not sent. Reject attempts to change the ID or kind with 400. Unknown IDs return 404.- Use SQLite and preserve data across a restart. No file upload is required: this exercise manages metadata, not binary files.
Stage 3: adapt the product
The team wants to remove clutter without losing work. Add an archive feature without changing the earlier listing, editing or pagination contracts.
POST /assets/:id/archivesetsarchivedto true; repeating it is a successful no-op.POST /assets/:id/restoresets it to false with the same idempotence.- Both return 200 with the current asset; unknown IDs return 404.
- Listings exclude archived assets by default.
include_archived=trueincludes both archived and active assets; false means active-only. Other values return 400. - Search, kind, tag, ordering, total and pagination operate on the eligible set. Archiving never deletes a record or changes its ID, name, kind or tags.
- Archived records can still be edited by ID. If you reject duplicate names, uniqueness covers both active and archived records, so restore cannot conflict.
Acceptance criteria
- Creating
Launch Deckwith tags["Brand", "brand", "Review"]stores nameLaunch Deckand tags["brand", "review"]. - With
Launch Deck(document),Launch Image(image) andNotes(document), searchinglaunchreturns the first two in that order. Addingkind=imagereturns onlyLaunch Image. Filtering by tagbradoes not matchbrand. - Archiving
Launch Deckleaves onlyLaunch Imagein that search by default; including archived assets returns both. Total and page boundaries reflect the same eligibility rules. Repeating archive/restore never duplicates data. - Renaming an asset changes where it appears in a fresh sorted listing. Its ID, kind and unsent tags are preserved. Invalid updates make no partial changes.
- Your chosen duplicate-name policy is tested for whitespace and case variants.
- Automated tests cover validation, combined filters, stable ordering, pagination, archive/restore, partial updates and restart persistence. Include at least one HTTP round trip and a documented example the reviewer can run.
Constraints and handoff
Use any server language with SQLite. Keep domain logic separate from HTTP and storage, and provide one run command plus one test command in README.md. There is no need for login, collaborative editing, AI APIs or image processing. Optional UI work comes after the tested API. Explain the assumptions, one integration problem you found and how you reviewed the agent's output. The standard PraxisAI project rubric applies.
Deliverables (every project)
- Source code committed in this repository (the grader diffs against the first commit).
README.mdthat replaces the stub, with: how to install, run and test it (copy-pasteable commands); the decisions and trade-offs you made; what you would do next with more time; and a short note on how you used the AI agent (what you delegated, what you checked or rewrote).- Automated tests that run with a single command (
npm test,pytest,go test ./...orcargo test). - No secrets in the repository. Anything configurable reads from environment variables with safe defaults.
Ground rules
- The 24-hour clock is a window, not a workload. Stop at roughly the suggested effort, then write down what you would do next. A small, finished, tested core beats a large unfinished one.
- Use the AI agent as much or as little as you like: every prompt is recorded and the report shows how it was used. You are judged on the result and on whether you understood and verified what the agent produced.
- The work is yours. PraxisAI uses it only to produce your assessment report.