RoomKh is a multi-role property rental and listing management platform designed for the Cambodian real estate market. Built with React, Vite, and Tailwind CSS, the platform connects Buyers/Renters, Property Sellers/Landlords, and Super Admins through a unified, responsive interface aligned with the project's Figma specification.
- Core Framework: React (v18+) + Vite
- Styling & System UI: Tailwind CSS + PostCSS
- Iconography: Lucide Icons (
lucide-react) - Routing & Security: React Router DOM (v6+) with Role-Based Guarding
- HTTP Client: Axios (with pre-configured interceptors)
- Form State & Validation: React Hook Form + Zod
- State Management: React Context API (Auth & Session State)
| Role | Access Level | Permitted Actions & Pages |
|---|---|---|
| Public / Buyer | Client Portal | Browse listings, search & filter properties, detail view, landlord contacts, About Us, Help page. |
| Seller / Owner | Workspace Portal | "Sell Page", multi-step property submission form, manage owned property listings, track statuses. |
| Super Admin | Management Portal | Platform analytics overview, user management, owner approval, listing moderation table. |
roomkh-frontend/
├── public/ # Static assets (favicons, public assets)
├── src/
│ ├── assets/ # Brand assets, static vectors, placeholder images
│ │ ├── images/
│ │ └── icons/
│ ├── components/
│ │ ├── ui/ # Reusable UI primitives (Button, Input, Select, Badge, Table, Modal)
│ │ ├── common/ # Layout primitives (Navbar, AdminSidebar, Footer, StatCard, Pagination)
│ │ └── property/ # Business domain components (PropertyCard, PropertyGrid, FilterBar)
│ ├── config/ # Axios instance, API endpoints, navigation configs
│ ├── context/ # AuthContext (user session, role evaluation, tokens)
│ ├── features/ # Feature-first modular domain slices
│ │ ├── auth/ # Login & Register forms, auth service
│ │ ├── public/ # Home, Property Search, Detail View, About, Help
│ │ ├── seller/ # Sell Page, Add Property form, Seller Listing Table
│ │ └── admin/ # Dashboard metrics, User, Owner, and Listing management
│ ├── hooks/ # Custom hooks (useAuth, useDebounce, useFetch)
│ ├── layouts/ # Wrapper layouts (MainLayout, AdminLayout, AuthLayout)
│ ├── routes/ # Central Router (AppRoutes) & Protection Guard (ProtectedRoute)
│ └── utils/ # Utility helpers (formatCurrency, formatDate, validation)
├── .env.example
├── .gitignore
├── index.html
├── package.json
├── postcss.config.js
├── tailwind.config.js # Design system tokens (colors, typography, radii)
├── README.md
└── vite.config.js
## Quick Start & Setup
1. Prerequisites
Node.js: v18.x or higher
## 🚀 Quick Start & Setup
### 1. Prerequisites
- **Node.js:** v18.x or higher
- **npm:** v9.x or higher
### 2. Installation
```bash
# Clone the repository
git clone https://github.com/your-org/roomkh-frontend.git
# Navigate into project root
cd roomkh-frontend
# Install dependencies
npm install
Create a .env file in the project root:
cp .env.example .envConfigure environment variables inside .env:
VITE_API_BASE_URL=http://localhost:5000/api/v1
VITE_APP_NAME=RoomKhStart the development server:
npm run devOpen http://localhost:5173 to view the application in your browser.
To maintain code quality and prevent merge conflicts across team members:
Create feature branches off dev:
feature/auth-loginfeature/admin-dashboardfeature/seller-add-propertyfix/responsive-navbar
- Do not commit directly to
mainordev. - Open PRs targeting the
devbranch. - Require at least 1 peer code review before merging into
dev.
- UI implementation adheres to the provided Figma Specification.
- Colors, typography, and layout rules are central to
tailwind.config.js. - Form inputs are validated via JSON schema rules prior to API interaction.