Skip to content
This repository was archived by the owner on May 9, 2026. It is now read-only.

Naming Conventions

Sloan edited this page Apr 14, 2026 · 12 revisions

Commit Naming Conventions

The Conventional Commits specification is a lightweight convention for commit messages. It provides a clear set of rules that make commit history more readable and enable automated tooling. It also ties directly into Semantic Versioning (SemVer), helping determine whether a change is a patch, minor, or major release.

Refer to Conventional Commits methodology.

Commit Message Format

<type>[optional scope]: <description> (Related Commit #)

[optional body]

[optional footer(s)]
  • type: the kind of change (e.g., fix, feat, docs, etc.)
  • scope (optional): a contextual label in parentheses (e.g., feat(parser): ...)
  • description: a short summary of the change
  • body (optional): more details about the change
  • footer(s) (optional): metadata such as BREAKING CHANGE or references

Key Types

  • fix: patches a bug (correlates with PATCH in SemVer)
  • feat: introduces a new feature (correlates with MINOR in SemVer)
  • chore: any non functional changes in the code (ex: linting, formatting)
  • docs: addition or modification of documentation
  • refactor:
  • test:
  • BREAKING CHANGE: indicates an API-breaking change (correlates with MAJOR in SemVer)

Examples

  • Simple feature:
feat: allow config object to extend other configs (#5, #9)
  • Commit with Body and Issue Reference
fix: prevent racing of requests (#13)

Introduce request id and dismiss responses other than the latest request.
Refs: #123

Frontend Naming Conventions

Expo Routes

Consult the Expo Documentation to learn how to name the frontend's routes.

React & TypeScript

Components

PascalCase

This is the standard for React components, making them instantly recognizable.

  • Component file: UserProfile.tsx
  • Component name: function UserProfile() { ... }

Directories

kebab-case

For directories containing component files, use the name of the component.

  • Example: app/components/user-profile/ which contains index.ts and UserProfile.tsx

Non-Component Files

camelCase

For hooks, utilities, services, and other non-component files.

  • Hooks: useAuthentication.ts
  • API services: flightApi.ts
  • Utilities: dateFormatter.ts

Variables & Functions

camelCase

This is the standard for JavaScript and TypeScript.

  • const currentUser = 'John';
  • function getUserFlights() { ... }

Constants & Enums

UPPER_SNAKE_CASE for values that are static and never change.

  • const API_TIMEOUT = 5000;
  • enum UserRole { ADMIN, GUEST }

Styling (NativeWind)

Since NativeWind uses utility classes directly in the className prop, there are no variables to name. If you abstract styles into objects, use camelCase for the keys.

const styles = {
  cardContainer: "p-4 bg-white rounded-lg shadow-md",
  titleText: "text-xl font-bold text-gray-800",
};

Backend Naming Conventions

Node.js, Hono, and TypeScript

Files & Folders

camelCase

  • Routes: userRoutes.ts
  • Services: notificationService.ts
  • Middleware: requireAuth.ts

(kebab-case exceptions allowed for external libraries)

Variables & Functions

camelCase

  • let activeConnections = 0;
  • async function processWebhook() { ... }

Classes

PascalCase

  • class DatabaseService { ... }
  • class DrizzleUserRepo { ... }

API Endpoints

Follow RESTful principles. Use plural nouns and kebab-case for paths.

  • Collection of resources: GET /api/users
  • Specific resource: GET /api/users/:userId
  • Nested resource: GET /api/users/:userId/flight-history

Database Naming Conventions

PostgreSQL and Drizzle

Tables

Plural and snake_case

A table represents a collection of records.

  • users
  • flight_alerts
  • user_profiles

Columns

Singular and snake_case

  • first_name
  • created_at
  • last_login_ip

Primary Keys

Simply id. It's a simple, universal standard.

Foreign Keys

{singular_table_name}_id

This convention makes relationships obvious.

  • The flight_alerts table would have a user_id column to reference the users table.

Join / Pivot Tables

Combine the two table names in alphabetical order, separated by an underscore.

  • To link users and roles (many-to-many): roles_users

Indexes

idx_{table_name}_{column_names}

This provides clarity on what the index is for.

  • idx_users_email
  • idx_flight_alerts_user_id_departure_time

Clone this wiki locally