Next.js frontend application for managing and displaying property reviews.
A modern, responsive web application built with Next.js 14, React 18, and TailwindCSS. The frontend provides two main views: the Manager Dashboard for reviewing and approving guest feedback, and Property Display Pages for showing approved reviews to the public.
- Framework: Next.js 14 (App Router)
- UI Library: React 18
- Styling: TailwindCSS + shadcn/ui
- Language: TypeScript
- State Management: React Hooks
- Maps: Google Maps Embed API
frontend/
├── app/
│ ├── page.tsx # Dashboard page
│ ├── layout.tsx # Root layout
│ ├── globals.css # Global styles
│ └── property/
│ └── [listingId]/
│ └── page.tsx # Property detail page
├── components/
│ ├── dashboard/ # Dashboard components
│ ├── property-header.tsx # Property header
│ ├── property-reviews.tsx # Reviews section
│ ├── property-map.tsx # Google Maps
│ └── ui/ # shadcn/ui components
├── hooks/
│ ├── use-reviews.ts # Reviews data hook
│ ├── use-review-filters.ts # Filter state
│ └── use-properties.ts # Properties hook
├── lib/
│ ├── api/
│ │ └── reviews.ts # API client
│ └── utils/
│ └── cn.ts # Utilities
├── types/
│ └── review.ts # TypeScript types
├── public/ # Static assets
└── package.json
- View and filter reviews across all properties
- Real-time analytics and statistics
- Approve/disapprove reviews with instant feedback
- Advanced filtering by rating, category, date, channel
- Property-specific views
- Public-facing property listings
- Shows only approved reviews
- Interactive Google Maps
- Responsive design for all devices
- Dynamic content based on property
- Node.js 18+ installed
- npm installed
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Create environment file: Create
.env.localin the frontend directory:NEXT_PUBLIC_API_BASE_URL=http://localhost:3001 NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_google_maps_api_key
-
Run development server:
npm run dev
-
Build for production:
npm run build npm start
| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_API_BASE_URL |
Backend API URL | Yes |
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY |
Google Maps API key | Optional |
- Go to Google Cloud Console
- Create a new project or select existing
- Enable APIs:
- Maps JavaScript API
- Geocoding API
- Places API
- Create API Key in Credentials section
- Add to
.env.local
npm run dev- Start development server (port 3000)npm run build- Build for productionnpm start- Run production servernpm run lint- Run ESLint
Hooks:
useReviews- Manages review data and statsuseReviewFilters- Handles filtering stateuseProperties- Fetches property list
Pages:
/- Dashboard (manager view)/property/[listingId]- Property detail page
Components:
DashboardStats- Analytics cardsReviewsList- Review listing with cardsPropertyMap- Google Maps integrationPropertyReviews- Approved reviews display
The project uses:
- TailwindCSS for utility-first styling
- shadcn/ui for accessible component library
- CSS Variables for theme customization
- Responsive design with mobile-first approach
The frontend communicates with the backend via the API client in lib/api/reviews.ts.
Key functions:
getHostawayReviews(listingId)- Fetch reviewsgetStats(listingId)- Get statisticsapproveReview(reviewId, isApproved)- Update approvalgetProperties()- Get property list
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
- Mobile browsers
- Server-side rendering with Next.js
- Image optimization
- Code splitting
- Lazy loading for maps
- Memoization for expensive calculations
Issue: Cannot connect to backend
Solution: Check NEXT_PUBLIC_API_BASE_URL and ensure backend is running
Issue: Map not displaying
Solution: Add NEXT_PUBLIC_GOOGLE_MAPS_API_KEY to .env.local
Issue: Build errors
Solution: Delete .next folder and node_modules, reinstall
Issue: CORS errors Solution: Verify backend CORS configuration allows frontend domain
Proprietary software developed for Flex Living.