Start a web app with Next-Stage
Intermediate

Start a web app with Next-Stage

Every new web app needs the same groundwork before you write a single feature: a framework, styling, a place for your API, error checking, tests and instructions for your AI assistant. Next-Stage is a starter template that has all of that set up and working together. In this codelab you'll create your own project from it and start building with your AI coding agent.

What you'll use

  • Next-Stage — A Next.js starter template on GitHub, maintained by Codelab Institute.
  • Bun — A fast all-in-one JavaScript toolkit that installs packages, runs scripts and runs tests. Learn more →
  • An AI coding agent — Claude Code, Cursor, Antigravity, Cline or whichever agent you use.

Before you start: you'll need a GitHub account and Git (see Getting started with GitHub) and Node.js (see Getting started with Node.js & npm).

⏱ 30–45 min

Why use Next-Stage?

Starting a web app from scratch means making dozens of setup decisions before you write your first feature. Next-Stage has already made them for you. Here's what that gets you:

  • Start building on day one. The setup that usually takes days is already done. You open the project and start on your actual app.

  • Proven choices that fit together. Every tool was picked to work well with the others, so you don't have to research and wire up each piece yourself.

  • Quality built in. Formatting, error checking and tests work from the first commit, so mistakes get caught early and the code stays consistent.

  • Ready for AI coding agents. The project includes instructions your AI agent reads automatically, so it writes code that fits your project.

  • Safe and up to date. Protection against malicious packages and weekly dependency updates keep your foundation secure and current.

  • Easy to put online. It deploys to Vercel with no extra configuration.

In short: you spend your first hour building your app, not the scaffolding around it.

🧭 If you get stuck

  • Press Ctrl+C to stop the development server or any command that won't finish.
  • Type clear to clean up a cluttered terminal.
  • Every step can be repeated. If one fails, fix the problem and run that step again — there's no need to start over.

New to the terminal? Read Learn essential terminal commands first.

1Create your project from the template

Next-Stage is a GitHub template repository. A template gives you a brand-new repository with all the files but none of the history — it's yours from the first commit, not a fork linked to ours.

💡 Never created a GitHub account? Follow Getting started with GitHub first to sign up and set up Git, then come back here.

  1. Go to github.com/Codelab-Institute/next-stage
  2. Click the green Use this template button, then Create a new repository.
  3. Choose a name for your project (for example, my-app), pick Public or Private, and click Create repository.
  4. On your new repository's page, click Code and copy the HTTPS URL.

Clone it to your computer and move into the folder (replace the URL with yours):

Terminal
git clone https://github.com/YOUR-USERNAME/my-app.git
cd my-app

What you just did: You created your own repository from the template and downloaded it to your computer.

How to verify:

Terminal
ls

You should see files like package.json, bunfig.toml, AGENTS.md and the src folder.

⚠️ Common error: "Repository not found" when cloning usually means a typo in the URL or that you're signed in to a different GitHub account. Copy the URL again from your repository's Code button.

2Install Bun

Next-Stage uses Bun instead of npm to install packages and run scripts. You install it once and can use it for every project.

Open PowerShell (search for "PowerShell" in the Start menu) and run:

Terminal
powershell -c "irm bun.sh/install.ps1 | iex"

When it finishes, close the terminal and open a new one so it recognizes the bun command.

What you just did: You installed Bun, the tool that will install and run everything in your project.

How to verify:

Terminal
bun --version

You should see a version number like 1.3.x or higher.

⚠️ Common error: "bun: command not found" (or "bun is not recognized" on Windows) usually means the terminal was opened before Bun was installed. Close every terminal window, open a new one and try again.

3Install and run the app

Make sure your terminal is in your project folder. If you opened a new terminal after installing Bun, run cd my-app first. Then install the project's packages and start the development server.

Install the dependencies:

Terminal
bun install

Bun reads bun.lock, so you get exactly the versions the template was tested with. bunfig.toml also tells Bun to skip any package version published in the last 24 hours — protection that matters once you start adding packages of your own.

Start the development server:

Terminal
bun dev

Open http://localhost:3000 in your browser.

What you just did: You installed every package and started Next.js in development mode with Turbopack.

How to verify:

You should see the Next-Stage welcome page with a hero section, a list of features and the tech stack.

⚠️ Common error: "Port 3000 is in use"? Another app is already running there. Stop it with Ctrl+C in its terminal, or start this one on another port:

Terminal
bun dev --port 3001

💡 Need environment variables, like API keys? Copy .env.example to .env.local and add them there. Git ignores .env.local, so your secrets never end up on GitHub.

Terminal
cp .env.example .env.local

4Build your app with prompts

Next-Stage is made for building with an AI agent. Get your agent ready, then build on the template one prompt at a time.

First, install the project's agent skills:

Terminal
bun run skills

This adds a hand-picked set of skills for this stack — React and Next.js best practices, accessibility, design, debugging and checking work before calling it done — to every agent it finds on your machine. Restart your agent afterward.

Using Cursor, Windsurf, GitHub Copilot or Kiro? Also generate rule files in the format your editor expects:

Terminal
bun run rules

Open the project folder in your agent, and keep bun dev running in a terminal so you can watch every change in the browser.

💡 Building your own idea instead of following along? Plan it first with the lesson From idea to app with AI, and keep the plan in a file your agent reads at the start of every conversation: Keep a plan file for your AI agent.

Now send these prompts in order. Each one builds on the last. Replace the parts in [brackets] with your own idea.

  1. Prompt 1: Make it yours

    Prompt
    Rename this app to [My App] and turn the home page into a landing page for [a short description of your idea]. Keep the existing header and footer, and update any tests that check the old name.

    ✅ Check: The home page shows your idea, and the header and browser tab show your app's name.

  2. Prompt 2: Add a page with a form

    Prompt
    Add a contact page at /contact with a form for name, email and message. Show a clear error under any field that's missing or filled in wrong, and add a link to the page in the header.

    ✅ Check: Go to /contact and submit the empty form. You should see an error under each field.

  3. Prompt 3: Connect it to an API

    Prompt
    When the contact form is submitted, send it to a new API endpoint at /api/contact that checks the data again on the server and replies with a success message. Show that message on the page after sending.

    ✅ Check: Fill in the form and submit it. A success message appears.

  4. Prompt 4: Polish the design

    Prompt
    Make the site look good on phones and add a light and dark mode toggle to the header.

    ✅ Check: Make your browser window narrow, or open the site on your phone, and switch between light and dark mode.

  5. Prompt 5: Check the work

    Prompt
    Run bun run check and bun run build, and fix any problems they report.

    ✅ Check: Your agent reports that both commands finish without errors.

💡 Look at each result in the browser before sending the next prompt. If something breaks, paste the error message into your agent and ask it to fix it.

Notice that you never had to name a library. AGENTS.md and the skills you installed already tell the agent which tools this project uses, so it picks the right ones on its own — that's the head start Next-Stage gives you.

5Deploy to Vercel

Next-Stage is a standard Next.js app, so Vercel deploys it with no extra configuration.

Commit and push your changes:

Terminal
git add .
git commit -m "Make Next-Stage my own"
git push

Go to vercel.com/new, import your repository and click Deploy. Vercel detects Next.js and Bun on its own.

In about a minute you'll have a live URL. Every push to main redeploys automatically.

💡 New to Vercel? The Deploy web apps with Vercel codelab walks you through it step by step.

What's next

Your app has a solid foundation. Here's where to take it next:

📋 Describe your app

Fill in _llm-docs/requirements_definition.md with what you want to build. Your agent will use it as the plan for every task.

🗄️ Add a database and sign-in

Supabase gives you PostgreSQL, authentication and storage in one place. Getting started with Supabase

🐘 Use serverless PostgreSQL

Neon is a PostgreSQL database that scales to zero when nobody is using it. Getting started with Neon

📖 Want the big picture? Read Elements of a web application to see how all these pieces fit together.

Under the hood

Curious what you've been building with? create-next-app gives you a minimal Next.js app; Next-Stage adds everything below on top of it.

🧱 A modern full-stack foundation

Next.js 16 with the App Router, React 19 and TypeScript in strict mode. Everything follows the official Next.js conventions, so what you learn here applies to every Next.js project.

🎨 UI and styling ready to go

Tailwind CSS v4 for styling, shadcn/ui for accessible components built on Radix UI, and lucide-react for icons. You add a component with one command and the code becomes yours to change.

🔌 A real API layer

Hono is included for building API routes, with Zod validation through @hono/zod-validator. You get typed, validated endpoints instead of checking every request by hand.

📝 Forms that validate

React Hook Form plus Zod: write one schema and use it to validate data in the browser and on the server.

⚡ Speed everywhere

Bun installs packages and runs scripts much faster than npm, and Turbopack, the default bundler in Next.js 16, refreshes the page almost instantly as you edit.

✅ Quality checks from day one

Biome lints and formats your code (one fast tool instead of ESLint and Prettier), Markuplint catches accessibility problems in your JSX, and TypeScript 7 type-checks everything. One command, bun run check, runs them all.

🧪 Testing already set up

Playwright for end-to-end tests in a real browser and Bun's built-in test runner for unit tests, with an example test to copy from.

🤖 Built for AI-assisted development

AGENTS.md, CLAUDE.md and GEMINI.md tell your AI agent how the project works. Shared rules can be generated for Cursor, Windsurf, GitHub Copilot and Kiro, and Claude Code's settings keep the agent away from your secrets and risky commands.

🛡️ Supply chain protection

Bun only installs package versions that have been public for at least a day, so a freshly published malicious package can't slip in before the community catches it.

🗂️ A clear project structure

Conventions for where everything goes — routes in src/app, shared components in src/components, page-only code in underscore folders like _components — so neither you nor your agent has to guess.

🚀 Deploys to Vercel as-is

Push to GitHub, import the repository on Vercel, and you have a live site. No extra configuration needed.

🤖 How your AI agent knows the project

  • AGENTS.md describes the stack, commands, folder structure and coding style. Most coding agents read it automatically; Claude Code reads CLAUDE.md and Gemini CLI reads GEMINI.md.
  • _llm-rules/ holds shared rules: how to analyze, plan and verify a task, Next.js patterns and testing guidelines.
  • Claude Code's project settings stop the agent from reading .env files or anything that looks like a secret, and from running risky commands like sudo.
  • Cursor comes preconfigured with the Next.js DevTools MCP server, which lets the agent see errors and routes from your running development server.

About this version

Next-Stage was created by Kazuki Yonemoto and is open source under the MIT license (original repository). Codelab Institute maintains its own copy with these additions:

  • Curated agent skills: bun run skills installs a hand-picked set of skills for this stack into every AI agent on your machine.
  • TypeScript 7 for type checking, which is much faster, while TypeScript 6 stays installed for the tools that still need it.
  • Weekly dependency updates through Dependabot, so the template stays on current releases of Next.js, React, Tailwind CSS and Hono.
  • A simpler install: the Socket security scanner was removed because it blocked automatic updates. The one-day minimum release age still protects every install.
🎉

Your app has a head start!

You created a project from Next-Stage, ran it, built new features with your AI agent and deployed it. Now keep going — your next idea is one prompt away.

Back to codelabs

How was this codelab?

Let us know what you thought — suggestions, issues, or anything else.