How spaghiajoeojo/express-beans works
ExpressBeans is a TypeScript IoC framework for organizing and running Express applications. The principal workflow is to register bean and router classes, inject bean instances, map route handlers onto Express routers, and execute application lifecycle phases so initialized routes can serve requests. Hooks, ordered tasks, method/route caching, and logging are additional capabilities. The graph includes the major documented features; links involving unsampled implementation are omitted or marked unverified rather than inferred from module names.
Main entry points: main.ts Public API · Executor.ts Phase executor · Route.ts Route mapping · index.ts Bean registry
Components 20
Public API
- Public API
src/main.ts
Beans and Routing
- Application
src/core/ExpressBeans.ts - Bean registration
src/core/decorators/Bean.ts - Bean injection
src/core/decorators/InjectBean.ts - Router bean
src/core/decorators/RouterBean.ts - Route mapping
src/core/decorators/Route.ts - HTTP methods
src/core/RouterMethods.ts - Framework types
src/ExpressBeansTypes.ts
Lifecycle
- Phase executor
src/core/executor/Executor.ts - Lifecycle task
src/core/executor/Task.ts - Lifecycle hooks
src/hooks/decorators/Hook.ts - Hook ordering
src/core/decorators/Order.ts
Runtime Support
- Method cache
src/cache/decorators/Cached.ts - Logger
src/logging/Logger.ts - Logger injection
src/logging/decorators/InjectLogger.ts - Bean registry
src/core/index.ts - Error handling
src/core/errors.ts - Object utilities
src/utils/Objects.ts
Other components
- Application developer
- HTTP client
Connections 27
- Application developer → Public API: uses
README.md - Public API → Application: exports
src/main.ts - Public API → Bean registration: exports
src/main.ts - Public API → Bean injection: exports
src/main.ts - Public API → Route mapping: exports
src/main.ts - Public API → Router bean: exports
src/main.ts - Public API → Method cache: exports
src/main.ts - Public API → Lifecycle hooks: exports
src/main.ts - Public API → Hook ordering: exports
src/main.ts - Public API → Logger injection: exports
src/main.ts - Public API → Logger: exports
src/main.ts - Application → Phase executor: runs phases
src/core/ExpressBeans.ts - Application → Object utilities: uses
src/core/ExpressBeans.ts - Bean registration → Bean registry: registers instance
src/core/decorators/Bean.ts - Router bean → Bean registration: registers as
src/core/decorators/RouterBean.ts - Route mapping → Phase executor: registers routing task
src/core/decorators/Route.ts - Route mapping → HTTP methods: selects method
src/core/decorators/Route.ts - Route mapping → HTTP client: serves requests
README.md - Bean injection → Bean registry: resolves beans
src/core/decorators/InjectBean.ts - Lifecycle hooks → Phase executor: registers phase task
src/hooks/decorators/Hook.ts - Hook ordering → Phase executor: orders hooks
- Method cache → Phase executor: registers init task
src/cache/decorators/Cached.ts - Phase executor → Lifecycle task: creates tasks
src/core/executor/Executor.ts - Phase executor → Error handling: wraps failures
src/core/executor/Executor.ts - Logger injection → Logger: injects logger
src/logging/decorators/InjectLogger.ts - Bean registry → Logger: creates logger
src/core/index.ts - Method cache → Bean registry: reads registered methods
src/cache/decorators/Cached.ts