Skip to content

Latest commit

Β 

History

History
108 lines (80 loc) Β· 4.15 KB

File metadata and controls

108 lines (80 loc) Β· 4.15 KB

πŸš€ React Template

A modern, high-performance full-stack React template powered by Vite+ and TanStack Start. Designed for developer experience, type-safety, and modularity.

πŸ“‹ Overview

This template provides a solid foundation for building full-stack applications with the latest React 19 features. It uses a modular monolith architecture that can easily scale or be transitioned to a monorepo if needed.

✨ Features

  • βš›οΈ React 19: Leveraging the latest React features and improvements.
  • πŸš€ TanStack Start: Full-stack React framework with type-safe routing and SSR.
  • ⚑ Vite+: Unified toolchain for dev, build, lint, format, and test.
  • πŸ—„οΈ Drizzle ORM: Type-safe TypeScript ORM for PostgreSQL.
  • 🎨 Tailwind CSS v4: Utility-first styling with the latest engine.
  • 🧩 Shadcn UI: 50+ accessible UI components built on @base-ui/react.
  • πŸ“¦ Modular Design: Clean separation of concerns within src/core.

πŸš€ Quick Start

Prerequisites

  • Node.js v22+ and pnpm installed on your machine.
  • Docker (optional, for local PostgreSQL).

Installation

# Install dependencies
pnpm install

# Setup environment variables
cp .env.example .env.local
# Edit .env.local with your credentials

Database Setup

# Start PostgreSQL via Docker (optional)
docker-compose up -d

# Run migrations
pnpm db:migrate

Development

vp dev

Open http://localhost:3000 to see the application.

πŸ› οΈ Tech Stack

Technology Category Description
Vite+ Toolchain Unified dev, build, lint, format, and test
React 19 Frontend The library for web and native user interfaces
TanStack Start Framework Full-stack React framework
Tailwind CSS v4 Styling Utility-first CSS framework
Drizzle ORM Database TypeScript ORM for SQL databases

πŸ“‚ Project Structure

β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/         # UI components, layouts, and providers
β”‚   β”œβ”€β”€ core/               # Core business logic & infrastructure
β”‚   β”‚   β”œβ”€β”€ database/       # Drizzle client and schema definitions
β”‚   β”‚   β”œβ”€β”€ schema/         # Shared Zod validation schemas
β”‚   β”‚   └── shared/         # Shared utilities and constants
β”‚   β”œβ”€β”€ hooks/              # Custom React hooks
β”‚   β”œβ”€β”€ lib/                # Application-specific utilities
β”‚   β”œβ”€β”€ routes/             # TanStack Router file-based routes
β”‚   β”œβ”€β”€ server.ts           # Server entry point
β”‚   └── start.tsx           # Client entry point
β”œβ”€β”€ drizzle.config.ts       # Drizzle ORM configuration
β”œβ”€β”€ package.json            # Project dependencies and scripts
β”œβ”€β”€ tsconfig.json           # TypeScript configuration
└── vite.config.ts          # Vite/Rolldown configuration

πŸ“œ Development Commands

Command Description
vp dev Start development server on port 3000
vp build Build the application for production
vp check Format, lint, and type-check
vp lint --fix Lint code using Oxlint
vp fmt Format code using Oxfmt
vp test Run tests with Vitest
pnpm db:generate Generate Drizzle migrations
pnpm db:migrate Apply Drizzle migrations

πŸ” Environment Variables

Create a .env.local file in the root directory:

DATABASE_URL=postgresql://user:pass@localhost:5432/db

πŸ“„ License

This project is licensed under the MIT License.