Skip to content

apj/web-starter

Repository files navigation

Web Starter

A minimal Next.js 15 web starter project with authentication, PostgreSQL, and Tailwind CSS.

Tech Stack

  • Framework: Next.js 15.3.0 + React 19 + TypeScript 5
  • Styling: Tailwind CSS 4 + shadcn/ui components
  • Database: PostgreSQL + Drizzle ORM
  • Authentication: better-auth (email/password)
  • Dev Tools: mise, Docker Compose, pnpm

Prerequisites

  • mise - Runtime version manager
  • Docker - For PostgreSQL database
  • pnpm - Package manager

Getting Started

1. Install mise

curl https://mise.run | sh

2. Clone and setup

cd web-starter

# Install tools (Node.js, Flyway)
mise install

# Install dependencies
pnpm install

3. Configure environment

# Copy the example local config
cp mise.local.toml.example mise.local.toml

# Edit mise.local.toml and set BETTER_AUTH_SECRET
# Generate a secret with: openssl rand -base64 32

4. Start development

# Start everything (database + migrations + dev server)
mise start

This will:

  1. Start PostgreSQL via Docker Compose
  2. Run database migrations
  3. Generate Drizzle types
  4. Open the dev server at http://localhost:3000

5. Create a user

mise auth:create-user -- --email user@example.com --password yourpassword

Available Commands

Command Description
mise start Start dev environment
mise start:clean Clean DB and start fresh
mise dev Start Next.js dev server only
mise build Build for production
mise lint Run ESLint and TypeScript checks
mise db:up Start PostgreSQL container
mise db:down Stop PostgreSQL container
mise db:migrate Run database migrations
mise db:studio Open Drizzle Studio
mise auth:create-user Create a new user

Project Structure

web-starter/
├── src/
│   ├── app/              # Next.js App Router pages
│   ├── components/       # React components
│   │   └── ui/          # shadcn/ui components
│   ├── contexts/         # React contexts
│   └── lib/             # Utilities and services
│       ├── auth/        # Auth helpers
│       ├── services/    # Business logic
│       └── types/       # TypeScript types
├── database/
│   └── migrations/      # Flyway SQL migrations
└── scripts/             # Development scripts

Adding shadcn/ui Components

mise shadcn-add button
mise shadcn-add card
# etc.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published