pickstack

Next.js + Turborepo

Monorepo: the app in apps/web, tasks cached by turbo. This page shows exactly what pickstack adds to a Next.js project for Turborepo: the packages, the new files and the changes to existing ones. Every combination is installed, built, linted and tested in CI.

$ npm create pickstack@latest my-app -- --framework next --modules turborepo --yes
Customize in the configurator

Packages it adds

PackageVersionType
turbo^2.11.13dev

New files

apps/web/.gitignore
node_modules
dist
.next
out
next-env.d.ts
*.tsbuildinfo
.env
.env.local
.DS_Store
apps/web/app/about/page.tsx
export default function About() {
  return (
    <section className="page">
      <h1 className="title">About</h1>
      <p className="text">
        Built with Next.js (App Router), React 19, TypeScript, Turborepo.
      </p>
    </section>
  );
}
apps/web/app/globals.css
:root {
  font-family: system-ui, sans-serif;
  color: #0f172a;
  background: #f8fafc;
}

body {
  margin: 0;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
  box-sizing: border-box;
}

.title {
  font-size: 1.875rem;
  margin: 0;
}

.nav {
  display: flex;
  gap: 1rem;
}

.link {
  color: #475569;
  text-decoration: none;
  font-weight: 500;
}

.link:hover {
  color: #0f172a;
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.text {
  max-width: 28rem;
  text-align: center;
  color: #475569;
}

.card {
  background: #fff;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  text-align: center;
}

.count {
  font-size: 3rem;
  font-weight: 700;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.row {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.btn {
  background: #0f172a;
  color: #fff;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font: inherit;
  cursor: pointer;
}

.btn:hover {
  background: #334155;
}
apps/web/app/layout.tsx
import type { Metadata } from "next";
import Link from "next/link";
import "./globals.css";

export const metadata: Metadata = {
  title: "my-app",
  description: "Generated by pickstack",
};

export default function RootLayout({ children }: LayoutProps<"/">) {
  return (
    <html lang="en">
      <body>
        <main className="app">
          <nav className="nav">
            <Link className="link" href="/">
              Home
            </Link>
            <Link className="link" href="/about">
              About
            </Link>
          </nav>
          {children}
        </main>
      </body>
    </html>
  );
}
apps/web/app/page.tsx
import Counter from "@/components/Counter";

export default function Home() {
  return (
    <section className="page">
      <h1 className="title">my-app</h1>
      <Counter />
    </section>
  );
}
apps/web/components/Counter.tsx
"use client";

import { useState } from "react";

export default function Counter() {
  const [count, setCount] = useState(0);

  return (
    <div className="card">
      <p className="count">{count}</p>
      <div className="row">
        <button
          type="button"
          className="btn"
          onClick={() => setCount((n) => n - 1)}
        >
          -1
        </button>
        <button
          type="button"
          className="btn"
          onClick={() => setCount((n) => n + 1)}
        >
          +1
        </button>
      </div>
    </div>
  );
}
apps/web/next.config.ts
import type { NextConfig } from "next";

const nextConfig: NextConfig = {};

export default nextConfig;
apps/web/package.json
{
  "name": "web",
  "private": true,
  "version": "0.1.0",
  "type": "module",
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "typecheck": "next typegen && tsc --noEmit"
  },
  "dependencies": {
    "next": "^16.4.6",
    "react": "^19.3.1",
    "react-dom": "^19.3.1"
  },
  "devDependencies": {
    "@types/node": "^24.19.2",
    "@types/react": "^19.3.0",
    "@types/react-dom": "^19.3.0",
    "typescript": "~6.0.3"
  }
}
apps/web/tsconfig.json
{
  "compilerOptions": {
    "target": "ES2017",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "react-jsx",
    "incremental": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "paths": {
      "@/*": ["./*"]
    }
  },
  "include": [
    "next-env.d.ts",
    "**/*.ts",
    "**/*.tsx",
    ".next/types/**/*.ts",
    ".next/dev/types/**/*.ts",
    "**/*.mts"
  ],
  "exclude": ["node_modules"]
}
turbo.json
{
  "$schema": "https://turborepo.dev/schema.json",
  "ui": "tui",
  "tasks": {
    "build": {
      "dependsOn": ["^build"],
      "inputs": ["$TURBO_DEFAULT$", ".env*"],
      "outputs": [".next/**", "!.next/cache/**", "!.next/dev/**"]
    },
    "dev": {
      "cache": false,
      "persistent": true
    },
    "typecheck": {
      "dependsOn": ["^typecheck", "build"]
    }
  }
}

Changes to existing files

.gitignore (changed)
 node_modules+.turbo−dist−.next−out−next-env.d.ts−*.tsbuildinfo .env .env.local .DS_Store⋯ 1 unchanged lines

Project files

Related templates