Doklo

leaf-web

Dok Hub

IA9Roles4Lexicon0Code mapping

Doks

Doks 7·Domains 7

All 7Needs review 2Active 5Stale 3
7 Doks shown

Admin

ADMIN-MODERATIONAdmin review moderation

Sign in

AUTH-SIGNINEmail and password sign-in

Sign up

AUTH-SIGNUPNew account registrationdrift

Reading circles

CIRCLESReading circle membership managementdrift

Reading journal

JOURNALBook reflection journal

Bookshelf

LIBRARYPersonal reading shelf tracker

Notifications

NOTICESClub update notificationsdrift
Read-only demo

Product preview

Dok Hub

You’re browsing a read-only sample workspace — a fictional reading-circle app, read by Doklo and reviewed by a person. Nothing here can be changed. Free to start: 40 credits on your first GitHub connection, and every repository’s first generation free (up to 30 Doks). Get started free · Back to doklo.io

LIBRARYactivecritical

Personal reading shelf tracker

The Bookshelf screen (route /library) lists every book in the catalog with title, author, page count, and cover art, and lets a signed-in reader record a reading status (WANT, READING, FINISHED) and current page for each book, showing a progress bar once tracked. Saving goes through a server action that validates the status/page combination and persists the shelf entry for that user and book.

Document details · v1
4 steps · 4 rules · 6 criteriaweb · api#library #reading-progress #bookshelf #shelf-status
approved 2026-10-19
User flow 3Business rules 4Acceptance criteria 6

User flow

3
  1. 01

    user

    Browse the list of available books

    Result

    The grid shows every book's cover, title, author, and page count, plus the reader's own progress bar for books already tracked.

    Interaction details
    • all · auto
  2. 02

    user

    Mark a book as wanted, currently being read, or finished, and set the current page

    Result

    The chosen status and page are saved for that book and the card now shows an updated progress bar and percentage.

    Starts when · Reader is signed in

    Interaction details
    • desktop · submit
    • mobile · submit
  3. 03

    user

    View the library without being signed in

    Result

    The reader sees the book list and a sign-in prompt instead of the status/page form, and cannot record progress until signed in.

    Interaction details
    • all · auto

Business rules

4

Policies and constraints the product must keep.

  • 01ValidationBR-LIBRARY-01

    A shelf status must be one of WANT, READING, or FINISHED; any other value is rejected.

    Linked criteria 2Criterion 02Criterion 03
    Read linked criteria here
    • AC-LIBRARY-02A signed-in reader who submits a valid status (WANT, READING, or FINISHED) with a matching page value receives a success result and the book card shows the updated progress.
    • AC-LIBRARY-03Submitting a status/page combination that violates the page rules (e.g. WANT with a non-zero page, FINISHED with a page not equal to the book's length, or READING with the page equal to the book's length) is rejected with a validation error and status code 400, and no shelf entry is changed.
  • 02ValidationBR-LIBRARY-02

    The page value must be a non-negative integer not exceeding the book's page count; WANT requires page 0, FINISHED requires page equal to the book's total pages, and READING requires a page strictly less than the total pages.

    Linked criteria 2Criterion 02Criterion 03
    Read linked criteria here
    • AC-LIBRARY-02A signed-in reader who submits a valid status (WANT, READING, or FINISHED) with a matching page value receives a success result and the book card shows the updated progress.
    • AC-LIBRARY-03Submitting a status/page combination that violates the page rules (e.g. WANT with a non-zero page, FINISHED with a page not equal to the book's length, or READING with the page equal to the book's length) is rejected with a validation error and status code 400, and no shelf entry is changed.
  • 03PermissionBR-LIBRARY-03

    Only a reader with a currently valid, non-expired session can save or update a shelf entry; an anonymous or expired-session request is rejected.

    Linked criteria 2Criterion 04Criterion 06
    Read linked criteria here
    • AC-LIBRARY-04A shelf-update request made without a valid signed-in session is rejected with status code 401 and no entry is saved.
    • AC-LIBRARY-06An unauthenticated visitor sees a sign-in prompt in place of the status/page form and cannot submit shelf updates from the page.
  • 04ValidationBR-LIBRARY-04

    A shelf update must reference an existing book; updates for an unknown book identifier are rejected.

    Linked criteria 1Criterion 05
    Read linked criteria here
    • AC-LIBRARY-05A shelf-update request referencing a book identifier that does not exist is rejected with status code 404.

Acceptance criteria

6

Expected outcomes. These entries do not claim a test was run or passed.

  1. 01CriterionAC-LIBRARY-01

    Visiting the library shows every book in the catalog with its title, author, and page count, regardless of whether the visitor is signed in.

    Linked rules 0
  2. 02CriterionAC-LIBRARY-02

    A signed-in reader who submits a valid status (WANT, READING, or FINISHED) with a matching page value receives a success result and the book card shows the updated progress.

    Linked rules 2Rule 01Rule 02
  3. 03CriterionAC-LIBRARY-03

    Submitting a status/page combination that violates the page rules (e.g. WANT with a non-zero page, FINISHED with a page not equal to the book's length, or READING with the page equal to the book's length) is rejected with a validation error and status code 400, and no shelf entry is changed.

    Linked rules 2Rule 01Rule 02
  4. 04CriterionAC-LIBRARY-04

    A shelf-update request made without a valid signed-in session is rejected with status code 401 and no entry is saved.

    Linked rules 1Rule 03
  5. 05CriterionAC-LIBRARY-05

    A shelf-update request referencing a book identifier that does not exist is rejected with status code 404.

    Linked rules 1Rule 04
  6. 06CriterionAC-LIBRARY-06

    An unauthenticated visitor sees a sign-in prompt in place of the status/page form and cannot submit shelf updates from the page.

    Linked rules 1Rule 03
Source files 21
  • page.tsx
  • LeafProvider.tsx
  • useLeafState.ts
  • useLeafLocale.ts
  • locale.ts
  • layout.tsx
  • headings.tsx
  • store.mjs
  • initial-state.mjs
  • password.mjs
  • action-support.ts
  • domain-error.mjs
  • session.mjs
  • validation.mjs
  • types.ts
  • FeatureFrame.tsx
  • library.tsx
  • BookCard.tsx
  • actions.ts
  • shelf.mjs
  • actionView.ts

Source anchors are injected deterministically. No GitHub repository is connected. File links are unavailable.

Hub context & agents

Hub trust

Doks
7
Source anchors
133
Model-generated anchors
0
Average confidence
—

Source anchors are injected deterministically. This is not a check of every statement in a Dok.

Agents query this hub

doklo.get_dok("LIBRARY")

Personal reading shelf tracker
4 steps · 4 rules · 6 criteria
is_stale: false
anchors: 21 files

search_doks · get_dok · list_doks

Cursor and Claude Code can use Doklo’s MCP tools to read Doks and their code references.

Storage

Your Hub lives in Doklo Cloud, reviewed here and used by agents and published docs. Sync back to your own git is on the roadmap.

On this Dok

User flowBusiness rulesAcceptance criteria

Evidence

21 source files recorded for this Dok.

View source files →

Document

Version 1

web · api · critical

About this status

Approved 2026-10-19. Approval and source freshness are separate facts.

Tracked source files match the recorded baseline.

Hub context & agents →