Overview
The Apiaries feature is the central hub for organizing your beekeeping operations. Each apiary represents a physical location where you keep your beehives. Softbee allows you to manage multiple apiaries, track their locations, configure treatment preferences, and view hive counts.What is an Apiary?
An apiary (or bee yard) is a location where beehives are kept. In Softbee, each apiary serves as a container for:- Multiple beehives
- Inventory items specific to that location
- Monitoring data and inspections
- Location-based questions and reports
Apiary Entity
Each apiary in Softbee contains the following information:lib/feature/apiaries/domain/entities/apiary.dart
Key Features
Create Apiaries
Add new apiary locations with name, address, and treatment preferences
View All Apiaries
Browse all your apiaries in a card-based interface
Update Details
Modify apiary information including location and settings
Delete Apiaries
Remove apiaries you no longer manage
Creating an Apiary
Users can create apiaries during registration or later from the dashboard.Enter Apiary Details
Provide the following information:
- Name: A descriptive name for the apiary (minimum 3 characters)
- Location: Full address or description of the site
- Treatments: Toggle whether you apply medical treatments to sick bees
The location field should be as specific as possible, including municipality, vereda (rural subdivision), and property name.
lib/feature/apiaries/presentation/widgets/apiary_form_dialog.dart
Viewing Apiaries
The apiaries dashboard displays all your bee yards in an organized card layout.Apiary Card Display
Each apiary card shows:- Apiary Name: Primary identifier
- Location: Address or site description
- Beehive Count: Number of hives at this location
- Treatment Status: Whether treatments are used
- Created Date: When the apiary was added
Navigation Options
From each apiary card, you can access:- Hives Page: View and manage all beehives at this apiary
- Inventory Page: Track supplies and equipment for this location
- Reports Page: Generate reports for this apiary
- History Page: View activity and changes over time
- Settings: Update apiary details or delete
lib/feature/apiaries/presentation/widgets/apiary_card.dart
Updating an Apiary
Modify apiary information at any time.
Implementation:
lib/feature/apiaries/presentation/pages/apiary_settings_page.dart
Deleting an Apiary
Use Cases
The apiaries feature implements the following operations:| Use Case | Purpose | Location |
|---|---|---|
CreateApiaryUseCase | Add a new apiary to the system | lib/feature/apiaries/domain/usecases/create_apiary_usecase.dart |
GetApiariesUseCase | Retrieve all apiaries for a user | lib/feature/apiaries/domain/usecases/get_apiaries.dart |
UpdateApiaryUseCase | Modify apiary information | lib/feature/apiaries/domain/usecases/update_apiary_usecase.dart |
DeleteApiaryUseCase | Remove an apiary and related data | lib/feature/apiaries/domain/usecases/delete_apiary_usecase.dart |
Apiary Dashboard Navigation
Once you select an apiary, you can navigate to specialized pages:Available Pages
-
Hives Page (
/apiaries/:id/hives)- View all beehives at this location
- Add new hives
- Update hive status
-
Inventory Page (
/apiaries/:id/inventory)- Manage equipment and supplies
- Track stock levels
- Monitor low inventory alerts
-
Reports Page (
/apiaries/:id/reports)- Generate production reports
- View historical data
- Export data for analysis
-
History Page (
/apiaries/:id/history)- Timeline of all activities
- Changes to hives and settings
- Inspection records
-
Settings Page (
/apiaries/:id/settings)- Update apiary details
- Manage permissions
- Delete apiary
lib/feature/apiaries/presentation/pages/
State Management
Apiary state is managed with Riverpod providers:- Loading apiaries from the backend
- Creating and updating apiaries
- Managing UI state (loading, errors)
- Caching apiary data
lib/feature/apiaries/presentation/controllers/apiaries_controller.dart
Data Flow
Softbee follows Clean Architecture patterns:lib/feature/apiaries/data/repositories/apiary_repository_impl.dart
Data Source: lib/feature/apiaries/data/datasources/apiary_remote_datasource.dart
UI Components
Apiary Menu
The apiary menu widget provides quick access to all apiary-related pages. Source:lib/feature/apiaries/presentation/widgets/apiaries_menu.dart
Apiary Form Dialog
A reusable form component for creating and editing apiaries with validation. Features:- Real-time validation
- Error message display
- Responsive layout
- Loading states
lib/feature/apiaries/presentation/widgets/apiary_form_dialog.dart
Treatment Tracking
Thetreatments boolean flag indicates whether the beekeeper applies medical or chemical treatments when bees are sick. This information is useful for:
- Organic certification tracking
- Treatment scheduling
- Regulatory compliance
- Production quality control
Organic beekeeping typically avoids synthetic treatments, so this flag helps distinguish between conventional and organic operations.
Integration with Other Features
Apiaries are the foundation for other Softbee features:- Beehives: Each hive belongs to exactly one apiary
- Inventory: Supplies are tracked per apiary
- Monitoring: Inspections and questions are scoped to apiaries
Best Practices
- Keep location information up to date for accurate records
- Review treatment settings regularly for compliance
- Delete unused apiaries to keep your dashboard clean
- Use the history page to track changes over time