tsoa
This commit is contained in:
15
README.md
15
README.md
@@ -10,7 +10,7 @@ This folder contains a standalone mock API for a multi-organization task manager
|
||||
- task, project, user, and org summary endpoints
|
||||
- write endpoints for creating tasks and updating task state
|
||||
- a small test suite covering seeded reads and task mutations
|
||||
- OpenAPI 3.0.3 document endpoints generated from the route registry
|
||||
- OpenAPI 3.0.0 document generated by tsoa controllers
|
||||
- standalone Docker and Compose files for running the mock API by itself
|
||||
|
||||
## Domain Model
|
||||
@@ -132,6 +132,12 @@ Run tests:
|
||||
bun test
|
||||
```
|
||||
|
||||
Regenerate tsoa routes and OpenAPI spec:
|
||||
|
||||
```bash
|
||||
bun run generate:api
|
||||
```
|
||||
|
||||
Run with Docker Compose from this folder:
|
||||
|
||||
```bash
|
||||
@@ -141,13 +147,16 @@ docker compose up --build
|
||||
## Files That Matter
|
||||
|
||||
- `src/index.ts`: server startup and route dispatch
|
||||
- `src/routes.ts`: shared route registry, handlers, and request contracts
|
||||
- `src/openapi.ts`: OpenAPI document generated from the route registry
|
||||
- `src/controllers/*Controller.ts`: all business endpoint contracts and handlers (tsoa decorators)
|
||||
- `src/generated/routes.ts`: tsoa-generated Express route registration
|
||||
- `src/generated/swagger.json`: tsoa-generated OpenAPI document
|
||||
- `src/openapi.ts`: OpenAPI export used by the `/openapi.json` and `/swagger.json` endpoints
|
||||
- `src/database.ts`: schema creation and seed data
|
||||
- `src/repository.ts`: query and mutation helpers
|
||||
- `scripts/seed.ts`: resets and reseeds the SQLite file
|
||||
- `tests/repository.test.ts`: repository-level smoke coverage
|
||||
- `tests/api.test.ts`: HTTP contract and OpenAPI coverage
|
||||
- `tests/routes.test.ts`: verifies runtime business routes match the generated OpenAPI operations
|
||||
|
||||
## What This Mock API Needs To Be Useful
|
||||
|
||||
|
||||
Reference in New Issue
Block a user