Directory Overview
Core Directories
Components (src/components/)
Reusable UI components used throughout the application.
Component List
Component List
- AddressAutocomplete.tsx - Google Places autocomplete input
- DraggableImageItem.tsx - Sortable image component for property forms
- FilterSidebar.tsx - Property search filters
- Footer.tsx - Global footer layout
- Header.tsx - Global header with navigation
- HomePageSearchBar.tsx - Search bar for homepage
- ListingsSearchBar.tsx - Search bar for listings page
- PropertyCard.tsx - Property preview card
- PropertyMap.tsx - Interactive map with property markers
- SearchBar.tsx - Generic search component
- SecureRoute.tsx - Protected route wrapper
- WhatsAppButton.tsx - Floating WhatsApp contact button
Components are organized as single-file components with all logic, styles, and JSX in one
.tsx file.Pages (src/pages/)
Page-level components that represent full views.
Public Pages
- HomePage
- ListingsPage
- PropertyDetailPage
- AboutPage (Nosotros)
- ServiciosPage
- QuieroVenderPage
Auth Pages
- AuthPage (Login/Register)
- ForgotPasswordPage
- PasswordResetPage
- EmailVerificationPendingPage
- VerifyEmailPage
Protected Pages
- AdminPage
- PropertyFormPage
- FavoritesPage
Routes (src/routes/)
File-based routing with TanStack Router. Each file represents a route.
Routes are automatically discovered by TanStack Router and compiled into
src/routeTree.gen.ts. Never edit this file manually.Contexts (src/contexts/)
React Context providers for global state management.
AuthContext.tsx
Manages global authentication state:
- Current user session
- Login/logout methods
- User permissions
- Session persistence
Hooks (src/hooks/)
Custom React hooks for reusable logic.
usePermissions.ts
Check user roles and permissions
useSEO.ts
Manage document title and meta tags
Lib (src/lib/)
External service integrations and client configurations.
Library Files
Library Files
- api.ts - API client and HTTP request utilities
- auth-client.ts - Better Auth client configuration
- googleMaps.ts - Google Maps API loader and utilities
Types (src/types/)
TypeScript type definitions and interfaces.
Type Files
Type Files
- api.ts - API response types and request payloads
- index.ts - Core application types (Property, User, etc.)
Utils (src/utils/)
Utility functions and helper modules.
authErrorTranslator.ts
Translate auth errors to Spanish
errorHandler.ts
Global error handling utilities
search.ts
Search and filter logic
seo.ts
SEO utilities and meta tag generation
youtube.ts
YouTube embed helpers
index.ts
General utility functions
File Naming Conventions
Components & Pages
Components & Pages
Use PascalCase for React component files:
Routes
Routes
Use kebab-case and TanStack Router conventions:
Utilities & Hooks
Utilities & Hooks
Use camelCase for non-component files:
Entry Point
src/main.tsx
The application entry point that:
- Imports global CSS (Tailwind)
- Creates the TanStack Router instance
- Configures the Toaster for notifications
- Renders the app with StrictMode
src/main.tsx
Root Layout
src/routes/__root.tsx
Defines the root layout that wraps all routes:
src/routes/__root.tsx
The
<Outlet /> component is where child routes are rendered. This pattern enables nested layouts.Component Organization Best Practices
Single Responsibility
Each component should have one clear purpose
Composition
Build complex UIs by composing smaller components
Colocate Logic
Keep related code together in the same file
Type Safety
Use TypeScript interfaces and types extensively
Assets
src/assets/
Static assets like images, fonts, and other media files.
Generated Files
Configuration Files (Root)
Import Aliases
The project uses relative imports. For example:Next Steps
Tech Stack
Explore the technologies used
Routing
Learn about the routing system