A JavaScript Object-Oriented Programming implementation of a Farmers Market system demonstrating core OOP concepts.
- Market management with multiple stands
- Farmer assignments with specialties
- Produce inventory with different types and pricing
- Search functionality across market stands
- Buy/sell transactions with inventory updates
src/
├── index.js # Entry point
├── demo/demo.js # Demo functionality
├── models/
│ ├── FarmersMarket.js # Main market class
│ ├── Stand.js # Stand management
│ ├── Farmer.js # Farmer entity
│ ├── ProduceItem.js # Produce with quantities
│ └── produce/ # Produce types (Apple, Banana, etc.)
└── utils/constants.js # Project constants
npm install
npm startBoston Farmer's Market at Newbury Street
3 stands, 3 with farmers
5 different types of produce
Total market value: $1909.00
Paul Revere at Stand block 1:
Stand value: $1127.00
- Apple has a quantity of 100 piece
- Banana has a quantity of 200 dozen
- Tomato has a quantity of 230 lb
- FarmersMarket: Main container managing stands and operations
- Stand: Individual vendor stands with inventory
- Farmer: Market vendors with specialties
- ProduceItem: Produce with quantities and pricing
- Produce: Base class for all produce types
- Inheritance (Produce base class)
- Encapsulation (private state management)
- Composition (Market → Stands → Produce)
- Error handling and validation