Files
bookhoard/bruno
john-okeefe 012242dcad test: Update API collection for rating system changes
- Update rating examples to use 1-10 scale
- Document half-star precision in API collections
- Add rating conversion examples for testing
- Update Get Ebook Rating docs with scale explanation
- Update Create/Update Rating with new validation rules
2026-01-26 13:49:25 -05:00
..
2026-01-21 21:17:22 -05:00

Bruno API Tests for Bookmann

This directory contains Bruno collection for testing the Bookmann API with comprehensive REST documentation.

Setup

  1. Install Bruno: https://www.usebruno.com/
  2. Open Bruno and import this collection folder
  3. Select the "localhost" environment
  4. Start the application with docker-compose up --build
  5. Register/Login first, then use Bearer token for protected endpoints

Available Tests

Auth (Public Endpoints)

  • Register User: POST /api/auth/register - Create new account
  • Login User: POST /api/auth/login - Authenticate (email or username)
  • Get Profile: GET /api/auth/profile - Get user info (requires token)

Ebooks (Protected - JWT Required)

  • List Ebooks: GET /api/ebooks - Paginated ebook list
  • Get Ebook: GET /api/ebooks/:id - Single ebook details
  • Create Ebook: POST /api/ebooks - Add new ebook
  • Update Ebook: PUT /api/ebooks/:id - Modify ebook metadata
  • Delete Ebook: DELETE /api/ebooks/:id - Remove ebook

Reading Progress (Protected - JWT Required)

  • Get Reading Progress: GET /api/ebooks/:id/progress - User's progress
  • Update Reading Progress: PUT /api/ebooks/:id/progress - Update progress

Ratings (Protected - JWT Required)

  • Get Ebook Rating: GET /api/ebooks/:id/rating - User's rating for ebook (returns 0 if unrated)
  • Create/Update Rating: POST /api/ebooks/:id/rating - Rate ebook (1-5 stars)
  • Delete Rating: DELETE /api/ebooks/:id/rating - Remove user's rating
  • Get All Ratings: GET /api/ebooks/:id/ratings - All ratings for ebook

Documentation Features

Each request includes:

  • Detailed descriptions of functionality
  • Parameter specifications (required/optional, types)
  • Request/Response examples
  • Error response codes and meanings
  • Authentication requirements

Notes

  • Authentication Flow: Register → Login → Use Bearer token for all other requests
  • JWT Tokens: Valid for 24 hours, include in Authorization: Bearer <token> header
  • User Isolation: Progress, ratings, and data are user-specific
  • Rating Behavior: Get rating returns 0 when no rating exists (instead of 404)
  • Variables: Update ebook_id for testing specific ebooks
  • Security: Passwords hashed with bcrypt, unique email/username constraints
  • JSON: All requests/responses use JSON format