A modern web application for rating lunch experiences, sharing feedback, and discovering the best lunch spots in your building.
Before you begin, ensure you have the following installed:
- Visual Studio Code with extensions:
- ESLint
- Prettier
- Tailwind CSS IntelliSense
- TypeScript and JavaScript Language Features
- Next.js 14 - React framework for production
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- React Hook Form - Form validation
- Zod - TypeScript-first schema validation
- Chart.js - Data visualization
- React Hot Toast - Toast notifications
- SQLite - Lightweight database
- Drizzle ORM - TypeScript ORM
- better-sqlite3 - SQLite driver
- ESLint - Code linting
- PostCSS - CSS processing
- Autoprefixer - CSS vendor prefixing
- tsx - TypeScript execution
-
🍽️ Lunch Rating & Feedback
- Rate lunch by taste, variety, and wait time
- Quick emoji reactions
- View average ratings
-
🧭 Crowd & Seating Insights
- Real-time building occupancy
- Available seating information
- Interactive crowd heatmap
-
🍰 Food & Dessert Voting
- Vote for favorite food items
- Track popular desserts
- Share lunch photos
-
🏆 Gamification & Leaderboards
- Earn badges for participation
- Compete for special titles
- Track achievements
-
📊 Analytics & Trends
- Weekly food popularity trends
- Building-specific insights
- User engagement metrics
-
👨🍳 Admin Dashboard
- View aggregated feedback
- Highlight popular dishes
- Moderate content
-
Install Node.js and npm
- Visit Node.js website
- Download and install the LTS version
- Verify installation:
node --version npm --version
-
Clone the repository
git clone https://github.com/yourusername/lunchaos.git cd lunchaos
-
Install dependencies
npm install
-
Set up the database
- Create a CSV file named
cafes_food_items.csv
with the following columns:cafe_id,building,cafe,food_item,ingredients
- Run the database initialization script:
npx tsx scripts/init-db.ts cafes_food_items.csv
- This will create the SQLite database and import your data
- Create a CSV file named
-
Start the development server
npm run dev
-
Open your browser
- Visit http://localhost:3000
lunchaos/
├── src/
│ ├── app/ # Next.js app directory
│ │ ├── api/ # API routes
│ │ ├── page.tsx # Home page
│ │ ├── layout.tsx # Root layout
│ │ └── globals.css # Global styles
│ ├── components/ # React components
│ └── lib/ # Utility functions
│ └── db/ # Database configuration
├── scripts/ # Database scripts
├── public/ # Static assets
├── package.json # Dependencies and scripts
├── tailwind.config.js # Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
└── README.md # Project documentation
npm run dev
- Start development servernpm run build
- Build for productionnpm run start
- Start production servernpm run lint
- Run ESLint
-
Schema Changes
- Edit
src/lib/db/schema.ts
to modify database schema - Delete
sqlite.db
to reset the database - Run
npx tsx scripts/init-db.ts cafes_food_items.csv
to reinitialize
- Edit
-
API Routes
- API routes are in
src/app/api/
- Use Drizzle ORM for database queries
- Example query:
const items = await db.select().from(foodItems).where(eq(foodItems.cafeId, cafeId))
- API routes are in
-
Database Reset
rm sqlite.db npx tsx scripts/init-db.ts cafes_food_items.csv
- We use ESLint and Prettier for code formatting
- Follow the TypeScript strict mode guidelines
- Use Tailwind CSS utility classes for styling
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
-
Node.js version mismatch
nvm install 18 nvm use 18
-
Dependencies installation fails
npm cache clean --force rm -rf node_modules npm install
-
TypeScript errors
npm run build # Fix any type errors shown
-
Tailwind CSS not working
npm run dev # Ensure PostCSS is properly configured
-
Database errors
- Ensure the CSV file format matches the schema
- Check that all required columns are present
- Verify the database file has write permissions
- Try resetting the database:
rm sqlite.db npx tsx scripts/init-db.ts cafes_food_items.csv
This project is licensed under the MIT License - see the LICENSE file for details.