@lemur-bookstores/secure-stack
v0.1.1
Published
Full-stack TypeScript framework with hybrid communication (gRPC + tRPC), built-in security mesh, and premium developer experience
Maintainers
Readme
SecureStack Framework
Full-stack TypeScript framework with hybrid communication (gRPC + tRPC), built-in security mesh, and premium developer experience
🚀 Features
- Hybrid Communication: gRPC for internal microservices + tRPC for client-server
- Type-Safety End-to-End: Complete type inference without manual codegen
- Built-in Security Mesh: Encrypted communication, JWT auth, rate limiting, audit logs
- Express-like DX: Familiar middleware system and routing
- Plug-and-Play Modules: Auth, RBAC, Cache, Storage, Realtime, and more
🧩 Modules & Use Cases
🔐 Authentication & Security (@lemur-bookstores/auth)
Complete security suite with JWT, RBAC, and Session management.
- Use Case: Protect your API with role-based access control and secure session handling.
- Docs: Auth Setup | RBAC Guide
🕸️ Service Mesh (@lemur-bookstores/mesh)
Internal communication layer with mTLS-like encryption and service discovery.
- Use Case: Securely connect microservices without managing complex certificates.
- Docs: Mesh Overview | Configuration
📱 Client SDK (@lemur-bookstores/client)
Type-safe client SDK with React integration, auth helpers, and CSRF protection.
- Use Case: Build secure frontend applications with authentication, session management, and RBAC.
- Features: Middleware pipeline, token management, SessionProvider with SSR hydration, auth hooks (useSignIn, useSignOut, useIsAuthenticated), RBAC guards (SessionGuard, RoleGate, PermissionGate), CSRF protection, server-side utilities for Next.js
- Docs: Client API | Auth Helper Hooks | CSRF Protection | React Hooks | SSR Support
⚡ Realtime (@lemur-bookstores/realtime)
Scalable WebSocket support using Socket.io and Redis.
- Use Case: Build chat apps, live notifications, or collaborative tools.
- Docs: Realtime Overview
🛠️ CLI Tool (@lemur-bookstores/cli)
Powerful CLI for scaffolding, code generation, and management.
- Use Case: Quickly bootstrap new services or generate boilerplate code.
- Docs: CLI Guide
📦 Installation
npm install @lemur-bookstores/secure-stack
# or
pnpm add @lemur-bookstores/secure-stack
# or
yarn add @lemur-bookstores/secure-stack🎯 Quick Start
import { SecureStack, router } from '@lemur-bookstores/secure-stack';
import { z } from 'zod';
const app = new SecureStack({
name: 'my-service',
port: 50051,
});
const userRouter = router().query('getUser', {
input: z.string(),
handler: async ({ input }) => {
return { id: input, name: 'John Doe' };
},
});
app.router('user', userRouter);
await app.start();
console.log('🚀 Server ready!');📚 Documentation
Visit our documentation for detailed guides and API reference.
- Getting Started
- Core Concepts
- Server Package
- Client Package
- Authentication
- Service Mesh
- Examples
- API Reference
🏗️ Project Structure
This is a monorepo managed with Turborepo and npm workspaces:
secure-stack/
├── packages/
│ └── core/ # @lemur-bookstores/core
│ ├── src/
│ │ ├── SecureStack.ts # Main framework class
│ │ ├── router.ts # Router builder
│ │ ├── types.ts # Type definitions
│ │ └── index.ts # Package entry point
│ ├── package.json
│ ├── tsconfig.json
│ └── tsup.config.ts
├── examples/
│ └── basic/ # Basic usage example
│ ├── src/
│ │ └── index.ts
│ └── package.json
├── docs/ # Documentation (coming soon)
├── .development-guide/ # Development planning docs
│ ├── roadmap.md # Development roadmap
│ ├── feasibility-analysis.md # Feasibility analysis
│ └── secure-microservices-mesh.md # Mesh documentation
├── package.json # Root package.json
├── turbo.json # Turborepo configuration
├── pnpm-workspace.yaml # Workspace configuration
└── tsconfig.json # Shared TypeScript configPackages
- @lemur-bookstores/core - Core framework with context, middleware, and router
- @lemur-bookstores/server - Server implementation with HTTP, tRPC, and gRPC adapters
- @lemur-bookstores/client - Client SDK with React integration, auth, CSRF protection, and SSR support
- @lemur-bookstores/mesh - Service Mesh (coming soon)
- @lemur-bookstores/cli - CLI tool (coming soon)
🚀 Getting Started
Prerequisites
- Node.js 20+ or Bun 1.0+
- npm (comes with Node.js)
Installation
# Clone the repository
git clone https://github.com/lemur-bookstores/secure-stack.git
cd secure-stack
# Install dependencies
npm install
# Build all packages
npm run build
# Run the basic example
npm run dev --workspace=examples/basicDevelopment
# Run all packages in dev mode
npm run dev
# Run tests
npm run test
# Lint code
npm run lint
# Format code
npm run format
# Type check
npm run typecheck🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
📄 License
MIT © @elkincp5
🙏 Acknowledgments
Inspired by:
