A production-ready full-stack starter application with React, Vite, Express, Neon Postgres, Better Auth, Drizzle ORM, and Shadcn UI.
- 🎨 React 19 with Vite for fast development
- ⚡ Express backend with TypeScript
- 🔐 Better Auth for email/password authentication
- 🗄️ Neon Postgres serverless database
- 🛠️ Drizzle ORM for type-safe database queries
- 🎭 Shadcn UI for beautiful components
- 🧪 Vitest for fast testing
- 📦 pnpm workspaces monorepo structure
- 🔒 ESM modules throughout
react-express-starter/
├── apps/
│ ├── web/ # React + Vite frontend
│ └── api/ # Express backend
├── packages/
│ └── shared/ # Shared types
└── package.json # Root workspace config
- Node.js 20+ or 22+ (LTS)
- pnpm 9+
- Neon database account (https://neon.tech)
-
Install dependencies:
pnpm install
-
Create Neon database:
- Sign up at https://neon.tech
- Create a new project
- Copy the connection string
-
Configure environment variables:
# In apps/api/.env cp apps/api/.env.example apps/api/.envEdit
apps/api/.envand add:DATABASE_URL: Your Neon connection stringBETTER_AUTH_SECRET: Generate withnode -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
-
Setup database:
cd apps/api pnpm db:push -
Start development servers:
# From root pnpm devThis starts:
- Frontend: http://localhost:5173
- Backend: http://localhost:3000
pnpm dev- Run all dev servers in parallelpnpm build- Build all packagespnpm test- Run all testspnpm lint- Lint all packagespnpm type-check- Type check all packages
pnpm dev- Start development server with watch modepnpm db:generate- Generate database migrationspnpm db:push- Push schema to databasepnpm db:studio- Open Drizzle Studio
pnpm dev- Start Vite dev serverpnpm build- Build for productionpnpm test- Run Vitest testspnpm test:ui- Run Vitest with UI
The application includes Vitest for testing:
# Run all tests
pnpm test
# Run tests in a specific workspace
cd apps/web
pnpm test
# Run tests with UI
pnpm test:ui- Frontend: React 19, Vite 7, TypeScript 5.7, Tailwind CSS 3.4, Shadcn UI
- Backend: Express 4, Node.js 20+, TypeScript 5.7
- Database: Neon Postgres, Drizzle ORM 0.37
- Auth: Better Auth 1.4
- Testing: Vitest 3.0, Testing Library
- Package Manager: pnpm 9+
To add more Shadcn components:
cd apps/web
pnpm dlx shadcn@latest add [component-name]MIT