$ show giuseppelt/httpc
httpc is a TypeScript framework for building function-based APIs with end-to-end type safety. It abstracts HTTP into typed function calls, providing a server with a middleware pipeline (parsers, rewriters, renderers), a typed client generator that produces proxy-based clients with full autocompletion, a CLI for scaffolding projects and generating clients, and a comprehensive kit (authentication, caching, validation, dependency injection, event bus, permissions, logging, email, geo). The architecture is a monorepo with packages: server, client, kit, cli, and adapters for Vercel, Netlify, and Cloudflare. Key entry points include `createHttpCServer` (server), `createClient` (client), and CLI commands (`create`, `client`, `call`). Data flows: HTTP request → parser → middleware pipeline → call execution → renderer → response. External dependencies include tsyringe, zod, valibot, winston, lru-cache, redis, maxmind, and jws. The framework is experimental (v0.1.0) but demonstrates strong engineering practices with clean abstractions and reusable patterns.
The LLM identified 3 files worth highlighting for reuse:
Implements a flexible permission checking system with token-based permissions, aliases, includes, and consolidation logic. It is self-contained and can be extracted for any authorization system, demonstrating non-obvious skill in modeling complex permission hierarchies.
An event bus with a hold/flush mechanism for transactional event publishing. It allows deferring event emission until a transaction completes, ensuring consistency. This pattern is reusable for any application needing reliable event handling with rollback support.
A decorator that batches concurrent calls to a function with configurable delay and max batch size. Useful for optimizing database or API calls by reducing round trips. It is self-contained and can be extracted for any project needing batching logic.