Skip to content

bun-react-effect-example

TypeScript

End-to-end type safety with Effect TypeScript.

The bun init React + shadcn/ui starter, made 100% type-safe with Effect TypeScript. Zero runtime type errors guaranteed through Effect's typed error channels, Schema validation, and compile-time exhaustive error handling.

bun react effect typescript

[features]

Zero Runtime Errors

No any types, no type assertions

Tagged Errors

Data.TaggedError for exhaustive matching

Schema Validation

Effect Schema validates at runtime

Effect Build System

CLI args, resource cleanup, error handling

[install]

git clone https://github.com/ramonclaudio/bun-react-effect-example.git
cd bun-react-effect-example
bun install

[usage]

bun dev        # Development server with HMR
bun start      # Production server
bun build      # Build for production
bun build --help  # CLI options

[structure]

src/
├── index.ts        # Server entry with typed Effect handlers
├── App.tsx         # React root component
├── APITester.tsx   # API test UI with Schema validation
├── frontend.tsx    # React entry with HMR support
├── lib/
│   ├── errors.ts   # Tagged errors
│   └── utils.ts    # Utility functions
└── components/ui/  # shadcn/ui components

[license]

This project is licensed under the MIT license.

[links]