Architecture
packages/
core/ # HTTP server, in-memory store, plugin interface, middleware
vercel/ # Vercel API service
github/ # GitHub API service
google/ # Google OAuth 2.0 / OIDC
cli/ # CLI entry point (commander)Core
The core package provides a generic Store with typed Collection<T> instances supporting CRUD, indexing, filtering, and pagination. Each service plugin registers its routes on the shared Hono app and uses the store for state.
Plugin System
Each service (Vercel, GitHub, Google) is a plugin that:
- Defines its entity types and store collections
- Registers HTTP routes on the shared Hono app
- Provides a seed function to populate initial state from config
- Uses shared middleware for auth, error handling, and pagination
Multiple services can run simultaneously on the same port.
In-Memory State
All state is held in memory with no database. This makes the emulator fast, easy to reset, and ideal for CI pipelines. State is populated from the seed config on startup and can be modified via API calls during a test run.
Middleware
The core provides shared middleware:
- Auth: validates Bearer/token authorization headers against configured tokens
- Error handling: consistent error responses matching each service's format
- Pagination: GitHub-style
page/per_pagewithLinkheaders, Vercel-style cursor-based pagination