Overview
Discover what makes Grocy powerful
Grocy is a self‑hosted, web‑based ERP system focused on household resource planning. From a developer’s standpoint it is a lightweight PHP application that exposes a rich REST‑like API, enabling integration with mobile apps, smart home devices, or custom dashboards. The core business logic is written in modern PHP 8.x, leveraging Composer for dependency management and Yarn for front‑end assets. The application is deliberately minimalistic—no heavyweight frameworks—to keep the codebase approachable while still offering a full feature set for grocery, pantry, and household inventory management.
Inventory & Stock Management
Shopping & Recipe Automation
Barcode Integration
API & Webhooks
Overview
Grocy is a self‑hosted, web‑based ERP system focused on household resource planning. From a developer’s standpoint it is a lightweight PHP application that exposes a rich REST‑like API, enabling integration with mobile apps, smart home devices, or custom dashboards. The core business logic is written in modern PHP 8.x, leveraging Composer for dependency management and Yarn for front‑end assets. The application is deliberately minimalistic—no heavyweight frameworks—to keep the codebase approachable while still offering a full feature set for grocery, pantry, and household inventory management.
Key Features
- Inventory & Stock Management – CRUD operations for products, batches, and storage locations; support for expiry dates, quantity units, and minimum stock thresholds.
- Shopping & Recipe Automation – Automatic shopping list generation based on recipes and current stock; intelligent “due score” calculations to prioritize items.
- Barcode Integration – Web‑camera or external barcode scanners can trigger product lookups via the built‑in Open Food Facts integration, and any additional services can be added through a plugin system.
- API & Webhooks – A comprehensive JSON‑based API exposes all CRUD endpoints; developers can hook into events (e.g., product added, batch expiring) via configurable webhooks or an internal event bus.
Technical Stack
| Layer | Technology |
|---|---|
| Backend | PHP 8.2/8.3, PDO with SQLite (default) or MySQL/PostgreSQL via Composer packages |
| Frontend | Vanilla JS + Alpine.js, CSS with Tailwind-like utility classes; assets bundled by Yarn |
| Persistence | SQLite for lightweight deployments; full‑featured RDBMS options available |
| Web Server | Apache/Nginx (requires URL rewriting or DISABLE_URL_REWRITING), optional Docker image (linuxserver/grocy) |
| Extensions | Plugin architecture (PHP classes implementing Grocy\PluginInterface), external services via HTTP clients |
The application follows a conventional MVC pattern but eschews heavy frameworks like Laravel in favor of hand‑rolled routing and service containers. This design choice keeps the binary size small (≈ 50 MB for Docker) and speeds up deployment while still allowing developers to inject custom services or override core behavior.
Core Capabilities & API
- RESTful Endpoints –
GET /api/products,POST /api/shoppinglist, etc., with authentication via session or token. - Event Bus – Internal events (
product.created,batch.expiring) can be listened to by plugins or external services. - Webhooks – Configurable URLs that receive JSON payloads on specific events, enabling integrations with Home Assistant, IFTTT, or custom microservices.
- CLI Utilities – Artisan‑style commands (
grocy:import-csv,grocy:update) can be executed in a Docker container or via SSH for automation scripts.
Deployment & Infrastructure
- Self‑Hosting – Requires a PHP 8.x runtime, SQLite (or any PDO‑compatible DB), and a web server with URL rewriting.
- Containerization – Official Docker image ships with pre‑configured Nginx, PHP-FPM, and SQLite; persistent data is stored in a bind mount (
/configfor settings,/datafor the database). - Scalability – While SQLite is sufficient for most households, switching to MySQL/PostgreSQL allows horizontal scaling; the API remains stateless, so multiple containers can be load‑balanced behind a reverse proxy.
- Backup & Restore – The
datadirectory is the single source of truth; backup scripts or Docker volumes can be used for disaster recovery.
Integration & Extensibility
- Plugin System – Developers can create PHP plugins that register routes, modify the UI via Twig templates, or add new API endpoints.
- External Services – Barcode lookups can be extended to any REST API; the plugin interface allows adding new services without touching core code.
- Webhooks & Scripting – Trigger custom scripts on events (e.g., send an email when a product is about to expire).
- Custom UI – The front‑end is modular; developers can replace or augment components with React/Vue if desired, as the API remains stable.
Developer Experience
- Configuration – A single
config.phpfile holds all runtime settings; defaults are documented inconfig-dist.php. - Documentation – The README, website API docs, and inline PHPDoc provide clear guidance; community resources (Reddit, GitHub issues) are active.
- Community & Plugins – A growing ecosystem of add‑ons (e.g., Home Assistant integration, barcode services) demonstrates the platform’s extensibility.
- Licensing – Open‑source under MIT, encouraging commercial or internal use without license fees.
Use Cases
| Scenario | How Grocy Helps |
|---|---|
| Home Automation | Expose inventory levels to Home Assistant; trigger smart shopping lists when a product drops below threshold. |
| Mobile App Development | Build a native iOS/Android app that consumes Grocy’s API for on‑the‑go grocery management. |
| Enterprise‑Scale Household | Deploy with PostgreSQL for multiple households, using Docker Compose to isolate data while sharing a common API layer. |
| Custom Dashboards | Integrate with Grafana or custom BI tools to visualize stock turnover, waste metrics, and shopping patterns. |
Advantages Over Alternatives
- **Performance
Open SourceReady to get started?
Join the community and start self-hosting Grocy 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
Coder
Self‑hosted cloud dev environments that spin up instantly
OpenCanary
Low‑resource network honeypot that alerts on intrusions
Flare
Lightning-fast, self-hosted file sharing with screenshot integration
Xandikos
Self-hosted other
Fusion
Lightweight RSS aggregator and reader
HAProxy
High‑performance TCP/HTTP load balancer for reliable scaling