Mastrena 3.0 is an espresso machine simulation system built with Rust. This project provides a RESTful API to simulate espresso extraction processes with customizable parameters such as temperature, pressure, and extraction time. The system also records extraction metrics for future analysis.
- Espresso Extraction Simulation: Simulates the brewing process with adjustable settings.
- Customizable Parameters: Users can define temperature, pressure, and extraction time.
- Validation Mechanism: Ensures input values fall within realistic ranges.
- Metrics Storage: Records extraction data in JSON format for future reference.
- REST API: Provides endpoints to start an extraction and retrieve past records.
To set up Mastrena 3.0, follow these steps:
-
Clone the repository:
git clone https://github.com/beltradini/mastrena-3.0.git cd mastrena-3.0
-
Install Rust (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Build and run the project:
cargo run
POST /start
Query Parameters:
temperature
(optional, default: 93.0°C)pressure
(optional, default: 9.0 bar)time_seconds
(optional, default: 25s)
Example:
curl -X POST "http://127.0.0.1:3000/start?temperature=95&pressure=9.5&time_seconds=27"
GET /metrics
Example:
curl -X GET "http://127.0.0.1:3000/metrics"
- Implement a database for better storage and retrieval of metrics.
- Add support for different espresso recipes.
- Enhance error handling and logging.
- Expand API functionalities with additional beverage simulations.
Mastrena 3.0 is released under the MIT License.