A simple, native GTK4 coffee beans and water ratio calculator for Linux desktop applications.
- Multiple Brewing Methods: Supports Espresso, Pour Over, French Press, and AeroPress
- Bidirectional Calculation: Enter either coffee or water amount, and the other is automatically calculated
- Unit Systems: Switch between Metric (grams/ml) and Imperial (ounces/fl oz) units
- Native GTK4: Built with GTKx for a native Linux desktop experience
- Adwaita Design: Follows GNOME Human Interface Guidelines for a modern, consistent UI
First, build the Flatpak bundle:
# Build the Flatpak bundle
pnpm build:flatpakThis creates dist/io.github.tduarte.cafe.flatpak. Then install and run:
# Install from local bundle
flatpak install --user dist/io.github.tduarte.cafe.flatpak
# Run the application
flatpak run io.github.tduarte.cafeSee FLATPAK.md for detailed Flatpak build and deployment instructions.
- Node.js 22 or later
- pnpm
- Rust toolchain (for building native dependencies)
- GTK4 development libraries
- Libadwaita development libraries
# Clone the repository
git clone https://github.com/tduarte/cafe.git
cd cafe/examples/coffee-calculator
# Install dependencies
pnpm install
# Build the application
pnpm build
# Run in development mode
pnpm dev
# Run the production build
pnpm start- Select a Brewing Method: Choose from Espresso, Pour Over, French Press, or AeroPress
- Enter Amount: Type either the coffee amount or water amount
- View Result: The corresponding amount is automatically calculated and displayed
- Change Units: Open Preferences (Ctrl+,) to switch between Metric and Imperial units
- Espresso: 1:2 (coffee:water)
- Pour Over: 1:15
- French Press: 1:12
- AeroPress: 1:11
coffee-calculator/
├── src/
│ ├── app.tsx # Main application component
│ ├── index.tsx # Production entry point
│ ├── dev.tsx # Development entry point
│ └── utils/
│ └── calculations.ts # Calculation logic and unit conversions
├── flatpak/ # Flatpak packaging files
├── scripts/ # Build scripts
└── assets/ # Application assets (icons, etc.)
# Build TypeScript
pnpm build
# Bundle JavaScript
pnpm bundle
# Build Flatpak
pnpm build:flatpakSee FLATPAK.md for detailed Flatpak deployment instructions.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the GNU General Public License v3.0 (GPL-3.0) - see the LICENSE file for details.
- Built with GTKx - Build native GTK4 desktop applications with React and TypeScript
- Uses Adwaita design system for GNOME applications
Thiago Duarte
- GitHub: @tduarte
