Add OpenAPI foundation and health API #40

Merged
erik merged 2 commits from feat/task-c272cbda-openapi-health into main 2026-05-19 22:23:21 -05:00
Owner

Summary

  • Add /api/v1 routing to the template site.
  • Add /api/v1/health and /api/v1/openapi.json.
  • Add OpenAPI 3.1 source document with shared schemas and bearer auth scheme.
  • Add shared API success/error helpers, standardized not-implemented response, and bearer auth middleware scaffold.
  • Add tests for API routes, OpenAPI availability, response helpers, and bearer auth rejection/acceptance.

Testing

  • make check
  • ./scripts/pre-pr.sh
  • Manual smoke: APP_HOST=127.0.0.1 APP_PORT=3100 npm run dev --workspace @slugkit/template-site, then curl /api/v1/health and parse /api/v1/openapi.json

Task: #task-c272cbda

## Summary - Add `/api/v1` routing to the template site. - Add `/api/v1/health` and `/api/v1/openapi.json`. - Add OpenAPI 3.1 source document with shared schemas and bearer auth scheme. - Add shared API success/error helpers, standardized not-implemented response, and bearer auth middleware scaffold. - Add tests for API routes, OpenAPI availability, response helpers, and bearer auth rejection/acceptance. ## Testing - `make check` - `./scripts/pre-pr.sh` - Manual smoke: `APP_HOST=127.0.0.1 APP_PORT=3100 npm run dev --workspace @slugkit/template-site`, then curl `/api/v1/health` and parse `/api/v1/openapi.json` Task: #task-c272cbda
feat: add OpenAPI health API foundation
All checks were successful
CI / build-lint-test (pull_request) Successful in 25s
2d16c06f1b
Task: #task-c272cbda
Author
Owner

PR Review: Approved

Summary

The PR adds the Slugkit API v1 foundation under /api/v1, exposes the OpenAPI 3.1 document, implements the API health route, adds shared API response helpers, adds a bearer-auth middleware scaffold, and covers the new behavior with tests.

Acceptance Criteria

  • /api/v1/health returns the documented success JSON.
  • The OpenAPI document is exposed at the documented URL and is valid JSON.
  • Shared API success and error response shapes are implemented.
  • Standardized 501 Not Implemented response shape is available for unsupported routes/features.
  • Protected route middleware rejects missing/invalid bearer credentials once auth is wired.
  • Tests cover API health, OpenAPI document availability, and shared error shape helpers.
  • Relevant lint/test checks pass: ./scripts/pre-pr.sh and Forgejo CI succeeded.

Blocking Issues

None.

Warnings

None.

Verdict

Approved for merge.

## PR Review: Approved ### Summary The PR adds the Slugkit API v1 foundation under `/api/v1`, exposes the OpenAPI 3.1 document, implements the API health route, adds shared API response helpers, adds a bearer-auth middleware scaffold, and covers the new behavior with tests. ### Acceptance Criteria - [x] `/api/v1/health` returns the documented success JSON. - [x] The OpenAPI document is exposed at the documented URL and is valid JSON. - [x] Shared API success and error response shapes are implemented. - [x] Standardized `501 Not Implemented` response shape is available for unsupported routes/features. - [x] Protected route middleware rejects missing/invalid bearer credentials once auth is wired. - [x] Tests cover API health, OpenAPI document availability, and shared error shape helpers. - [x] Relevant lint/test checks pass: `./scripts/pre-pr.sh` and Forgejo CI succeeded. ### Blocking Issues None. ### Warnings None. ### Verdict Approved for merge.
fix: watch template dev server
All checks were successful
CI / build-lint-test (pull_request) Successful in 22s
33d167766c
Task: #task-c272cbda
Author
Owner

PR Review: Approved

Summary

Reviewed latest PR state at commit 33d1677. The PR adds the Slugkit API v1 foundation under /api/v1, exposes /api/v1/openapi.json, implements /api/v1/health, adds shared response/error helpers, adds bearer-auth middleware scaffolding, keeps public website routes separate, and switches the dev server to tsx watch so code changes reload automatically.

Acceptance Criteria

  • /api/v1/health returns the documented success JSON.
  • The OpenAPI document is exposed at the documented URL and is valid JSON.
  • Shared API success and error response shapes are implemented.
  • Standardized 501 Not Implemented response shape is available for unsupported routes/features.
  • Protected route middleware rejects missing/invalid bearer credentials once auth is wired.
  • Tests cover API health, OpenAPI document availability, shared error shape helpers, and bearer-auth middleware behavior.
  • Relevant lint/test checks pass: Forgejo CI succeeded on the latest commit; local make check passed after the dev-watch change.

Blocking Issues

None.

Warnings

None.

Verdict

Approved for merge.

## PR Review: Approved ### Summary Reviewed latest PR state at commit `33d1677`. The PR adds the Slugkit API v1 foundation under `/api/v1`, exposes `/api/v1/openapi.json`, implements `/api/v1/health`, adds shared response/error helpers, adds bearer-auth middleware scaffolding, keeps public website routes separate, and switches the dev server to `tsx watch` so code changes reload automatically. ### Acceptance Criteria - [x] `/api/v1/health` returns the documented success JSON. - [x] The OpenAPI document is exposed at the documented URL and is valid JSON. - [x] Shared API success and error response shapes are implemented. - [x] Standardized `501 Not Implemented` response shape is available for unsupported routes/features. - [x] Protected route middleware rejects missing/invalid bearer credentials once auth is wired. - [x] Tests cover API health, OpenAPI document availability, shared error shape helpers, and bearer-auth middleware behavior. - [x] Relevant lint/test checks pass: Forgejo CI succeeded on the latest commit; local `make check` passed after the dev-watch change. ### Blocking Issues None. ### Warnings None. ### Verdict Approved for merge.
erik merged commit 95a0a7abcc into main 2026-05-19 22:23:21 -05:00
Sign in to join this conversation.
No description provided.