Skip to content

Inkubator-IT/web

Repository files navigation

Inkubator IT — Next.js Template

A production-ready Next.js frontend template for projects in the Inkubator IT GitHub organization. Built and maintained by the DevOps team to standardize stack choices, development workflows, and deployment conventions across all client projects.

Tech Stack

  • Runtime: Bun (scripts, tooling)
  • Framework: Next.js 15 (App Router, Turbopack)
  • Language: TypeScript
  • UI: Tailwind CSS v4
  • Icons: lucide-react
  • Quality: Biome (lint & format)

Project Structure

.
├─ src/
│  ├─ app/                # App Router (layouts, pages, styles)
│  │  ├─ globals.css      # Tailwind v4 + theme tokens
│  │  ├─ layout.tsx       # Root layout
│  │  └─ page.tsx         # Example landing page
│  ├─ components/         # Reusable React components
│  │  └─ example-card.tsx # Example component
│  └─ lib/
│     └─ utils.ts         # Shared utilities (e.g., cn helper)
├─ public/                # Static assets served as-is
│  ├─ logo-iit.png
│  ├─ next-white.svg
│  └─ ...
├─ next.config.ts         # Next.js config (output: standalone, static export)
├─ postcss.config.mjs     # Tailwind v4 via PostCSS
├─ components.json        # shadcn/ui component registry config
├─ biome.json             # Biome config (lint/format rules)
├─ tsconfig.json          # TypeScript config (path alias `@` → `src`)
└─ package.json           # Scripts and dependencies

Prerequisites

  • Bun installed (bun --version)
  • Docker (optional, for container builds)

Getting started (local development)

  1. Create a new repository from this template in the Inkubator IT organization.
  2. Clone your new repository.
  3. Copy .env.example to .env.local (or .env) and fill in values.
    • NEXT_PUBLIC_API_URL is the URL of the API.
  4. Install dependencies:
bun install
  1. Start the dev server (Turbopack):
bun run dev
  1. Open http://localhost:3000.
  2. Edit src/app/page.tsx to try HMR.

Environment variables

Next.js loads env files automatically. Server-side variables are always available via process.env. To expose a variable to the browser, prefix it with NEXT_PUBLIC_.

  • Place env files at the project root: .env.local, .env.development, .env.production, etc.
  • Use NEXT_PUBLIC_* for variables needed on the client.

Example .env.local:

NEXT_PUBLIC_API_URL="http://localhost:3001"

Use in server code (RSC/route handlers):

const apiUrl = process.env.NEXT_PUBLIC_API_URL;

Use in client code (or shared code executed on the client):

const apiBaseUrl = process.env.NEXT_PUBLIC_API_BASE_URL;

Scripts

  • dev: next dev --turbopack
  • build: next build --turbopack
  • start: next start
  • lint: biome check
  • lint:fix: biome check --write
  • format: biome format --write

Run examples:

bun run dev
bun run build && bun run start
bun run lint

Aliases

TypeScript paths are configured for cleaner imports:

  • Alias: @./src

Example:

import { cn } from "@/lib/utils";

Styling

  • Tailwind CSS v4 is preconfigured via @import "tailwindcss" in src/app/globals.css.
  • Light/dark design tokens are provided; apply .dark on <html> or any parent node to switch.
  • Includes tw-animate-css for simple animations.

Run with Docker

This repo provides a multi-stage Dockerfile using Bun for both build and runtime, leveraging Next.js output: "standalone".

Build the production image:

docker build -t inkubatorit/nextjs-template .

Run the container:

docker run --rm -p 3000:3000 \
  -e NODE_ENV=production \
  -e NEXT_TELEMETRY_DISABLED=1 \
  inkubatorit/nextjs-template

Open http://localhost:3000.

Pass environment variables as needed (server-side only) using -e or an env file.

Code quality

Run Biome locally before commits:

bun run lint
bun run format

Deployment notes

  • Production build emits a standalone server in .next/standalone and static assets in .next/static.
  • Dockerfile copies public/, .next/standalone, and .next/static, then runs server.js with Bun in a minimal image.
  • Telemetry is disabled in the image via NEXT_TELEMETRY_DISABLED=1. Remove or change if you prefer.
  • If hosting behind a sub-path or CDN, configure basePath/assetPrefix in next.config.ts and ensure links and asset URLs respect them.

Troubleshooting

  • If native deps fail on Alpine (musl), add libc6-compat in the deps stage (see Dockerfile comment).
  • Tailwind not applying? Ensure classes are in files under src/ and the dev server was restarted after dependency changes.
  • Type errors from path aliases? Verify tsconfig.json has "@/*": ["./src/*"] and the dev server was restarted.

Contributing

Maintained by the Inkubator IT DevOps team. Contributions are welcome via Pull Requests. For significant changes, please open an Issue first for discussion.

Support

For questions or support, contact the Inkubator IT DevOps team.

License

Copyright (c) Inkubator IT. All rights reserved.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published