Skip to content

Add support to handle Documents - #703

Open
abbra wants to merge 7 commits into
FreeFeed:stablefrom
abbra:documents
Open

abbra wants to merge 7 commits into
FreeFeed:stablefrom
abbra:documents

Conversation

@abbra

@abbra abbra commented Aug 25, 2026

Copy link
Copy Markdown

Implements server side of #702

@abbra

abbra commented Aug 25, 2026

Copy link
Copy Markdown
Author

Demo of how the frontend looks like: https://youtu.be/GS7K76kAdq8

Alexander Bokovoy added 7 commits September 5, 2026 07:32
- Create documents and document_tags tables
- Add per-user unique slug index (scoped by user_id)
- Add visibility column with public/protected/private check constraint

Signed-off-by: Alexander Bokovoy <ab@vda.li>
- Document model with CRUD, tag management, hierarchy, and slug generation
- DbAdapter documents trait with scoped queries (per-user slugs, tags, tree)
- Serializer with visibility, username, and documentsUrl fields

Signed-off-by: Alexander Bokovoy <ab@vda.li>
- Create endpoint: POST /v5/documents
- List endpoint: GET /v5/documents
- Get by ID: GET /v5/documents/:docId
- Update endpoint: PUT /v5/documents/:docId
- Delete endpoint: DELETE /v5/documents/:docId
- Tree endpoint: GET /v5/documents/tree
- Public URL: GET /docs/:slug and /docs/:username/:slug
- All handlers enforce auth and owner-only access
- Visibility checks on public endpoints

Signed-off-by: Alexander Bokovoy <ab@vda.li>
… API v5

- Register documentsTrait in DbAdapter composition
- Export Document model from models.js
- Export DocumentsController from controllers.js
- Register DocumentsRoute in public router
- Add /docs/:username/:slug public middleware
- Bump API_VERSION_ACTUAL to 5

Signed-off-by: Alexander Bokovoy <ab@vda.li>
- Document class definition with all fields and methods
- DbAdapter document query method signatures

Signed-off-by: Alexander Bokovoy <ab@vda.li>
…public URLs

- Test create, read, update, delete with auth enforcement
- Test auto-slug generation, custom slugs, and per-user deduplication
- Test tag association and listing
- Test hierarchy tree structure
- Test public URL access and unpublished document 404s

Signed-off-by: Alexander Bokovoy <ab@vda.li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant