Overview
Discover what makes What to Cook? powerful
What To Cook? is a lightweight, self‑hosted recipe recommendation engine that tailors suggestions to the ingredients you currently have. From a developer’s standpoint, it is essentially a stateless service that exposes a small REST API for querying recipes and managing ingredient inventories. The application runs in a Docker container, making it straightforward to deploy behind reverse proxies or orchestrated with Kubernetes. The core logic is written in Go, leveraging the language’s static compilation and efficient concurrency model to keep resource usage low even under load.
Language & Runtime
Web Framework
Persistence
Data Model
Overview
What To Cook? is a lightweight, self‑hosted recipe recommendation engine that tailors suggestions to the ingredients you currently have. From a developer’s standpoint, it is essentially a stateless service that exposes a small REST API for querying recipes and managing ingredient inventories. The application runs in a Docker container, making it straightforward to deploy behind reverse proxies or orchestrated with Kubernetes. The core logic is written in Go, leveraging the language’s static compilation and efficient concurrency model to keep resource usage low even under load.
Technical Stack
- Language & Runtime: Go 1.22 (or newer) – the entire codebase is a single binary, which simplifies deployment and eliminates runtime dependencies.
- Web Framework: Standard
net/httpwith minimal routing (gorilla/mux) for a clean, dependency‑free API surface. - Persistence: SQLite by default (file‑based) for ease of setup; the code also contains a PostgreSQL driver, allowing scaling to larger deployments.
- Data Model: Relational schema with tables for
recipes,ingredients, and a many‑to‑many join table (recipe_ingredients). The schema is generated viago generateand can be migrated with the built‑in CLI. - Testing: Go’s
testingpackage plushttptestfor integration tests; test data is stored in an in‑memory SQLite instance.
Core Capabilities
- Recipe Suggestion API:
GET /suggestaccepts a comma‑separated list of available ingredients and returns the top matching recipes, ranked by ingredient overlap. - Ingredient CRUD: Endpoints for adding, updating, and deleting ingredients (
/ingredients), allowing dynamic inventory management. - Recipe Management: Full CRUD on recipes, including nested ingredient lists; supports tags and metadata for richer queries.
- Search & Filtering: Query parameters support filtering by cuisine, cooking time, and dietary restrictions.
- Webhooks: Optional POST webhook support to notify external services when a new recipe is suggested or added.
Architecture & Deployment
The application follows a classic client‑server architecture: the Go server serves JSON over HTTP, while clients (web UI or mobile) consume these endpoints. Deployment is container‑centric:
- Docker: A single
Dockerfilebuilds a stateless image; the repository includes a ready‑to‑usedocker-compose.ymlthat maps volumes for persistence and environment variables for configuration. - Kubernetes: Helm charts are not provided out of the box, but the container image is fully compatible with any OCI‑compliant orchestrator. StatefulSets can be used if PostgreSQL persistence is desired.
- Scalability: Because the service is stateless, horizontal scaling is trivial—just spin up more replicas behind a load balancer. SQLite limits scaling to single‑node writes; switching to PostgreSQL removes this constraint.
Integration & Extensibility
- Plugin System: The core is intentionally minimal, but developers can extend functionality by embedding the Go package into their own services. The
apipackage exposes all handlers as functions, making it easy to mount additional routes. - External APIs: The project ships a simple CLI that can fetch recipes from public sources (e.g., Spoonacular) and populate the local database, enabling hybrid data stores.
- Webhooks & Callbacks: Custom webhook URLs can be configured via environment variables, allowing integration with CI/CD pipelines or home‑automation systems.
- OpenAPI Spec: The API is documented with Swagger/OpenAPI, facilitating automatic client generation in any language.
Developer Experience
- Configuration: All settings are environment‑based (
PORT,DATABASE_URL,WEBHOOK_URL), which aligns with Twelve‑Factor app principles. - Documentation: The README provides clear instructions for Docker Compose, and the source code is heavily commented. A separate
docs/folder contains the OpenAPI spec and migration scripts. - Community & Support: The project is hosted on GitHub with an active issue tracker. While the community is small, contributors are welcomed and pull requests are merged quickly.
Use Cases
- Smart Kitchen Dashboards: Embed the API into a Raspberry Pi‑based kitchen display to show daily recipe suggestions based on pantry inventory.
- Meal‑Planning Platforms: Integrate with existing meal‑planning tools to enrich recipe recommendations without duplicating data.
- IoT Automation: Trigger smart fridges or voice assistants when a new recipe is suggested, leveraging the webhook system.
- Educational Projects: Use the Go codebase as a teaching example for building RESTful services with minimal dependencies.
Advantages
- Performance: Go’s compiled binaries and efficient concurrency make the service fast even with thousands of recipes.
- Simplicity: A single Docker image and a SQLite database mean zero external dependencies for small deployments.
- Licensing: The MIT license allows unrestricted use, modification, and redistribution—ideal for commercial or open‑source projects.
- Extensibility: The API is intentionally small and well‑documented, enabling developers to build custom clients or extend the server with minimal friction.
What To Cook? offers a solid, production‑ready foundation for any developer looking to add intelligent recipe recommendation capabilities to their self
Open SourceReady to get started?
Join the community and start self-hosting What to Cook? today
Related Apps in other
Immich
Self‑hosted photo and video manager
Syncthing
Peer‑to‑peer file sync, no central server
Strapi
Open-source headless CMS for modern developers
reveal.js
Create stunning web‑based presentations with HTML, CSS and JavaScript
Stirling-PDF
Local web PDF editor with split, merge, convert and more
MinIO
Fast, S3-compatible object storage for AI and analytics
Weekly Views
Repository Health
Information
Explore More Apps
Dashpress
Generate admin dashboards from your database instantly
Espial
Self‑hosted web bookmark manager
Mainsail
Lightweight web UI for Klipper printers
Akkoma
Decentralized microblogging for the fediverse
Svix
Enterprise‑ready webhook delivery and management
Dashy
Central hub for self-hosted services