Naming Conventions

Consistent naming across the codebase to keep things predictable.

Backend (Laravel)

Controllers

  • Admin controllers: Admin{Resource}Controller — e.g. AdminUserController, AdminPlanController
  • Auth controllers: {Method}Controller — e.g. LoginController, MfaController
  • Org controllers: {Resource}Controller — e.g. MemberController, InvitationController
  • Custom controllers: Place in Controllers/Custom/ namespace

Models

  • Singular PascalCase: User, Organization, ApiKey
  • Custom models in Models/Custom/: Project, ProjectComment
  • Pivot tables use both names: organization_users

Database

  • Tables: plural snake_case — users, api_keys, audit_logs
  • Columns: snake_case — created_by, organization_id, is_active
  • Foreign keys: {model}_iduser_id, organization_id
  • Migrations: numbered prefix 0001_01_01_000000_ for ordering

Config Keys

  • Dot notation: auth.password_login, billing.driver, style.navigation
  • Feature keys: snake_case — api_keys, planning_poker
  • Permission keys: snake_case — view_projects, manage_members

Frontend (React)

Files

  • Pages: PascalCase — DashboardPage.tsx, AdminUsersPage.tsx
  • Components: PascalCase — AppSidebar.tsx, OrgSwitcher.tsx
  • Hooks: camelCase with use prefix — useAuth.ts, useMembers.ts
  • Stores: camelCase — authStore.ts, orgStore.ts
  • UI components: kebab-case (Shadcn convention) — button.tsx, card.tsx

Routes

  • Auth pages: /login, /register, /forgot-password
  • Org pages: /org/settings, /org/members, /org/billing
  • Admin pages: /admin, /admin/users, /admin/settings
  • Custom pages: defined in custom/routes.tsx

API

  • Endpoints: kebab-case — /api/api-keys, /api/auth/magic-link
  • JSON responses: snake_case — { "created_at": "...", "is_active": true }
  • HTTP methods: REST conventions — GET (read), POST (create), PUT/PATCH (update), DELETE (remove)