Skip to main content

Next.js Folder Structure

This document describes the purpose of each file and folder in the project.


📂 Top-Level Directories

.github/

Contains GitHub-specific files such as workflows for CI/CD and issue templates.

.yarn/

Yarn v4.7.0 configuration and plugin data.

__tests__/

Contains unit and integration test files for jest

public/

Static assets like images, robots.txt, and favicon files that are served publicly.

runtime/

Runtime-generated data or runtime-specific logic. Varies by implementation.

src/

Main application source code.

tests/

End-to-end or additional tests for PlayWright


📄 Root-Level Files

Configuration & Package Management

  • package.json — Project metadata, scripts, and dependencies.
  • yarn.lock — Yarn lockfile to ensure consistent installs.
  • components.json — UI component metadata for ShadCN.

Docker & Environment

  • Dockerfile — Docker build configuration for the app.
  • postgres.Dockerfile — Custom Docker build file for PostgreSQL service with Cron.
  • compose.yml — Docker Compose file for local development.
  • compose.prod.yml — Docker Compose file for production deployment.
  • .dockerignore — Specifies files to exclude from Docker builds.

Environment Variables

  • .env — Local development environment variables.
  • .env.production — Production-specific environment variables.

Build & Styling Tools

  • next.config.mjs — Configuration for Next.js framework.
  • postcss.config.mjs — PostCSS config used with Tailwind or other CSS tooling.
  • tailwind.config.ts — Tailwind CSS configuration.
  • tsconfig.json — TypeScript compiler options.

Testing

  • jest.config.ts — Jest test configuration.
  • playwright.config.ts — Playwright E2E test configuration.

Dev & Deployment Tools

  • drizzle.config.ts — Configuration for Drizzle ORM.
  • wrangler.toml — Configuration for Cloudflare Workers (for edge/serverless deployment).

Linting & Formatting

  • .eslintrc.json — ESLint rules for code quality.
  • .prettierrc — Prettier code formatting rules.
  • .prettierignore — Ignore rules for Prettier.
  • .gitignore — Files to be ignored by Git.
  • .yarnrc.yml — Custom Yarn configuration.

Documentation

  • README.md — Project overview and setup instructions.
  • devhelp.md — Developer helper notes, onboarding tips, or debug guides.

⚠️ Notes

  • Files/folders marked with ✗ in your terminal output may have linting, dependency, or versioning issues that need fixing.
  • src/ and __tests__/ are marked ★, indicating their core importance to the project.