How psrockstar098/yatta.js works
Yatta is a Bun backend framework with two documented layers: application engines wired into HTTP services, and an independently usable worker runtime. The principal request path enters the server, reaches protocol or realtime handling, then dispatches file-based routes; routes can use the configured engines and persistent stores. The graph also preserves the documented deployment CLI and major feature-engine families. Several engine implementations and runtime files were not excerpted, so their internal links are omitted unless documented or visible in the source index.
Main entry points: main.ts Bun server · routerHelper.ts Request dispatcher · runtime.ts Runtime lifecycle · auth.ts Auth wiring
Components 28
Application runtime
- Bun server
src/main.ts - Environment config
src/func/env.ts - Peer tracking
src/func/peer.ts
HTTP and protocols
- Request dispatcher
src/func/routerHelper.ts - File routes
src/func/standalone_routes.ts - Protocol handlers
src/func/grpcweb.ts - OAuth and OIDC
src/func/oauth.ts - WebDAV handler
src/func/webdav.ts
Framework engines
- Typed API engine
src/types/api.ts - Realtime engine
src/types/realtime.ts - Database wiring
src/func/db.ts - SQLite ORM
src/types/db.ts - Auth wiring
src/func/auth.ts - Auth engine
src/types/auth.ts - Jobs and cron
src/types/job.ts - Cache engine
src/types/cache_queue.ts - Storage wiring
src/func/storage.ts - Object storage
src/types/storage.ts - Mail engine
src/types/mail.ts - Observability
src/types/observe.ts
Worker runtime
- Runtime lifecycle
core_runtime/runtime.ts - Task scheduler
core_runtime/scheduler.ts - Worker execution
core_runtime/worker.ts - Module isolation
core_runtime/moduleGraph.ts - Cluster support
core_runtime/cluster.ts
CLI and deployment
- Framework CLI
src/cli.ts - Deployment CLI
src/deploy/cli.ts
Other components
- HTTP client
Connections 25
- HTTP client → Bun server: sends requests
README.md - Bun server → Environment config: loads config
src/main.ts - Bun server → Peer tracking: records peer
src/main.ts - Bun server → Request dispatcher: dispatches requests
src/main.ts - Request dispatcher → File routes: loads route modules
src/func/routerHelper.ts - Request dispatcher → Typed API engine: calls handlers
src/func/routerHelper.ts - Request dispatcher → Realtime engine: handles realtime
src/func/routerHelper.ts - Request dispatcher → Storage wiring: serves storage
src/func/routerHelper.ts - Request dispatcher → Protocol handlers: dispatches protocols
src/func/routerHelper.ts - Request dispatcher → OAuth and OIDC: dispatches auth
src/func/routerHelper.ts - Request dispatcher → WebDAV handler: dispatches WebDAV
src/func/routerHelper.ts - Database wiring → SQLite ORM: configures
src/func/db.ts - Auth wiring → Auth engine: creates engine
src/func/auth.ts - Auth wiring → Database wiring: uses database
src/func/auth.ts - Storage wiring → Object storage: creates engine
src/func/storage.ts - Bun server → Runtime lifecycle: starts and drains
src/main.ts - Runtime lifecycle → Task scheduler: schedules tasks
- Task scheduler → Worker execution: dispatches tasks
core_runtime/scheduler.ts - Worker execution → Module isolation: loads isolated modules
core_runtime/worker.ts - Runtime lifecycle → Cluster support: coordinates workers
- Bun server → Jobs and cron: attaches subsystem
- Bun server → Cache engine: attaches subsystem
- Bun server → Mail engine: attaches subsystem
- Bun server → Observability: starts observer
src/main.ts - Framework CLI → Deployment CLI: invokes deployment
src/cli.ts