Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

193 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Nuxt Boilerplate

Screenshot

A modern Nuxt 4 production-ready boilerplate with TypeScript, authentication, and full-stack development tools.

πŸš€ Features

  • πŸ”§ Nuxt 4 with Vue 3 Composition API and TypeScript
  • 🎨 Nuxt UI components with Tailwind CSS
  • πŸ” Authentication with JWT sessions, bcrypt password hashing, and email verification system
  • πŸ—„οΈ Prisma ORM with PostgreSQL and Docker setup
  • 🌍 Internationalization (French/English) with auto-detection
  • πŸ›‘οΈ Security hardening with CORS, CSP, rate limiting, and flexible HTTP/HTTPS configuration
  • πŸ§ͺ Testing with Vitest (unit) and Playwright (E2E)
  • ✨ Code Quality with ESLint, Prettier, and conventional commits
  • πŸ—‚οΈ State Management with Pinia and cookie persistence
  • πŸ“± SEO Optimized with structured meta tags
  • 🐳 Docker support for development

⚑ Quick Start

Prerequisites

  • Node.js β‰₯ 22.0.0
  • pnpm β‰₯ 9.0.0
  • Docker (for PostgreSQL)

Setup

  1. Clone and install

    git clone <repository-url> my-project
    cd my-project
    pnpm install
    cp .env.example .env
  2. Start database

    docker compose up -d          # Start PostgreSQL + Adminer
    pnpm prisma migrate dev       # Run database migrations

    Access Adminer (database UI) at http://localhost:8080 with your database credentials.

  3. Run development server

    pnpm run dev

Visit http://localhost:3000 to see your app with authentication system and example Posts.

πŸ› οΈ Key Commands

pnpm run dev           # start dev server
pnpm run build         # build for production
pnpm run lint          # run ESLint + Prettier
pnpm test              # run unit + E2E tests
docker compose up -d   # start PostgreSQL + Adminer (localhost:8080)
pnpm prisma migrate dev # run DB migrations

πŸ“ Project Structure

β”œβ”€β”€ app/                      # Nuxt application
β”‚   β”œβ”€β”€ components/           # Vue components (auto-imported)
β”‚   β”œβ”€β”€ composables/          # Form composables, utilities
β”‚   β”œβ”€β”€ pages/                # File-based routing
β”‚   └── layouts/              # Layout components
β”œβ”€β”€ shared/                   # Shared utilities (auto-imported)
β”‚   β”œβ”€β”€ models/               # Zod schemas and type definitions
β”‚   β”œβ”€β”€ types/                # API and shared types
β”‚   └── utils/                # Utility functions
β”œβ”€β”€ server/                   # Server-side code
β”‚   β”œβ”€β”€ api/                  # API routes (auto-mapped)
β”‚   β”œβ”€β”€ services/             # Business logic services
β”‚   └── middleware/           # Server middleware
β”œβ”€β”€ prisma/                   # Database schema and migrations
└── test/                     # Unit and E2E tests

πŸ”§ Tech Stack

  • Frontend: Nuxt 4, Vue 3, TypeScript, Nuxt UI, Tailwind CSS
  • Backend: Nitro, H3, PostgreSQL, Prisma ORM
  • Auth: JWT sessions, bcrypt, email verification, rate limiting
  • Testing: Vitest (unit) + Playwright (E2E)
  • Quality: ESLint, Prettier, Husky hooks

πŸ“š Documentation

Detailed implementation guides in /docs/:

🎯 Implementation Patterns

🌟 System Features

πŸš€ Operations

πŸŽ›οΈ Environment Configuration

Copy .env.example to .env and configure:

# Database (required)
NUXT_DATABASE_URL="postgresql://postgres:P@ssw0rd@localhost:5432/database"

# Authentication (required)
NUXT_SESSION_PASSWORD="your-32-character-secret-key-here"

# Email System (required for email verification/password reset)
NUXT_EMAIL_HOST="smtp.gmail.com"
NUXT_EMAIL_PORT="587"
NUXT_EMAIL_USER="your-email@gmail.com"
NUXT_EMAIL_PASS="your-app-password"
NUXT_EMAIL_FROM="noreply@yourdomain.com"

# Production Configuration
NUXT_PUBLIC_SITE_URL="https://yourdomain.com"
# CORS is handled automatically by Nitro for API routes
# Use a reverse proxy (nginx/haproxy) for HTTPS in production

πŸš€ Getting Started Guide

  1. Authentication System - Complete JWT auth with registration, login, email verification, password reset
  2. Email System - Email verification and password reset with template rendering
  3. Posts Example - Full CRUD implementation demonstrating the architecture
  4. Form Patterns - Reusable form composables with validation (useLoginForm, usePostForm)
  5. Auto-imports - No manual imports needed for shared utilities, composables, components

🀝 Contributing

  1. Follow conventional commit format
  2. Run tests before submitting: pnpm test
  3. Ensure code quality: pnpm run lint

Built with ❀️ using Nuxt 4

About

A modern Nuxt 4 boilerplate with TypeScript, authentication, Prisma ORM, and PostgreSQL. Features internationalization, security middleware, testing suite, and shared utilities architecture for rapid development.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

16 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages