Code Conventions
Path Alias
@/* maps to ./src/*. All imports use this alias:
import { get } from "@/helpers/api";
import { cn } from "@/lib/utils";Config Location
Application configuration lives in src/config/config.ts (not src/lib/config.ts). This file exports:
getApiUrl(locale)/getLegacyApiUrl(locale)— API base URLsMAPBOX_ACCESS_TOKEN— Mapbox GL token (hardcoded)FINIX_ENVIRONMENT/FINIX_APPLICATION_ID— Finix payment configCAREER_URL— Careers page URL
Styling
- Tailwind CSS 4 with PostCSS
- Shadcn/UI components (New York style variant)
- Global styles in
src/app/globals.css - Always use the
cn()utility fromsrc/lib/utils.tsfor conditional class merging:
import { cn } from "@/lib/utils";
<div className={cn("base-class", isActive && "active-class")} />cn() combines clsx and tailwind-merge to handle Tailwind class conflicts.
Forms
- React Hook Form 7 for form state management
- Zod for validation schemas
@hookform/resolversto connect Zod schemas with React Hook Form- Shared schemas live in
src/lib/schemas/ - The
useBillsFormhook insrc/hooks/use-bills-form.tsis an example of the pattern
Icons
Three icon sources:
- Lucide React (
lucide-react) — Primary UI icons - FontAwesome (
@fortawesome/react-fontawesome) — Brand icons and solid icons - Custom SVGs — Feature-specific icons in
src/features/icons/
Font
The app uses Poppins loaded via next/font/google in the root layout. All text inherits this font.
Locale Utilities
getCurrentLocale(pathname)fromsrc/lib/utils/locale.ts— Extracts locale from pathname in client componentsgetLocaleAwareHref(href, locale)fromsrc/lib/utils.ts— Prepends locale prefix to hrefsLOCALESfromsrc/lib/utils/locale.ts— Array["us", "uk"]DEFAULT_LOCALEfromsrc/lib/utils/locale.ts—"us"
Animations
Motion (formerly Framer Motion) is used for page transitions and hero animations. The motion package is imported from motion/react:
import { motion } from "motion/react";Known Typo
src/lib/utils/contstants.ts (should be “constants”) contains app store URLs. This filename typo is known and has not been renamed to avoid churn.
Last updated on