Skip to content

inputstudio/nuxt3-starter

Repository files navigation

Nuxt 3 Starter

This is an minimal starter template for Nuxt 3. It is based on the what we use and love at Input Studio.

Look at the Nuxt 3 documentation to learn more.

Features

Don't worry, if you don't need something, you can remove it.

  • 👓 Sass and Tailwind CSS
  • Headless UI components
  • 🇬 Google Fonts module
  • 🔍 Nuxt SEO module (robots.txt, sitemap, link checker, etc.)
  • 🪛 Eslint and Prettier with Tailwind plugin (automatically sorts classes based on recommended class order)
  • ⚙️ VS Code settings and recommended extensions
  • 🐋 Dockerfile optimized for production (also includes a GitHub Actions workflow to build and publish the Docker image)
  • 📦 Package manager agnostic (nuxi will ask you which package manager you want and it'll install dependencies accordingly)

⚠️ Prettier 3 is not yet supported by its VS Code extension, so you may need to disable it or use the Prettier 2. Nonetheless, the Prettier 3 CLI works fine. ⚠️

Setup

Make sure to have Node.js version 20 or higher installed on your machine. If it's not the case, you can install volta. Volta will automatically install the required versions of Node.js.

Now, you can run the following command to create a new Nuxt 3 project based on this template:

npx nuxi init -t gh:inputstudio/nuxt3-starter <project-name>

After that, make sure to go through the TODOs (search for TODO in your code editor) to customize the project to your needs. Enjoy ✨

Production

To build the application for production, run the following command:

yarn build

This will generate a dist directory containing the production build. You can preview the production build locally by running:

yarn preview

Check out the deployment documentation for more information.

Docker

Building and running your application

When you're ready, start your application by running: docker compose up --build.

Your application will be available at https://localhost:3000.

Deploying your application to the cloud

First, build your image, e.g.: docker build -t myapp .. If your cloud uses a different CPU architecture than your development machine (e.g., you are on a Mac M1 and your cloud provider is amd64), you'll want to build the image for that platform, e.g.: docker build --platform=linux/amd64 -t myapp ..

Then, push it to your registry, e.g. docker push myregistry.com/myapp.

Consult Docker's getting started docs for more detail on building and pushing.

References