Skip to content

hetvirani18/Ghar-ka-swaad

Repository files navigation

🍽️ Ghar Se Swaad (Home Taste)

Ghar Se Swaad Logo

A modern food delivery platform connecting home cooks with food lovers, bringing authentic homemade meals right to your doorstep.

Ghar Se Swaad React Node.js MongoDB TypeScript

🌟 Features

For Customers

  • Browse Local Cooks: Discover home cooks in your neighborhood
  • Diverse Menu: Explore authentic homemade meals with detailed descriptions
  • Easy Ordering: Seamless cart and checkout experience
  • Real-time Tracking: Track your order status
  • Secure Payments: Multiple payment options including UPI
  • Ratings & Reviews: Rate meals and build trust in the community

For Home Cooks

  • Easy Registration: Simple process to become a cook on the platform
  • Menu Management: Add, update, and manage your meal offerings
  • Order Management: Track and manage incoming orders
  • Earnings Dashboard: Monitor your performance and earnings
  • Kitchen Showcase: Upload photos to showcase your cooking space
  • Location-based Service: Reach customers in your local area

Platform Features

  • Location-based Matching: Connect cooks and customers by proximity
  • Image Upload: Cloudinary integration for meal and kitchen photos
  • Authentication: Secure JWT-based authentication
  • Responsive Design: Works seamlessly on desktop and mobile
  • Real-time Updates: Live order status updates

πŸ› οΈ Tech Stack

Frontend

  • React 18 - Modern React with hooks and functional components
  • TypeScript - Type-safe development
  • Vite - Fast build tool and development server
  • Tailwind CSS - Utility-first CSS framework
  • shadcn/ui - Beautiful and accessible UI components
  • React Router - Client-side routing
  • React Query - Data fetching and state management
  • Lucide React - Beautiful icons

Backend

  • Node.js - JavaScript runtime
  • Express.js - Web application framework
  • MongoDB - NoSQL database
  • Mongoose - MongoDB object modeling
  • JWT - JSON Web Tokens for authentication
  • Cloudinary - Image hosting and management
  • Multer - File upload handling

πŸš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • MongoDB (local or cloud instance)
  • Git

Installation

  1. Clone the repository

    git clone <YOUR_GIT_URL>
    cd ghar-se-swaad
  2. Install frontend dependencies

    npm install
  3. Install backend dependencies

    cd server
    npm install
    cd ..
  4. Environment Setup

    Create .env file in the server directory:

    PORT=5000
    MONGODB_URI=mongodb://localhost:27017/ghar-se-swaad
    JWT_SECRET=your_jwt_secret_key
    CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
    CLOUDINARY_API_KEY=your_cloudinary_api_key
    CLOUDINARY_API_SECRET=your_cloudinary_api_secret
  5. Start the development servers

    Terminal 1 - Backend:

    cd server
    npm run dev

    Terminal 2 - Frontend:

    npm run dev
  6. Open your browser

    Navigate to http://localhost:5173 to see the application.

πŸ“ Project Structure

ghar-se-swaad/
β”œβ”€β”€ public/                 # Static assets
β”œβ”€β”€ src/                    # Frontend source code
β”‚   β”œβ”€β”€ components/         # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ ui/            # shadcn/ui components
β”‚   β”‚   └── ...            # Custom components
β”‚   β”œβ”€β”€ context/           # React context providers
β”‚   β”œβ”€β”€ hooks/             # Custom React hooks
β”‚   β”œβ”€β”€ lib/               # Utility functions
β”‚   β”œβ”€β”€ pages/             # Page components
β”‚   β”œβ”€β”€ services/          # API service functions
β”‚   β”œβ”€β”€ types/             # TypeScript type definitions
β”‚   └── assets/            # Images and icons
β”œβ”€β”€ server/                 # Backend source code
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/        # Configuration files
β”‚   β”‚   β”œβ”€β”€ controllers/   # Route controllers
β”‚   β”‚   β”œβ”€β”€ middleware/    # Express middleware
β”‚   β”‚   β”œβ”€β”€ models/        # MongoDB models
β”‚   β”‚   β”œβ”€β”€ routes/        # API routes
β”‚   β”‚   └── server.js      # Main server file
β”‚   └── uploads/           # File uploads directory
└── package.json           # Frontend dependencies

πŸ”Œ API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • GET /api/auth/profile - Get user profile

Cooks

  • GET /api/cooks - Get all cooks (with location filtering)
  • GET /api/cooks/:id - Get cook details
  • POST /api/cooks - Register as a cook
  • PUT /api/cooks/:id - Update cook profile

Meals

  • GET /api/meals - Get meals (with cook filtering)
  • POST /api/meals - Add new meal
  • PUT /api/meals/:id - Update meal
  • DELETE /api/meals/:id - Delete meal

Orders

  • GET /api/orders - Get user orders
  • POST /api/orders - Place new order
  • PUT /api/orders/:id/status - Update order status

🎨 UI Components

The application uses shadcn/ui components built on top of Radix UI primitives:

  • Navigation: Header with user menu and cart
  • Cards: Cook cards, meal cards with ratings
  • Forms: Registration, login, meal creation
  • Modals: Order confirmation, cook registration
  • Layout: Responsive grid and flex layouts

πŸ” Authentication Flow

  1. Registration: Users can register as customers or cooks
  2. Login: JWT tokens stored in localStorage
  3. Protected Routes: Automatic redirects for unauthenticated users
  4. Role-based Access: Different dashboards for users and cooks

πŸ“± Responsive Design

  • Mobile-first approach with Tailwind CSS
  • Breakpoint-based layouts (sm, md, lg, xl)
  • Touch-friendly interactions for mobile users
  • Optimized images and lazy loading

πŸš€ Deployment

Frontend Deployment

npm run build
# Deploy the dist/ folder to your hosting service

Backend Deployment

cd server
npm start
# Use PM2 or similar for production

Environment Variables for Production

  • Set NODE_ENV=production
  • Configure production MongoDB URI
  • Set secure JWT secrets
  • Configure Cloudinary for production

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Use meaningful commit messages
  • Write tests for new features
  • Ensure responsive design
  • Follow the existing code style

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • shadcn/ui for beautiful UI components
  • Tailwind CSS for utility-first styling
  • Cloudinary for image management
  • MongoDB for flexible data storage

πŸ“ž Support

For support, email [email protected] or join our Discord community.


Made with ❀️ for food lovers and home cooks

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •