Student accommodation reviews for NSW universities - Find the perfect place to live while studying in New South Wales.
A production-ready web application for rating and reviewing student accommodations across NSW universities. Built with security, accessibility, and user experience as top priorities.
- Student-Verified Reviews: Only verified university students can submit reviews
- Comprehensive Ratings: Multi-dimensional ratings covering cleanliness, location, value, amenities, management, and safety
- Advanced Search: Filter accommodations by university, location, price range, and amenities
- Responsive Design: Optimized for desktop, tablet, and mobile devices
- Input Validation & Sanitization: XSS, SQL injection, and path traversal protection
- CSRF Protection: Token-based protection for all state-changing requests
- Rate Limiting: Prevents spam and abuse with configurable limits
- Security Headers: CSP, HSTS, X-Frame-Options, and more
- Student Data Privacy: Email verification and minimal data collection
- TypeScript Strict Mode: Enhanced type safety with comprehensive type definitions
- Automated Testing: Jest + React Testing Library with 70%+ coverage
- ESLint + Prettier: Enforced code style and best practices
- Pre-commit Hooks: Husky + lint-staged for quality gates
- Error Boundaries: Graceful error handling throughout the app
- Framework: Next.js 14 with App Router
- Language: TypeScript 5 (strict mode)
- Styling: Tailwind CSS
- State Management: Zustand + TanStack Query
- Forms: React Hook Form + Zod validation
- Testing: Jest + React Testing Library
- Security: CSRF protection, rate limiting, input sanitization
- Code Quality: ESLint, Prettier, Husky
ratemyaccom/
├── app/ # Next.js App Router pages
│ ├── accommodation/[slug]/ # Dynamic accommodation detail pages
│ ├── layout.tsx # Root layout with header/footer
│ ├── page.tsx # Landing page
│ └── globals.css # Global styles and Tailwind directives
├── components/
│ ├── accommodations/ # Accommodation-related components
│ │ ├── AccommodationCard.tsx
│ │ └── FeaturedGrid.tsx
│ ├── forms/ # Form components
│ │ └── ReviewForm.tsx
│ ├── reviews/ # Review-related components
│ │ ├── ReviewCard.tsx
│ │ └── RatingBreakdown.tsx
│ └── ui/ # General UI components
│ ├── Header.tsx
│ ├── Hero.tsx
│ └── SearchBar.tsx
├── lib/
│ ├── auth/ # Authentication utilities (future)
│ ├── database/ # Database utilities (future)
│ ├── utils/ # Helper functions
│ └── data/
│ └── placeholder.ts # Sample data for demonstration
├── types/
│ └── index.ts # TypeScript type definitions
└── public/ # Static assets
- Node.js 18+
- npm or yarn
- Install dependencies:
npm install- Run the development server:
npm run dev- Open http://localhost:3000 in your browser
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
# Code Quality
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint errors
npm run format # Format code with Prettier
npm run format:check # Check code formatting
npm run type-check # Run TypeScript compiler checks
# Testing
npm run test # Run tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage report- Hero section with value proposition
- Search bar for filtering by university/location
- Featured accommodations grid
- Benefits section
- Comprehensive accommodation information
- Rating breakdown by category (cleanliness, location, value, amenities, management, safety)
- Student reviews with pros/cons
- Review submission form
- Contact information and pricing
The project uses strongly-typed interfaces for:
Accommodation- Property details, location, amenities, pricingReview- User reviews with ratings and feedbackUser- User profiles with university affiliationRatingBreakdown- Category-specific ratingsSearchFilters- Search and filter parameters
The project uses Tailwind CSS with a custom color scheme:
- Primary: Blue tones for main actions and branding
- Secondary: Purple accents for highlights
- Accent: Green for success states and verified badges
Custom utility classes include:
.btn,.btn-primary,.btn-secondary,.btn-outline- Button styles.card- Card container with shadow.input- Form input styling.badge- Status badges
The project includes placeholder data for 4 NSW accommodations:
- UNSW Village (Kensington)
- UniLodge on Broadway (Ultimo)
- Macquarie University Village (North Ryde)
- Urbanest Darlington (Darlington)
Each includes realistic pricing, amenities, and student reviews.
-
Install Vercel CLI
npm install -g vercel
-
Deploy to Staging
npm run deploy:staging
-
Deploy to Production
npm run deploy:production
For detailed deployment instructions, see DEPLOYMENT.md
For pre-deployment checklist, see DEPLOYMENT_CHECKLIST.md
-
Copy environment template:
cp .env.example .env.local
-
Configure your environment variables (see
.env.examplefor required variables) -
Set up database:
npm run db:migrate npm run db:seed
- ✅ Vercel deployment configuration
- ✅ Security headers and CSP
- ✅ API rate limiting
- ✅ Database connection pooling
- ✅ Error tracking ready (Sentry)
- ✅ Analytics (Vercel Analytics & Speed Insights)
- ✅ SEO optimization
- ✅ Performance monitoring
- ✅ Automated deployments (CI/CD)
GET /api/accommodations- List accommodations with filteringGET /api/accommodations/[id]- Get single accommodationGET /api/reviews?accommodationId=xxx- Get reviews for accommodationPOST /api/reviews- Submit new reviewGET /api/health- Health check endpoint
- Vercel Analytics: Real-time visitor analytics
- Speed Insights: Core Web Vitals monitoring
- Error Tracking: Sentry integration ready
- Logs: Real-time deployment logs via Vercel
All user inputs are validated using Zod schemas and sanitized to prevent:
- XSS attacks
- SQL injection
- Path traversal
- Script injection
// Example: Review submission validation
const reviewSchema = z.object({
title: z.string().min(10).max(100),
text: z.string().min(50).max(2000).refine(/* XSS check */),
rating: z.number().min(1).max(5),
});All state-changing requests require valid CSRF tokens:
// Automatically handled by API client
api.post('/reviews', reviewData); // CSRF token added automaticallyEndpoints are protected with rate limiting:
- Auth endpoints: 5 requests per 15 minutes
- Review submissions: 3 reviews per 24 hours
- Search: 60 requests per minute
- General API: 100 requests per minute
- Content Security Policy (CSP)
- Strict-Transport-Security (HSTS)
- X-Frame-Options (clickjacking protection)
- X-Content-Type-Options (MIME sniffing protection)
- X-XSS-Protection
- Referrer-Policy
- Student email verification (NSW universities only)
- Bcrypt password hashing
- JWT-based session management
- Role-based access control
We take student data protection seriously:
- Email Verification: Students must verify their university email
- Password Security: Strong password requirements enforced
- Data Minimization: Only collect necessary information
- User Control: Students can delete their reviews and account
- No Third-Party Tracking: No analytics or tracking by default
- User authentication and authorization (NextAuth.js ready)
- Database integration (PostgreSQL migrations ready)
- Image upload and gallery (AWS S3/Cloudinary ready)
- Advanced search and filtering
- Review voting system
- Admin dashboard
- Email notifications (SendGrid configured)
- Map integration for locations (Google Maps API ready)
- Comparison tool for accommodations
- Mobile app version
- Static site generation (SSG) for accommodation pages
- Image optimization via Next.js Image component
- Code splitting and lazy loading
- Edge caching via Vercel CDN
- Optimized bundle size
- Server-side rendering where needed
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverageTests use Jest and React Testing Library:
import { render, screen } from '@/__tests__/utils/test-utils';
import { AccommodationCard } from '@/components/accommodations/AccommodationCard';
describe('AccommodationCard', () => {
it('renders accommodation details', () => {
render(<AccommodationCard accommodation={mockAccommodation} />);
expect(screen.getByText('Test Accommodation')).toBeInTheDocument();
});
});- Statements: 70%
- Branches: 70%
- Functions: 70%
- Lines: 70%
RateMyAccom is built with accessibility in mind:
- Semantic HTML elements
- ARIA labels and roles
- Keyboard navigation support
- Screen reader compatibility
- Color contrast compliance (WCAG AA)
- Focus management
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow the TypeScript style guide
- Write tests for new features
- Ensure all tests pass (
npm test) - Run linting (
npm run lint) - Format code (
npm run format) - Maintain test coverage above 70%
The following checks run automatically before each commit:
- ESLint (auto-fix enabled)
- Prettier formatting
- TypeScript type checking
- Test suite
For deployment issues, see:
MIT License - feel free to use this as a template for your own projects.