eridu-tech — the backend infrastructure behind your SvelteKit app
#16650
yousif-khalil-abdulkarim
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
eridu-techis a collection of 17 composable backend infrastructure components for TypeScript — caching, locking, event buses, rate limiting, circuit breaking, file storage, and more — built around one idea:It's not a replacement for SvelteKit — keep using its server endpoints, form actions, and loaders.
eridu-techprovides the backend infrastructure behind them: caches, locks, rate limiters, event buses, typed config, and resilience primitives. While SvelteKit's HTTP endpoints don't ship built-in request/response validation, you can optionally useeridu-tech's HttpRouter instead — typed endpoints, schema validation, and a ready-made middleware chain, all framework-agnostic. Keep SvelteKit for the app layer; adderidu-techwhen the backend behind those endpoints grows complex.Links: GitHub · Docs · API reference · NPM
What problem does it solve?
SvelteKit is great at routing, rendering, and deployment — but as the backend of an app grows beyond simple CRUD, you keep reaching for the same infrastructure over and over: caches, distributed locks, rate limiting, circuit breakers, event buses, typed config and env access, retries and timeouts.
Those pieces usually come from hand-rolled code or disconnected single-purpose libraries, each with its own conventions. Or you reach for a monolithic backend framework that doesn't fit well inside a full-stack app. Some teams even split the backend into a separate service — hosted and deployed on its own, sometimes in another repository — which usually means setting up a monorepo. That can become a real headache when you just want to develop fast.
eridu-techsits in the middle:Cache) and add more as you need them.Why I built it
The origin is a concrete frustration: I wanted a NestJS-style backend architecture inside a full-stack framework like Next.js, and it didn't work — NestJS modules are tightly coupled to the NestJS runtime and DI container, so they're hard to reuse anywhere else.
That led to a simple design decision:
So instead of building another framework, I built composable, framework-independent modules that plug into whatever full-stack framework you already chose.
Design principles
1. Adapter-first — the application owns the architecture
Every module depends on a stable contract; infrastructure differences live behind adapters. A cache is a
Cachewhether it's Redis, an in-memory store, or MongoDB. Your business logic never imports a vendor SDK directly:2. Composable modules — useful alone, powerful together
The shared Serde engine shows this best: on its own it's a complete serialization library, but because
Cache,LockFactory, andEventBusall accept the sameSerdeinstance, they share one serialization engine — so aLockobject can be stored in theCacheand read back perfectly, with no glue code between components.3. Frameworks are integration points, not boundaries
SvelteKit handles the app layer;
eridu-techhandles the backend — routing via HttpRouter, plus caching, locking, events, and more:4. Unified architecture
Components are independent but share a consistent architecture — no glue code:
ConfigAccessorprovides a standardized, type-safe way to read domain configuration variables, with optional schema validation.EnvAccessorprovides type-safe environment variable access from any source (process.env, secrets managers, and more), with optional schema validation.Key features
A quick taste
eridu-tech's HttpRouter implements the Winter TCfetchstandard, so it plugs straight into SvelteKit server endpoints. Full-stack frameworks often ship bare-bones routing for backend work — HttpRouter adds the missing layer with typed endpoints, schema-based request validation, and middleware chains, all framework-agnostic. Your routes + infrastructure are framework-independent; only the glue differs:The architecture: SvelteKit owns the app;
eridu-techowns the backend — HttpRouter for typed, framework-agnostic routing, plus caching, locking, and events — all swappable independently.Components available today (17)
Every component ships with multiple built-in adapters (in-memory, Redis, S3, local disk, and more) and its own in-memory testing adapter.
View all component docs →
Getting started
Closing thoughts
SvelteKit already solved "build the whole app in one codebase." The question I keep asking is: what do you reach for when the backend behind those endpoints grows complex? My answer was a set of composable building blocks with adapters — so you can grow a heavy backend directly inside SvelteKit without switching to a separate backend framework.
I'd love feedback — especially from people building growing backends with SvelteKit. What infrastructure do you reach for first? What's missing? I'm happy to discuss trade-offs (abstraction layers aren't free). ⭐ Starring the repo also helps others discover it.
All reactions