Skip to content

Nuxt 4 Starter Template - Forked & Enhanced

Posted on:Alvar Laigna | February 7, 2025 at 10:00 AM

The Nuxt 4 Starter Template is a forward-compatible, rigorously enhanced framework designed to harness the potential of upcoming Nuxt features while retaining seamless compatibility with Nuxt 3. Maintained by Alvar Laigna, this project is a refined fork of Tauno Hanni original templateβ€”used here.

This forked repository includes:

[Top]


Repository

Overview

This robust starter kit underscores advanced front-end engineering principles and forward-compatible best practices. It integrates the latest enhancements in Nuxt and Vue ecosystems, ensuring that your projects remain technologically relevant for years to come.

Key Highlights


Features

πŸš€ Core Technologies

πŸ’… Styling & UI

πŸ›‘οΈ Security & Quality

🌐 Internationalization (i18n)

Includes a robust, type-safe i18n configuration for multi-locale support:


Example Features

Posts Module

A fully operational demonstration of API integration, showcasing:

Default Layout

Provides an accessible, mobile-first UI structure that includes:


Project Structure

β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ components/     # Vue components
β”‚   β”œβ”€β”€ composables/    # Shared composition logic
β”‚   β”œβ”€β”€ layouts/        # Page layouts
β”‚   β”‚   └── default.vue # Default layout with header and footer
β”‚   β”œβ”€β”€ locales/        # i18n translation files
β”‚   β”œβ”€β”€ middleware/     # Route middleware
β”‚   β”œβ”€β”€ pages/          # Application pages
β”‚   β”‚   β”œβ”€β”€ index.vue   # Home page
β”‚   β”‚   └── posts/      # Posts feature pages
β”‚   β”œβ”€β”€ plugins/        # Vue plugins
β”‚   β”‚   └── i18n.ts     # i18n configuration
β”‚   β”œβ”€β”€ stores/         # State management
β”‚   └── utils/          # Utility functions
β”œβ”€β”€ public/             # Static assets
β”œβ”€β”€ server/             # Server routes/middleware
β”‚   └── api/            # API endpoints
└── tests/              # Test files

Getting Started

Prerequisites

Installation

  1. Clone the repository:
git clone https://github.com/alvarlaigna/nuxt4-starter-template
cd nuxt4-starter-template
  1. Install dependencies:
    • Using Yarn (recommended):
yarn install
npm install
  1. Start the development server:
    • Using Yarn (recommended):
yarn dev
npm run dev

Development Commands

Below commands assume Yarn as the primary package manager but npm is equally supported.

# Install dependencies
yarn install        # npm install

# Start development server
yarn dev           # npm run dev

# Build for production
yarn build         # npm run build

# Preview production build
yarn preview       # npm run preview

# Run tests
yarn test          # npm run test

# Run end-to-end tests
yarn test:e2e      # npm run test:e2e

# Lint code
yarn lint          # npm run lint

# Fix linting issues
yarn lint:fix      # npm run lint:fix

# Format code
yarn format        # npm run format

# Type checking
yarn typecheck     # npm run typecheck

# Clean project
yarn clean         # npm run clean

Tip: If you switch between Yarn and npm, remember to remove the redundant lock file to avoid dependency conflicts.


Best Practices

For any inquiries, suggestions, or contributions, please open an issue or submit a pull request on the GitHub repository.

[Top]