This project implements the core architecture for ByteBites, a campus food ordering app. The system uses Python classes and simple algorithms to manage customers, menu items, transactions, and order processing.
bytebites_tinker_activity/
├── CLAUDE.md # Custom agent configuration
├── bytebites_spec.md # Client feature request and candidate classes
├── bytebites_design.md # Final UML class diagram
├── models.py # Core implementation (4 classes)
├── test_bytebites.py # Test suite
└── README.md # This file
- Set up working environment
- Created
bytebites_tinker_activityfolder - Initialized Git repository
- Created initial commit
- Created
- Created spec file (
bytebites_spec.md)- Copied Client Feature Request
- Identified 4 candidate classes
- Configured custom agent (
CLAUDE.md)- Added metadata (name, description, tools)
- Wrote behavior instructions
- Created final UML diagram (
bytebites_design.md)
- Created
models.pywith all 4 classes:- Customer - manages name and purchase_history
- FoodItem - stores name, price, category, popularity_rating
- Menu - manages items collection
- Transaction - stores items and calculates total
- Added class scaffolds with constructors
- Committed implementation
- Implemented core methods:
- Menu.filter_by_category() - filters items by category
- Menu.sort_by_popularity() - sorts by rating (descending)
- Menu.sort_by_price() - sorts by price (ascending)
- Transaction.calculate_total() - computes order total
- Customer.add_purchase() - tracks purchase history
- Tested methods manually
- Committed algorithmic methods
- Created
test_bytebites.py - Implemented test cases:
-
test_calculate_total_with_multiple_items- happy path -
test_order_total_is_zero_when_empty- edge case -
test_filter_menu_by_category- filtering logic -
test_sort_by_popularity- sorting by rating -
test_sort_by_price- sorting by price -
test_customer_purchase_history- purchase tracking
-
- All tests passing (6/6)
Manages customer information and purchase history.
customer = Customer("John Doe")
customer.add_purchase(transaction)Represents menu items with details.
burger = FoodItem("Spicy Burger", 10.00, "Main", 4.5)Manages the collection of food items.
menu = Menu()
menu.add_item(burger)
drinks = menu.filter_by_category("Drinks")Handles orders and calculates totals.
transaction = Transaction()
transaction.add_item(burger)
total = transaction.calculate_total() # Returns 10.00python -m pytest test_bytebites.py -v✅ test_calculate_total_with_multiple_items PASSED
✅ test_order_total_is_zero_when_empty PASSED
✅ test_filter_menu_by_category PASSED
✅ test_sort_by_popularity PASSED
✅ test_sort_by_price PASSED
✅ test_customer_purchase_history PASSED
6 passed in 0.01s
- Simplicity First: Avoided over-engineering; focused only on required features
- Clear Responsibilities: Each class has a single, well-defined purpose
- List-based Storage: Used Python lists for simplicity (no database)
- Functional Methods: Menu sorting/filtering returns new lists (non-mutating)
- Comprehensive Testing: Covered both happy paths and edge cases
This project was built using AI as a design partner:
- Used AI to generate UML diagrams
- Reviewed and refined AI-generated code
- Verified all outputs against the specification
- Made final decisions on implementation details
- Add validation (e.g., price must be positive)
- Implement menu item search by name
- Add transaction date/time tracking
- Create a simple CLI interface
Course: AI110 | Foundations of AI Engineering Week: 3 Activity: ByteBites Tinker Status: ✅ Complete