How thebigby10/flavourai works
Project Type and Purpose
• This is a standalone, AI‐powered terminal application written in Java.
• Purpose: profile user tastes, generate recipes, predict flavour pairings, and chat interactively using AI.
File Structure
Top‐level modules under src/ represent logical layers:
– App.java: application entry point and orchestration
– MainMenu (MainMenuUI.java): CLI menu routing
– Chatbot (ChatbotUI.java): interactive chat interface
– AiRecipe (AiRecipe.java, DisplayCategory.java): recipe‐generation module
– TasteProfiling (TasteProfiling.java, AddRecipe.java, RateRecipe.java, ViewProfile.java, Recipe.java): user profiling logic
– UserManager (LoginSystem.java, RegistrationSystem.java, LoginUI.java, UserInfo.java): authentication & user model
– DatabaseManager (DatabaseManager.java): data persistence layer
Readme Insights
• Core features: taste profiling, AI recipe generation, pairing prediction, ingredient replacement, chemistry explainer, interactive chat.
• External AI/ML “engine” is implied behind recipe generator and chatbot.
• Data evolves as user rates recipes.
a. Main Components
1) Entry Point: App
2) Presentation Layer (CLI UIs):
• MainMenuUI
• ChatbotUI
• LoginUI
3) Application Layer (Controllers/Services):
• UserManager services (LoginSystem, RegistrationSystem)
• TasteProfiling service
• AiRecipe generator service
• Flavour Pairing & Ingredient Replacement logic (within AiRecipe)
4) Data Layer:
• DatabaseManager (handles CRUD via JDBC or embedded DB)
• Data Models (Recipe, UserInfo)
5) External AI/ML Engine (could be an in‐process library or a REST API)
b. Relationships & Interactions
• App invokes MainMenuUI on startup → user selects action.
• MainMenuUI → calls corresponding service:
– Login/Registration → UserManager → DatabaseManager → DB
– Profile operations → TasteProfiling → DatabaseManager → DB
– Recipe generation → AiRecipe → (calls) AI Engine → DatabaseManager → DB
– Chat → ChatbotUI → Chatbot backend → (calls) AI Engine
• Data flows: UI → Service → Database → Service → UI.
• AI Engine calls are “external service” interactions.
c. Architectural Patterns & Principles
• MVC‐style separation:
– View: CLI UIs
– Controller/Service: business logic modules
– Model: domain objects & persistence
• Single Responsibility: each package handles distinct concern.
• Dependency Injection (if used), or simple factory instantiation in App.
d. Technologies & Frameworks
• Language: Java
• Persistence: JDBC or embedded SQLite/H2 via DatabaseManager
• AI/ML: custom in‐process libraries or external REST‐based ML service
• Build: assumed Maven/Gradle (not shown but typical in Java)
Detailed Element Checklist
• App (entry) → MainMenuUI
• MainMenuUI → {LoginUI, ChatbotUI, TasteProfiling, AiRecipe}
• Each UI → its service/controller
• Services → DatabaseManager → Database
• AiRecipe/Chatbot → AI Engine
• Data models (Recipe, UserInfo) tied to Database tables