DOS (Document Operation Service) — convention-based, opinionated library for building API-driven serverless services. Inspired by Ruby on Rails.
npm install @kravc/dos-
Define a Document — extend
MemoryDocumentand set a schema (YAML):See
example/documents/Profile/—Profile.ts,Profile.yaml -
Define Operations — use
Create,Read,Update,Delete,Index:See
example/operations/Profile/— full CRUD example -
Compose a Service — pass modules and options:
See
example/index.ts
npm i --save-dev @kravc/http
npx http ./example/index.tsThen open http://localhost:3000 (Swagger UI) or http://localhost:3000/Spec (OpenAPI JSON).
| Concept | Purpose |
|---|---|
| Document | Data model with schema validation, default attributes (id, createdAt, updatedAt), lifecycle hooks |
| Operation | API endpoint: Create, Read, Update, Delete, Index + security, validation, errors |
| Service | Orchestrates operations, generates OpenAPI spec, handles HTTP/serverless requests |
- Example service —
example/— Profile CRUD with JWT/auth, Health endpoint - Tests —
src/**/__tests__/— behavior and API surface for each module:Document/__tests__/MemoryDocument.test.ts— document CRUDOperation/operations/__tests__/*.test.ts— Create, Read, Update, Delete, IndexOperation/security/__tests__/JwtAuthorization.test.ts,LambdaAuthorization.test.ts— authService/__tests__/Service.test.ts— request processing, validation, spec, errors
ISC
Revision: February 11, 2026
By: Alex Kravets (@alexkravets)