Skip to content

Rewrite README with clearer examples and philosophy#100

Open
trycatchal wants to merge 1 commit into
feat-support-non-http-adaptersfrom
claude/improve-readme-docs-F6iTC
Open

Rewrite README with clearer examples and philosophy#100
trycatchal wants to merge 1 commit into
feat-support-non-http-adaptersfrom
claude/improve-readme-docs-F6iTC

Conversation

@trycatchal
Copy link
Copy Markdown
Owner

Summary

This is a comprehensive rewrite of the README to better communicate HipThrusTS's core value proposition and make it more accessible to new users. The documentation now leads with concrete, runnable examples and clearer explanations of the framework's philosophy.

Key Changes

  • Simplified opening: Replaced lengthy "WHO is HipThrusTS for?" section with a concise pitch: "Secure-by-default request handlers for Node.js APIs"
  • Concrete examples first: Added a working Express handler example immediately after the pitch, showing the actual API users will interact with
  • Clearer lifecycle documentation: Replaced narrative descriptions with a structured table showing all 8 stages (3 optional, 5 required), their async nature, inputs, and outputs
  • Practical composition patterns: Demonstrated how to write reusable fragments (WithUserFromReq, RequireThingOwner) and compose them across handlers using HTPipe
  • Validation helpers section: Added concrete examples for Zod and Mongoose integrations with actual code
  • tRPC adapter example: Showed that the same handler config works across different frameworks
  • Clearer differentiation: Rewrote "How it differs from other frameworks" to contrast with Express/Fastify (single callback) and NestJS (singleton controllers) rather than abstract philosophy
  • Streamlined philosophy: Condensed from 7 detailed points to 4 core principles, each with brief explanations
  • Simplified roadmap: Replaced speculative future plans with concrete near-term goals
  • Removed: Lengthy FAQ section, detailed architecture explanation of class-based design, and verbose "why the name" section

Notable Details

  • The new examples are executable and show real TypeScript/JavaScript patterns
  • The lifecycle table makes it immediately clear which stages are mandatory vs optional
  • Composition examples demonstrate type-safe context threading through HTPipe
  • The framework differentiation now focuses on practical trade-offs rather than architectural theory

https://claude.ai/code/session_01J7B9UtE9SJ5eZ1HKkSRfMM

Replaces the dated class-based examples (HTBase, WithPreAuth, HasRole,
findByIdAndRequire) with the current config-object API
(hipExpressHandlerFactory, HTPipe, WithInputSlice, defineExpressHandler,
htZodFactory, htMongooseFactory). Opens with a tight value proposition,
adds an honest lifecycle table, includes a tRPC example, and trims the
walls of FAQ text in favor of focused sections.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants