Welcome to the learning guide for Hirfa! This document provides a roadmap for developers who want to understand the codebase, the technologies used, and how to contribute effectively.
To fully understand and work on Hirfa, you should familiarize yourself with the following technologies:
- Routing: Understand how
app/directory routing works, including route groups like(auth)and(main). - Server vs Client Components: Learn when to use
"use client"and when to keep components on the server for better performance. - Data Fetching: Explore how data fetching works in Server Components.
- Utility-First Styling: Learn how to style components using utility classes directly in your JSX.
- Custom Design Tokens: See how our custom colors (e.g., Iron Blue, Ember Orange) and fonts are configured in
tailwind.config.tsandglobals.css. - RTL Support: Understand how to use logical properties (like
ms-,me-,ps-,pe-) to support Arabic Right-to-Left layouts seamlessly.
- Authentication: Learn how Supabase Auth is integrated, specifically for phone OTP login.
- Database Schema: Familiarize yourself with how data is modeled (Users, Craftsmen, Bookings, Services).
- Row Level Security (RLS): Understand how data access is restricted securely based on the authenticated user.
- Animations: See how we create smooth page transitions, stagger effects, and complex animations (like the emergency SOS radar) using
<motion.div>.
- Type Safety: Review
lib/types.tsto see how we strictly type our data models (Craftsman, Booking, User) to prevent runtime errors.
- The Entry Point: Check
app/layout.tsxto see the global providers, fonts (Cairo & Plus Jakarta Sans), and layout structure. - Onboarding Flow: Explore
app/(onboarding)to see how the multi-step splash and welcome screens are built. - Mock Data: Look at
lib/mock-data.ts. We currently use this to populate the UI. It's a great place to see the expected data structures. - Shared Components: Browse
components/shared/for reusable UI elements likeCraftsmanCardandCategoryCard.
If you are new to this stack, we recommend this path:
- Skim the Next.js App Router Documentation.
- Read about Tailwind CSS logical properties for RTL optimization.
- Review the Supabase docs on Next.js Auth.
- Run the app locally and try modifying the mock data in
lib/mock-data.tsto instantly see how the UI updates.
Happy coding! 🚀