-
users
- Fields:
$id(string, auto-generated)name(string)email(string)prefs(object)userType: "buyer" | "seller" | "guest"
createdAt(datetime)updatedAt(datetime)
- Fields:
-
properties
- Fields:
$id(string, auto-generated)title(string)description(string)price(number)location(string)images(array of strings)sellerId(string, references users.$id)status(string): "available" | "sold" | "pending"createdAt(datetime)updatedAt(datetime)
- Fields:
-
bookings
- Fields:
$id(string, auto-generated)propertyId(string, references properties.$id)buyerId(string, references users.$id)sellerId(string, references users.$id)startDate(datetime)endDate(datetime)status(string): "pending" | "confirmed" | "cancelled"createdAt(datetime)updatedAt(datetime)
- Fields:
-
User Registration
- User selects role (buyer/seller/guest)
- Google OAuth authentication
- User preferences updated with role
- Redirected to appropriate dashboard
-
User Login
- Google OAuth authentication
- Session creation
- User role verification
- Redirected to appropriate dashboard
-
User Logout
- Session deletion
- State reset
- Redirect to sign-in page
-
Property Management
- Sellers can:
- Create new properties
- Update property details
- View their listings
- Manage bookings
- Sellers can:
-
Booking System
- Buyers can:
- View available properties
- Make bookings
- View booking history
- Sellers can:
- View incoming bookings
- Accept/reject bookings
- Manage property status
- Buyers can:
-
User Roles
- Buyer
- Can view properties
- Can make bookings
- Can view booking history
- Seller
- Can create properties
- Can manage listings
- Can handle bookings
- Guest
- Can view properties
- Cannot make bookings
- Limited access
- Buyer
-
Authentication
- All users must be authenticated
- Guest users have limited access
- Session management for security
-
Authorization
- Sellers can only manage their own properties
- Buyers can only manage their own bookings
- Guests can only view public data
-
Data Access
- Properties are publicly readable
- Bookings are only visible to involved parties
- User data is protected
-
Authentication Errors
- Session expiration
- Invalid credentials
- Missing permissions
-
Data Validation
- Required fields
- Data type validation
- Relationship validation
-
State Management
- Loading states
- Error states
- Success states
-
Authentication
- POST /auth/login
- POST /auth/logout
- GET /auth/current-user
-
Properties
- GET /properties
- POST /properties
- PUT /properties/:id
- DELETE /properties/:id
-
Bookings
- GET /bookings
- POST /bookings
- PUT /bookings/:id
- DELETE /bookings/:id
-
Global Context
- User authentication state
- User role management
- Loading states
- Error handling
-
Local State
- Form data
- UI states
- Component-specific data
-
Authentication Routes
- /sign-in
- /sign-up
-
Main Routes
- / (Home)
- /properties
- /bookings
- /profile
-
Role-Specific Routes
- /seller/dashboard
- /buyer/dashboard
- /guest/home