A modern, full-featured todo application built with React Router 7, showcasing best practices for monorepo architecture, component design, and developer experience.
- React Router 7 - Latest routing with SSR support
- Monorepo Architecture - Organized with Turbo and workspaces
- Tailwind CSS v4 - Modern styling with CSS variables
- shadcn/ui Components - Beautiful, accessible UI components
- TypeScript - Full type safety throughout
- React Context + useReducer - Built-in state management
- Lambda Curry Forms - Type-safe forms with Zod and React Hook Form (FORMS_INTEGRATION.md)
- Storybook - Component development and documentation (port 6006)
- Bun Test - Fast unit, component, and integration testing
- Bun - Fast package manager and runtime
- Biome - Linting and formatting
- AI / Agent rules - Managed by
ai-rules(AGENTS + Cursor rules) (AGENTS.md)
.
βββ apps/
β βββ todo-app/ # Main todo application
βββ packages/
β βββ config/ # Shared configurations
β βββ ui/ # shadcn/ui component library
β βββ utils/ # Shared utilities and types
βββ turbo.json # Turbo build configuration
βββ package.json # Root workspace configuration
- Bun >= 1.0.0
- Node.js >= 20.11.0
- Clone the repository:
git clone <repository-url>
cd react-router-starter- Install dependencies:
bun install- Start the development server:
bun dev- Open http://localhost:5173 in your browser
From the repo root (uses Turbo):
bun dev # Start all dev servers
bun build # Build all packages and apps
bun test # Run all tests (watch from workspace)
bun run test:ci # Run tests once (CI)
bun lint # Lint all packages
bun typecheck # Type check all packagesFrom apps/todo-app (or bun run --filter todo-app ... from root):
cd apps/todo-app
bun dev # Start dev server (http://localhost:5173)
bun run storybook # Start Storybook (http://localhost:6006)
bun run build-storybook # Build static Storybook
bun test # Bun test run
bun run test:watch # Bun test watch mode
bun run test:run # Bun test single runQuick flows:
- Add a todo: Open app β type in the input β submit (or use the "Advanced Todo Form" route for the full form example).
- Run tests: From root
bun test, or fromapps/todo-app:bun run test:run. - Browse components: From
apps/todo-apprunbun run storybookand open http://localhost:6006.
bun dev- Start all development serversbun build- Build all packages and appsbun test- Run all tests (Turbo)bun run test:ci- Run tests once (CI)bun lint- Lint all packagesbun format- Format all codebun typecheck- Type check all packages
bun dev- Start development serverbun build- Build for productionbun start- Start production serverbun test- Run testsbun run test:run- Run tests oncebun run test:ci- Run tests once (CI)bun run test:watch- Run tests in watch modebun run storybook- Start Storybook (port 6006)bun run build-storybook- Build static Storybook
This project uses a monorepo structure with the following packages:
- @todo-starter/ui - Component library based on shadcn/ui
- @todo-starter/utils - Shared utilities, types, and helpers
The app uses React's built-in Context API with useReducer for state management with the following features:
- In-memory todo storage
- CRUD operations for todos
- Filtering (all, active, completed)
- Bulk operations (clear completed)
- Type-safe actions and state updates
Components are organized by feature and follow these principles:
- Single responsibility
- Composition over inheritance
- Proper TypeScript typing
- Accessible by default
This project uses Tailwind CSS v4 with CSS-first configuration for modern, efficient styling.
- CSS-first approach: Theme configuration is defined directly in CSS using the
@themedirective - No JavaScript config needed: Tailwind v4 eliminates the need for
tailwind.config.jsfiles in most cases - Theme variables: All design tokens (colors, spacing, etc.) are defined in
apps/todo-app/app/globals.css - Dark mode support: Uses
@custom-variantand@variantdirectives for theme switching - shadcn/ui compatible: Maintains full compatibility with shadcn/ui components
Component stories live in apps/todo-app/app/components/ as *.stories.tsx (e.g. add-todo.stories.tsx, todo-item.stories.tsx, todo-filters.stories.tsx, contact-form.stories.tsx). Storybook is configured in apps/todo-app/.storybook/.
| Command | Description |
|---|---|
bun run storybook |
Start Storybook dev server (from apps/todo-app) β http://localhost:6006 |
bun run build-storybook |
Build static Storybook output |
Use npm run storybook / npm run build-storybook if you prefer npm in that app.
The project uses Bun test and React Testing Library for unit, component, and integration tests. Full patterns and examples are in apps/todo-app/TESTING.md.
Patterns:
- Unit β Pure helpers in
app/lib/__tests__/*.test.ts. - Component β UI components in
app/components/__tests__/*.test.tsx; userenderWithRouterfromtest/test-utils.tsxwhen components useLink,useNavigate, or other router APIs. - Integration β Full route + provider flows in
app/routes/__tests__/*.integration.test.tsx.
Scripts (from apps/todo-app):
| Script | Description |
|---|---|
bun test |
Bun test run |
bun run test:run |
Single run (CI) |
bun run test:ci |
Same as test:run |
bun run test:watch |
Watch mode |
Shared setup: test/setup.ts. Shared helpers: test/test-utils.tsx (includes renderWithRouter).
The project uses Tailwind CSS v4 with:
- CSS variables for theming
- Custom design tokens
- Responsive design utilities
- Dark mode support (ready)
- shadcn/ui components with Radix UI primitives
- Consistent design system
- Accessible color contrasts
- Responsive layouts
- Create component in
packages/ui/src/components/ui/ - Export from
packages/ui/src/index.ts - Use in apps with
import { Component } from '@todo-starter/ui'
- Create utility in
packages/utils/src/ - Export from
packages/utils/src/index.ts - Use in apps with
import { utility } from '@todo-starter/utils'
The project enforces code quality through:
- Biome for linting and formatting
- TypeScript for type checking
- Pre-commit hooks (when configured)
- Consistent code style across packages
bun buildbun startThe app supports:
- Server-side rendering (SSR)
- Static pre-rendering
- Progressive enhancement
- FORMS_INTEGRATION.md β Lambda Curry Forms setup, patterns, and examples
- apps/todo-app/TESTING.md β Testing guide (unit, component, integration,
renderWithRouter) - AGENTS.md β Generated agent rules (ai-rules) and Ralph/Beads guidance
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.