A gamified platform where users can track visits to Michelin-starred restaurants and compete for the highest score.
- Comprehensive database of Michelin-starred restaurants worldwide
- Filter by star rating (1, 2, 3 stars), country, city, and cuisine type
- Detailed restaurant information including location, cuisine, and year awarded
- Secure user registration and authentication with JWT
- Personal dashboard with visit tracking and statistics
- User profiles with achievements and visit history
- Points system: 1 star = 1 point, 2 stars = 2 points, 3 stars = 3 points
- Global leaderboard ranking users by total points
- Achievement system for milestones
- Social features to view other users' profiles
- Personal statistics: visits by star rating, countries explored
- Global stats showing community activity
- Progress tracking and achievements
- Node.js with Express and TypeScript
- PostgreSQL with Prisma ORM
- JWT authentication with bcrypt password hashing
- Joi validation and express-rate-limit for security
- React with TypeScript and Vite
- Tailwind CSS for styling
- React Query for state management and caching
- React Router for navigation
- React Hook Form for form handling
- Docker and Docker Compose for containerization
- Nginx for frontend serving and reverse proxy
- Production-ready configuration
- Node.js 18+ and npm
- PostgreSQL 15+
- Docker (optional)
-
Clone the repository
git clone <repository-url> cd MichellinCompare
-
Run the setup script
./setup.sh
-
Start the development servers
npm run dev
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
-
Clone the repository
git clone <repository-url> cd MichellinCompare
-
Start with Docker Compose
docker-compose up --build
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- Database: localhost:5432
The database will be automatically migrated and seeded on first startup.
-
Clone and install dependencies
git clone <repository-url> cd MichellinCompare npm install
-
Set up PostgreSQL
# Create database createdb michelin_star_hunter -
Configure environment variables
# Backend cd backend cp .env.example .env # Edit .env with your database URL and JWT secret
-
Set up database
cd backend npx prisma migrate dev npx prisma db seed -
Start development servers
# Root directory npm run dev # This starts both frontend (port 3000) and backend (port 3001)
id,username,email,passwordHashtotalScore,restaurantsVisitedCount- Timestamps
id,name,city,country,cuisineTypemichelinStars(1-3),yearAwardedaddress,latitude,longitude,description- Timestamps
id,userId,restaurantIddateVisited,notes- Timestamps
- Unique constraint on
userId + restaurantId
POST /api/auth/register- User registrationPOST /api/auth/login- User login
GET /api/restaurants- List restaurants with filteringGET /api/restaurants/:id- Get restaurant detailsGET /api/restaurants/filters- Get available filter options
POST /api/visits- Record a restaurant visitGET /api/visits- Get user's visitsDELETE /api/visits/:id- Remove a visit
GET /api/users/profile- Get current user profileGET /api/users/profile/:username- Get public user profile
GET /api/leaderboard- Get top usersGET /api/leaderboard/stats- Get global statistics
DATABASE_URL="postgresql://username:password@localhost:5432/michelin_star_hunter?schema=public"
JWT_SECRET="your-super-secret-jwt-key"
JWT_EXPIRES_IN="7d"
PORT=3001
NODE_ENV="development"
FRONTEND_URL="http://localhost:3000"VITE_API_URL="http://localhost:3001/api"-
Configure production environment
# Update docker-compose.yml with production values # Set strong JWT_SECRET and database credentials
-
Deploy
docker-compose -f docker-compose.yml up -d
-
Run migrations
docker exec michelin-backend npx prisma migrate deploy docker exec michelin-backend npx prisma db seed
-
Build applications
npm run build
-
Set up PostgreSQL
- Create production database
- Run migrations:
npx prisma migrate deploy - Seed data:
npx prisma db seed
-
Configure reverse proxy
- Set up Nginx or similar to serve frontend and proxy API requests
-
Start backend
cd backend npm start
- ✅ JWT-based authentication
- ✅ Password hashing with bcrypt
- ✅ Input validation with Joi
- ✅ Rate limiting
- ✅ CORS configuration
- ✅ Security headers with Helmet
- ✅ SQL injection protection with Prisma
- ✅ XSS protection
- Email: demo@example.com
- Password: password123
cd backend
npm testcd frontend
npm test- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details
Problem: Docker Compose fails with npm errors Solution:
# Clean up and rebuild
docker-compose down -v
docker system prune -f
docker-compose up --build --force-recreateProblem: Database connection errors Solution:
# Check if PostgreSQL container is running
docker ps
# Wait for PostgreSQL to be fully ready (takes ~30 seconds)
docker logs michelin-postgresProblem: Database connection refused Solution:
# Make sure PostgreSQL is running
brew services start postgresql
# Or on Ubuntu: sudo systemctl start postgresqlProblem: Port already in use Solution:
# Kill processes on ports 3000 and 3001
lsof -ti:3000 | xargs kill -9
lsof -ti:3001 | xargs kill -9Problem: Prisma client errors Solution:
cd backend
npx prisma generate
npx prisma db pushMake sure your .env file in the backend directory has the correct database URL:
DATABASE_URL="postgresql://username:password@localhost:5432/michelin_star_hunter?schema=public"Replace username and password with your PostgreSQL credentials.
For issues and questions:
- Check the troubleshooting section above
- Check existing GitHub issues
- Create a new issue with detailed description
- Include environment information and steps to reproduce
Built with ❤️ for food enthusiasts and Michelin star hunters worldwide!