Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Development Guidelines

This documentation is designed to establish a common idiom for writing and organizing code within our front-end Next.js project. It covers the environment setup, coding standards, and recommended learning resources and tooling.

Table of Contents

  1. Environment Setup
  2. Coding Standards & Conventions

Environment Setup

Node and Package Manager

  • Using Node:

    Install NodeJS globally if you haven't already by following these instructions here.

  • Using pnpm:

    We standardize package management with pnpm. Install pnpm globally if you haven't already:

    curl -fsSL https://get.pnpm.io/install.sh | sh -
    

Coding Standards & Conventions

Code Style Guidelines

  • Naming Conventions:

    • Use camelCase for variables and functions.
    • Use PascalCase for components and class names.
    • Use UPPERCASE for constant files and configuration variables.
  • File and Directory Naming Coventions:

    • For route folder names using lower-case with hyphens for routes (user-profile/page.tsx).
    • For hooks, use useXXX prefix for hook file names (e.g., useGetUser.ts).
  • Coding

    • In order to avoid unexpected design breaks, don't edit Shadcn's components.
    • In case you're using a different font family, always a generic fallback font in your CSS, such sans-serif.