Hangry is a full-stack web application built using the MERN (MongoDB, Express.js, React, Node.js) stack. It aims to provide users with a smooth and interactive experience to explore and order food when they're feeling "hangry" (hungry + angry).
- You can view the live link here.
- User authentication and authorization (JWT-based).
- Explore a variety of food items from different categories.
- Add items to cart and manage orders.
- Interactive UI with real-time updates.
- Fully responsive design.
- Backend RESTful API for handling data.
- Frontend: React.js
- Backend: Node.js, Express.js
- Database: MongoDB
- Authentication: JWT (JSON Web Tokens)
- UI Library: Material-UI / Bootstrap (mention if any)
-
Clone the repository:
git clone https://github.com/aayushai/Hangry.git
-
Navigate to the project directory:
cd Hangry
-
Install dependencies for both frontend and backend:
# Install backend dependencies cd backend npm install # Install frontend dependencies cd ../frontend npm install
-
Set up environment variables:
- Create a
.env
file in thebackend
folder and configure the following variables:MONGO_URI=<your-mongo-db-uri> JWT_SECRET=<your-jwt-secret>
- Create a
-
Run the application:
-
Start the backend:
cd backend npm run dev
-
Start the frontend:
cd ../frontend npm start
The app should now be running on
http://localhost:3000
. -
- Register or login to your account.
- Browse food categories and add items to your cart.
- Review and place orders.
- View and manage your profile and order history.
Here are some key API endpoints for the backend (located in the backend/routes
folder):
-
User Routes:
POST /api/users/login
: User login.POST /api/users/register
: User registration.
-
Food Routes:
GET /api/food
: Get all food items.POST /api/food
: Add a new food item (Admin only).
-
Order Routes:
POST /api/orders
: Create a new order.GET /api/orders/:id
: Get order by ID.
If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create your feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a pull request.
This project is licensed under the MIT License.