Veggie Stack is a full-stack project that manages a vegetarian ingredient inventory and generates high-protein meal suggestions based on available stock. The backend provides REST APIs with meal optimization logic, and the frontend is a Next.js app intended to consume those APIs.
- Backend: Spring Boot 3, Java 21, MongoDB (Spring Data)
- Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS
- Tooling: Maven, ESLint, Postman collections
- Add and list ingredients with nutrition metadata
- Recommend high-protein ingredients from inventory
- Generate a meal plan using a greedy protein optimization algorithm
- backend/ - Spring Boot API (controllers, services, MongoDB repositories)
- frontend/ - Next.js app (App Router)
- postman/ - API request collections
-
Configure MongoDB connection (use environment variables in production):
- Set MONGODB_URI or update backend/src/main/resources/application.properties
-
Run the API:
- Windows: backend/mvnw.cmd spring-boot:run
- macOS/Linux: ./backend/mvnw spring-boot:run
The API runs on http://localhost:8080 by default.
-
Install dependencies:
- cd frontend
- npm install
-
Run the UI:
- npm run dev
The UI runs on http://localhost:3000 by default.
- The frontend is currently scaffolded and ready to connect to the API.
- Meal generation is stateless and does not decrement inventory quantities.
- User profiles and dietary preferences
- Multi-nutrient optimization (protein + calories + fiber)
- Stock deduction and meal history
- Improved optimization (knapsack/linear programming)