This project is a RESTful API developed using Express.js, MongoDB, HTML, CSS, and JavaScript to manage food and nutrition data. The API allows users to perform CRUD operations (Create, Read, Update, Delete) on food items, making managing detailed nutritional information and related attributes easy.
- Comprehensive Data Model:
- Food Item Name, Food Group, Description
- Nutritional Information (Calories, Macronutrients, Micronutrients, etc.)
- Serving Size, Allergens, Ingredients, and more.
- CRUD Operations:
- Add, update, view, and delete food items.
- Retrieve specific food items by ID.
- Backend: Express.js with MongoDB for data storage.
- Frontend: HTML, CSS, and JavaScript.
- Testing: Postman for API testing.
Add a new food item
POST /api/foods
Retrieve all food items
GET /
Retrieve a specific food item by ID
GET /api/foods/:id
Update a food item by ID
PUT /api/foods/:id
Delete a food item by ID
DELETE /api/foods/:id
- Clone the repository.
git clone https://github.com/yourusername/food-and-nutrition
- Install dependencies: npm install.
npm i
- Start the server: npm start.
npm run dev
-
Open your browser and go to http://locathost:5173 to see the application in action
-
Configure MongoDB connection.
-
Use Postman to test API endpoints.
Deployed Link: Food and Nutrition