@cruzjs/core
v0.0.3
Published
Core framework package for CruzJS applications. Provides the foundational infrastructure for building full-stack applications on Cloudflare.
Downloads
175
Readme
@cruzjs/core
Core framework package for CruzJS applications. Provides the foundational infrastructure for building full-stack applications on Cloudflare.
Features
- Authentication — Email/password, OAuth (Google, GitHub, Facebook), session management, JWT tokens
- Database — Drizzle ORM integration with Cloudflare D1 (SQLite), schema definitions, migrations
- Dependency Injection — Inversify-based DI with decorators (
@Injectable,@Inject,@Module) - tRPC — Type-safe API layer with procedures, context, and middleware
- Email — React Email templates with sending via Cloudflare Workers
- Jobs — Background job processing with D1-backed queue
- Events — Domain event system with EventEmitter2
- Storage — File upload/download with R2 integration
- Config — Environment-based configuration management
Installation
npm install @cruzjs/corePeer Dependencies
drizzle-orm>= 0.36.0inversify>= 7.0.0reflect-metadata>= 0.2.0zod>= 3.0.0react>= 18.0.0react-router>= 7.0.0@trpc/server>= 11.0.0
Quick Start
// server.cloudflare.ts
import { createCruzApp } from '@cruzjs/core';
import { CloudflareAdapter } from '@cruzjs/adapter-cloudflare';
import * as schema from './database/schema';
export default createCruzApp({
schema,
modules: [],
adapter: new CloudflareAdapter(),
pages: () => import('virtual:react-router/server-build'),
});