resources.do
REST APIs That Scale Automatically
Type-safe resource management with automatic CRUD, validation, and intelligent caching. Build production-ready REST APIs in minutes with full OpenAPI specs, semantic search, and query optimization across 300+ edge locations.
import { Resources } from 'resources.do' // Auto-generate REST API with validationconst api = Resources({ users: { schema: { id: 'uuid', email: 'email', name: 'string' } }, posts: { schema: { id: 'uuid', title: 'string', content: 'text' } }}) on.User.created($ => { $.Email.send.Welcome({ to: $.User.email }) $.Analytics.track.Signup({ user: $.User })}) api.every.deploy($ => $.generate.OpenAPI({ version: '3.1' }))
One of 48 primitives
resources.do sits in Data: records, vocabulary and search. Every .do shares one grammar, Business-as-Code, and one SDK.
Data
Records, vocabulary and search
Insight
Measure, test and trace
Frequently asked questions
Resources.do generates production-ready REST APIs from type definitions—no boilerplate code. Get automatic CRUD endpoints, validation, pagination, filtering, sorting, relations, caching, and OpenAPI specs instantly. Traditional frameworks require hundreds of lines of code per resource. We handle authentication, rate limiting, error handling, and performance optimization automatically. Ship APIs 10x faster with zero maintenance overhead.
Schema-based validation ensures data integrity at every layer. Type coercion, format validation (email, URL, UUID), range checks, and custom validators. Automatic SQL injection prevention, XSS protection, and CSRF tokens. Rate limiting per endpoint and API key. Role-based access control (RBAC) with fine-grained permissions. All inputs sanitized, outputs escaped. Compliance with OWASP API Security Top 10.
Yes. Override any CRUD operation with custom logic while keeping automatic behavior for others. Add hooks before/after create, update, delete operations. Extend resources with custom endpoints and methods. Full access to request context, authentication state, and database transactions. Business logic expressed as semantic event handlers (on.User.created) that AI agents understand and can modify.
Automatic relation handling: one-to-one, one-to-many, many-to-many. Eager loading with include parameter prevents N+1 queries. Cascade deletes, referential integrity, and orphan prevention. Nested creates (create user with posts in single request). Relation filtering (find users with posts published after 2024). GraphQL-style field selection to fetch only needed data. Optimized JOINs at database level.
API versioning via URL path (/v1/users, /v2/users) or headers. Automatic request/response transformation between versions. Deprecation warnings with sunset dates. Schema evolution with backward-compatible changes. Field aliasing maintains old field names while using new schema. Version-specific documentation and testing. Zero-downtime deployments with gradual rollout. Rollback support for breaking changes.