Back to templates

Template details

koa-template

Archived vue-cli starter template that pairs a KoaJS server with Nuxt.js for Vue apps, with dev, build, and production commands.

About this template

koa-template is an archived vue-cli starter that combines a KoaJS server with Nuxt.js for building Vue.js applications, installed with vue init nuxt-community/koa-template <project-name>. It was built for Nuxt 2, which reached end of life on June 30, 2024, and the repository is now archived.

What is koa-template?

koa-template is a vue-cli project template that scaffolds an application with a KoaJS backend server and a Nuxt.js frontend. It takes a project name as input through the vue-cli init command and outputs a ready-to-run project directory containing both server and Nuxt configuration. It runs on Node.js and requires vue-cli version 2.1 or later. No author or maintainer is named in the source beyond the nuxt-community organization.

Key Features

  • KoaJS server integration — the template ships with a Koa server, so the generated project includes a Node backend rather than only a Nuxt frontend.
  • Nuxt.js frontend — Nuxt provides Vue-based server-rendered application structure out of the box in the scaffolded project.
  • Hot reloading in development — npm run dev starts the KoaJS server with Nuxt in dev mode and hot reloading, listening on http://localhost:3000.
  • Production build command — npm run build builds the Nuxt web application for production.
  • Production start command — npm start starts the KoaJS server in production mode.
  • vue-cli based installation — projects are created with vue init from the nuxt-community/koa-template repository.
  • Install with npm or yarn — dependencies install with npm install or yarn install, with a documented yarn caveat for prerelease Node versions.

Who is it for?

  • Vue developers who want a Nuxt frontend paired with a Koa backend without wiring the two together manually.
  • Node.js developers starting a small server-rendered Vue application and wanting a working Koa and Nuxt scaffold as a starting point.
  • Teams on existing Nuxt 2 projects looking for reference structure, given the template targets that Nuxt version.

How does koa-template work?

Run vue init nuxt-community/koa-template <project-name> to scaffold the project, then cd into the directory and run npm install or yarn install. Development runs through npm run dev, which serves the app with hot reloading on port 3000; production uses npm run build followed by npm start.

Pros and cons

  • The generated project includes both a Koa server and a Nuxt frontend, with dev hot reloading on a fixed port.
  • The template is archived and targets Nuxt 2, which reached end of life on June 30, 2024, so it is not a current starting point for new projects.
  • Yarn installs on prerelease Node versions can hit a yarn engine-detection bug.

FAQ

Is koa-template still maintained?

No. The repository is archived, and the template was built for Nuxt 2, which reached end of life on June 30, 2024. It should be treated as historical reference rather than an actively maintained starting point.

How do I install koa-template?

Install it with vue-cli using vue init nuxt-community/koa-template <project-name>, then move into the project directory and run npm install or yarn install. It requires vue-cli version 2.1 or later.

What port does the development server use?

npm run dev starts the KoaJS server with Nuxt in development mode and hot reloading, listening on http://localhost:3000.

What commands does the template provide?

Three: npm run dev for development with hot reloading, npm run build to build the Nuxt application for production, and npm start to run the KoaJS server in production.

Screenshot of koa-template