A full-stack web application built with Bun, React, tRPC, and PostgreSQL.
- Runtime: Bun - Fast all-in-one JavaScript runtime
- Frontend: React 19 with TypeScript
- Backend: tRPC for type-safe APIs
- Database: PostgreSQL with Drizzle ORM
- Authentication: better-auth
- Styling: Tailwind CSS with shadcn/ui components
- Testing: Vitest
- Database Migrations: Drizzle migrations
- Bun installed
- PostgreSQL database (local or hosted)
bun installCreate a .env file based on .env.example (copy and modify):
cp .env.example .envConfigure the following variables:
DATABASE_URL- PostgreSQL connection stringAUTH_SECRET- Secret key for authentication
Run migrations to set up the database schema:
bun run migrateStart the development server with hot reload:
bun devThe application will be available at http://localhost:3000
Build and start the production server:
bun run build
bun startRun tests with Vitest:
bun testβββ src/
β βββ client/ # tRPC client configuration
β βββ components/ # React components (shadcn/ui)
β βββ lib/ # Utility functions and database
β βββ pages/ # Page components
β βββ server/ # tRPC router and server setup
β βββ App.tsx # Main App component
β βββ frontend.tsx # Frontend entry point
β βββ index.ts # Application entry point
βββ drizzle/
β βββ meta/ # Drizzle migration metadata
β βββ 0000_heavy_venom.sql # Migration files
βββ tests/ # Vitest test files
βββ build.ts # Build script
βββ migrate.ts # Database migration script
βββ drizzle.config.ts # Drizzle configuration
βββ bunfig.toml # Bun configuration
Build and run with Docker:
docker build -t historian .
docker run -p 3000:3000 historian| Command | Description |
|---|---|
bun dev |
Start development server |
bun start |
Start production server |
bun run build |
Build the application |
bun test |
Run tests |
bun run migrate |
Run database migrations |
bun run db:reset |
Reset database schema |
MIT