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
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
useXXXprefix for hook file names (e.g.,useGetUser.ts).
- For route folder names using lower-case with hyphens for routes
(
-
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.