BeerStat is a Flask-based web application designed to track beer donations. The application provides RESTful endpoints for recording donations and retrieving balance information.
- Python 3.12+
- UV package manager
make devmkdir -p instance
uv run flask db upgradeuv run python run.pyuv run python beer_consumer.pyRecords a new donation.
Request Body:
{
"date": "2023-12-01T10:00:00",
"value": 100.5,
"name": "Donor Name"
}Response:
{
"message": "Success"
}Retrieves the total sum of all donations.
Response:
{
"Total": 1500.75
}The application includes a comprehensive test suite. To run the tests:
# Run all tests
make test
# Run tests with verbose output
make test-devThe tests are located in the tests/ directory and cover:
- Basic endpoint functionality
- Data validation
- Database operations
- Integration testing