SRMiggy is a full-stack food delivery website designed for SRM students to order food online from Java Canteen vendors and get it delivered to their doorstep.
- User Authentication: JWT-based secure authentication with role-based access (Customer, Vendor, Admin, Rider)
- Vendor Management: Browse multiple vendors with beautiful, modern cards
- Shopping Cart: Add items to cart with real-time updates and smooth animations
- Order Management: Place orders with smart fee calculations
- Digital Wallet: Students can add money to their wallet and use it for payments
- Payment Integration: Supports both wallet payment and mock payment provider for testing
- Admin Dashboard: View statistics, manage orders and vendors
- Professional Design: Modern, glassy interface with smooth gradients and backdrop blur effects
- Micro Animations: Subtle animations on buttons, cards, toggles, and interactions for delightful user experience
- Dark Mode: Seamless dark/light mode toggle with smooth transitions across all components
- Responsive Design: Fully responsive layout optimized for mobile, tablet, and desktop
- Hover Effects: Interactive hover states with scale transformations and shadow effects
- Gradient Accents: Beautiful gradient color schemes throughout the application
- Veg/Non-Veg Toggle: Dynamic filtering of menu items by dietary preference
- All - View complete menu
- π’ Veg - Show only vegetarian items
- π΄ Non-Veg - Show only non-vegetarian items
- Visual Indicators: Clear badges on food cards showing veg/non-veg status
- Item Count Display: Shows number of filtered items dynamically
- Smart Delivery Fee: βΉ10 delivery fee automatically added for orders below βΉ100
- Platform Fee: βΉ2 platform fee applied to all orders
- Real-time Calculations: Total updates dynamically as you add/remove items
- Fee Transparency: Clear breakdown showing subtotal, delivery fee, platform fee, and total
- Operating Hours: Orders accepted only between 11 AM and 7 PM
- Dynamic Slot Display: Shows only available delivery slots based on current time
- Ordering Window: System automatically detects if ordering is closed
- Smart Scheduling: Backend validates slot availability in real-time
- Earn Points: Get 0.5 loyalty points for every βΉ100 spent on food
- Redeem Points: Use your points for discounts (1 point = βΉ1 off)
- Automatic Tracking: Points are automatically added to your account after successful payment
- Flexible Usage: Toggle points on/off in the cart to choose when to redeem
- Visual Feedback: See available points and points to earn prominently displayed in cart
SRMiggy rewards students for every order with our Campus Loyalty Program!
- Earn Points: Get 0.5 loyalty points for every βΉ100 spent on food
- Redeem Points: Use your points for discounts (1 point = βΉ1 off)
- Automatic Tracking: Points are automatically added to your account after successful payment
- Flexible Usage: Toggle points on/off in the cart to choose when to redeem
- Visual Display: See available points and points you'll earn beautifully displayed in cart
- Add items to your cart and proceed to cart page
- View your available loyalty points and points you'll earn from this order in the glassy loyalty card
- Toggle "Use Loyalty Points" to apply your points as a discount
- Your points will be deducted from the order total at checkout
- After payment, new points from this order are automatically credited to your account
- Order total: βΉ200
- Available points: 50 pts
- Toggle on to save βΉ50
- Final total: βΉ150
- After payment, earn 1 point (0.5 Γ 2) from this βΉ200 order
Modern, gradient-based home page with vendor cards featuring hover effects and smooth animations
Seamless dark mode with smooth transitions and enhanced visual appeal
Dynamic Veg/Non-Veg toggle filters with glassy UI elements and modern card designs
Showing only vegetarian items with clear count display and smooth filtering animation
- Java 17
- Spring Boot 3.2.0
- Spring Security (JWT)
- Spring Data JPA
- H2 Database (development) / PostgreSQL via Supabase (production)
- HikariCP Connection Pooling
- Maven
- React 18
- React Router DOM
- Axios
- Tailwind CSS v4.1.14 - Modern utility-first CSS framework
- Vite - Lightning-fast build tool
- Custom Animations - Smooth transitions and micro-interactions
- Gradient System: Beautiful orange-to-red gradients for primary actions
- Glassy Morphism: Backdrop blur effects for modern card designs
- Animation Library: Custom keyframe animations for fade-in, slide-up, scale, bounce, pulse, and shimmer effects
- Shadow System: Multiple shadow variants including glow effects for buttons
- Dark Mode Support: Complete dark theme with optimized colors and contrasts
- Java 17 or higher
- Maven 3.6+
- Node.js 16+ and npm
- Navigate to the backend directory:
cd backend- Run the application:
mvn spring-boot:runThe backend server will start on http://localhost:8080
Database Tables: Tables are automatically created on startup using Hibernate's ddl-auto=update mode. No manual SQL script execution is required. See DATABASE_CONFIGURATION.md for detailed information.
H2 Console Access: http://localhost:8080/h2-console
- JDBC URL:
jdbc:h2:mem:srmiggydb - Username:
sa - Password: (leave empty)
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run devThe frontend will start on http://localhost:5173
The application comes with pre-seeded data for testing:
- Username:
customer - Password:
password
- Username:
admin - Password:
password
- Username:
vendor1 - Password:
password
- 8 Vendors:
- Biryani House (North Indian)
- Dosa Corner (South Indian)
- Burger Junction (American Fast Food)
- Pizza Paradise (Italian Pizzas)
- Thali Express (North Indian Thali)
- Roll Junction (Rolls & Wraps)
- Ice Cream Parlor (Ice Creams)
- Dessert House (Desserts)
- 128 Menu Items: 16 items per vendor with proper veg/non-veg classification and affordable options under βΉ100
- 3 Delivery Slots: Evening time slots
- 3 Users: Customer, Admin, and Vendor accounts
- Browse Vendors: Visit home page to see all available vendors
- View Menu: Click on a vendor to view their menu items
- Add to Cart: Select items and add them to your cart
- Checkout: Proceed to checkout, select delivery slot and address
- Payment: Choose between wallet payment or other payment methods
- Order Confirmation: Receive order confirmation with order ID
- Track Orders: View order history and status in "My Orders"
- Manage Wallet: Add money to wallet and view transaction history
- Operating Hours: 11 AM β 7 PM daily for order placement
- Minimum Order: βΉ100 (orders below this incur βΉ10 delivery fee)
- Platform Fee: βΉ2 (automatically added to all orders)
- Delivery Fee: βΉ10 (only for orders below βΉ100)
- Loyalty Points: Earn 0.5 points per βΉ100 spent, 1 point = βΉ1 discount
- Time Slot System: Available slots shown based on current time
- Vendor Limitation: Cart can only contain items from one vendor at a time
- Batch Delivery: Orders grouped by vendor and slot for efficient delivery
POST /api/auth/register- Register new userPOST /api/auth/login- Login user
GET /api/vendors- Get all active vendorsGET /api/vendors/{id}- Get vendor details
GET /api/menu/vendor/{vendorId}- Get vendor menu
POST /api/orders- Create new orderGET /api/orders- Get user's ordersGET /api/orders/{id}- Get order details
POST /api/payments/create-order- Create payment orderPOST /api/payments/verify- Verify paymentPOST /api/payments/pay-with-wallet- Pay with wallet balanceGET /api/payments/order/{orderId}- Get payment status
POST /api/wallet/add-money- Add money to walletGET /api/wallet/balance- Get wallet balanceGET /api/wallet/transactions- Get transaction historyGET /api/wallet/loyalty-points- Get current loyalty pointsGET /api/wallet/calculate-loyalty-points?orderTotal={amount}- Calculate points for an order
GET /api/admin/orders- Get all ordersGET /api/admin/vendors- Get all vendorsGET /api/admin/stats- Get platform statisticsPUT /api/admin/orders/{id}/status- Update order status
SRMiggy2.0/
βββ backend/
β βββ src/
β β βββ main/
β β β βββ java/com/srmiggy/
β β β β βββ config/ # Configuration classes
β β β β βββ controller/ # REST controllers
β β β β βββ dto/ # Data transfer objects
β β β β βββ model/ # Entity models
β β β β βββ repository/ # JPA repositories
β β β β βββ security/ # Security & JWT
β β β β βββ service/ # Business logic
β β β β βββ SrmiggyApplication.java
β β β βββ resources/
β β β βββ application.properties
β β βββ test/
β βββ pom.xml
β
βββ frontend/
β βββ src/
β β βββ components/ # Reusable components
β β βββ context/ # React context (Auth, Cart)
β β βββ pages/ # Page components
β β βββ utils/ # Utility functions & API
β β βββ App.jsx
β β βββ main.jsx
β βββ package.json
β βββ tailwind.config.js
β
βββ README.md
- Start both backend and frontend servers
- Open
http://localhost:5173in your browser - Register a new account or login with test credentials
- Browse vendors and add items to cart
- Complete the checkout process with mock payment
- View your order in "My Orders"
- Login as admin to access the admin dashboard
- Navigate to the backend directory:
cd backend- Build the JAR file:
mvn clean package -DskipTests-
The JAR file will be created at
target/srmiggy-0.0.1-SNAPSHOT.jar -
Run the JAR file:
java -jar target/srmiggy-0.0.1-SNAPSHOT.jarProduction Configuration:
- Update
application.propertieswith production database credentials - Set a strong JWT secret key
- Configure CORS for your frontend domain
- Enable HTTPS for secure communication
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Build the production bundle (includes compiled Tailwind CSS):
npm run buildThe build output will be in the dist/ directory with:
- Optimized JavaScript bundles
- Compiled and minified Tailwind CSS
- Static assets and HTML
- Preview the production build locally:
npm run preview- Deploy the
dist/folder to your hosting service:- Vercel: Connect your repository and set build command to
npm run build - Netlify: Drag and drop
dist/folder or connect via Git - AWS S3 + CloudFront: Upload
dist/contents to S3 bucket - Nginx/Apache: Copy
dist/contents to web server root
- Vercel: Connect your repository and set build command to
Environment Variables for Production:
Create a .env.production file in the frontend directory:
VITE_API_URL=https://your-backend-domain.com/apiUpdate API calls in src/utils/api.js to use import.meta.env.VITE_API_URL
Backend:
- Update database configuration from H2 to PostgreSQL/MySQL
- Set strong JWT secret key
- Configure CORS for frontend domain
- Enable HTTPS
- Set up logging and monitoring
- Configure production server port
- Set up backup strategy for database
Frontend:
- Build production bundle with
npm run build - Verify Tailwind CSS styles are properly compiled in
dist/assets/*.css - Update API endpoints to production backend URL
- Enable HTTPS
- Configure CDN for static assets (optional)
- Set up monitoring and error tracking
- Test responsive design on multiple devices
Tailwind CSS Verification: The production build automatically processes Tailwind CSS through PostCSS, generating optimized styles. To verify:
# After building, check the compiled CSS includes Tailwind
cat dist/assets/index-*.css | head -5
# Should show: /*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */Backend:
- Heroku (easy deployment with Git)
- AWS Elastic Beanstalk
- Google Cloud Run
- Railway
- Render
Frontend:
- Vercel (recommended for React + Vite)
- Netlify
- AWS Amplify
- Cloudflare Pages
- GitHub Pages (with SPA routing configuration)
Full-Stack:
- AWS EC2 with Docker
- DigitalOcean Droplets
- Railway (backend + frontend)
- Render (backend + frontend)
- Port 8080 already in use: Change port in
application.properties - Database errors: H2 is in-memory, restart will reset data
- JWT errors: Check secret key in
application.properties
- API connection errors: Ensure backend is running on port 8080
- CORS errors: Check CORS configuration in SecurityConfig
- Build errors: Delete
node_modulesand runnpm installagain - Tailwind styles not applying:
- Verify
index.csscontains@tailwinddirectives - Check
tailwind.config.jscontent paths include all component files - Rebuild with
npm run buildto regenerate CSS
- Verify
- Blank page after deployment: Check browser console for API endpoint errors
- Tailwind CSS missing in production: Verify
postcss.config.jsandtailwind.config.jsare committed - 404 on page refresh: Configure your hosting for SPA routing (redirect all routes to
index.html) - CORS errors in production: Update backend CORS configuration with production frontend URL
- This is a development setup with H2 in-memory database
- Tables are automatically created on startup using Hibernate's
updatemode - No manual SQL scripts needed - the DataInitializer seeds all data automatically
- See DATABASE_CONFIGURATION.md for detailed database setup information
- For Production: Use Supabase PostgreSQL (see setup guides below)
- Tailwind CSS is configured with PostCSS and works in both dev and production builds
- Frontend uses Vite for fast development and optimized production builds
- β Supabase PostgreSQL Integration Available
- β See SUPABASE_SETUP.md for complete setup guide
- β See MIGRATION_GUIDE.md for migrating from H2 to Supabase
- β See EXAMPLE_SERVICE_CODE.md for code examples
- Replace mock payment with actual provider (Razorpay/Stripe)
- Update JWT secret key for production use
- Add proper error handling and validation
- Ensure Tailwind CSS is properly compiled in production build (automatically handled by Vite)
- Use environment variables for sensitive configuration
- Enable HTTPS for both frontend and backend
- Set up proper database backups (automatic with Supabase)
- β UUID primary keys for better security and scalability
- β Row Level Security (RLS) for data isolation
- β HikariCP connection pooling for performance
- β Automatic timestamp tracking with database triggers
- β Professional PostgreSQL schema with indexes
- β Production-grade database with automatic backups
# 1. Create Supabase project at https://supabase.com
# 2. Run schema SQL FIRST in Supabase SQL Editor
# File: backend/src/main/resources/supabase-schema.sql
# This creates all tables
# 3. Run migration SQL SECOND in Supabase SQL Editor
# File: supabase_migration.sql (in root directory)
# This inserts vendor and menu data
# 4. Update connection details in backend/src/main/resources/application-supabase.properties
# 5. Run backend with Supabase profile
mvn spring-boot:run -Dspring-boot.run.profiles=supabase⨠Migration Script Updated! The supabase_migration.sql file now includes:
- β Table existence checks with helpful error messages
- β Handle Row Level Security (RLS) automatically
- β Idempotent (safe to re-run)
- β Atomic transactions
- β See SUPABASE_DATABASE_SETUP.md for complete setup guide
- β See QUICKSTART_MIGRATION.md for quick reference
See detailed guides for complete instructions.
The project uses GitHub Actions for automated builds and testing.
The workflow automatically runs on:
- Push to
mainordevelopbranches - Pull requests targeting
mainordevelopbranches
Backend:
- Compiles Java code with Maven
- Runs unit tests
- Packages the application as a JAR file
- Uploads the JAR artifact for 7 days
Frontend:
- Installs npm dependencies
- Runs ESLint for code quality
- Builds the production bundle with Vite
- Uploads the build artifact for 7 days
Check the build status badge at the top of this README or visit the Actions tab in the repository.
To verify builds locally before pushing:
# Backend
cd backend
mvn clean package
# Frontend
cd frontend
npm install
npm run lint
npm run buildBuilt as a campus food delivery solution for SRM University students.
This project is for educational purposes.