README: - Added prominent live demo banner at the top with links to https://evershelfproject.dadaloop.it/demo and project website Wiki (docs/wiki/): - Home.md — overview, table of contents, what's new - Installation.md — Docker, Apache, Nginx, HTTPS, cron, backup - Configuration.md — full .env reference, settings UI, rate limits - Features.md — complete feature documentation - API-Reference.md — all REST endpoints with params/responses - Android-Kiosk.md — setup wizard, permissions, troubleshooting - Scale-Gateway.md — BLE protocol, setup, troubleshooting - Translations.md — how to add/edit language files - Contributing.md — dev workflow, branch strategy, CI, code style - FAQ.md — common issues and solutions
4.0 KiB
🤝 Contributing
Contributions of all kinds are welcome — bug fixes, new features, translations, documentation improvements.
Getting Started
1. Fork and clone
git clone https://github.com/YOUR_USERNAME/EverShelf.git
cd EverShelf
2. Create a branch
git checkout -b feature/my-feature
# or
git checkout -b fix/my-bug-fix
3. Set up a local server
# Option A: PHP built-in server
php -S localhost:8080
# Option B: Docker
docker compose up -d
Open http://localhost:8080 in your browser.
4. Make your changes
The app has no build step. Edit files directly and refresh the browser.
Key files:
assets/js/app.js— all frontend logicassets/css/style.css— all stylesapi/index.php— all API endpointsapi/database.php— SQLite schema and migrationstranslations/*.json— i18n strings
5. Test
# Check PHP syntax
php -l api/index.php
php -l api/database.php
# Check JS syntax
node --check assets/js/app.js
There are no automated JS tests yet — manual testing in the browser is the current approach. If you add a feature, test the full flow: add, use, undo.
6. Commit
Use Conventional Commits:
git commit -m "feat(inventory): add bulk delete"
git commit -m "fix(scale): handle BLE disconnect during countdown"
git commit -m "docs: update kiosk setup guide"
git commit -m "chore: bump version to 1.8.0"
Types: feat, fix, docs, style, refactor, test, chore
Scopes: inventory, ai, shopping, cooking, scale, kiosk, gateway, webapp, api, db
7. Push and open a PR
git push origin feature/my-feature
Open a Pull Request against the develop branch (not main).
Branch Strategy
| Branch | Purpose |
|---|---|
main |
Production — auto-deployed, never commit directly |
develop |
Integration branch — all PRs target here |
feature/* |
New features |
fix/* |
Bug fixes |
CI auto-merges develop → main on every push to develop.
CI / CD Pipeline
GitHub Actions runs on every push to develop and main:
- PHP lint —
php -lon all PHP files - JS syntax check —
node --check assets/js/app.js - Translation validation — checks that all language files have the same keys
- Docker build — verifies the Docker image builds successfully
- Android build — (on tagged commits) builds Kiosk and Scale Gateway APKs
Adding Translations
See the full guide in Translations.
Short version:
- Copy
translations/it.json→translations/xx.json - Translate all values
- Add
'xx'toSUPPORTED_LANGUAGESinapp.js - Open a PR
Reporting Bugs
Open an issue on GitHub. Include:
- Steps to reproduce
- Expected vs. actual behaviour
- Browser/OS version
- Any console errors (F12 → Console)
Code Style
- PHP: PSR-12, 4-space indent, type hints where practical
- JavaScript: ES2020+,
async/await, no frameworks, 4-space indent - CSS: BEM-ish class names, CSS custom properties for theming
- SQL: parameterized queries (PDO), no raw string interpolation
Adding a New API Endpoint
- Add a
case 'my_action':to the router inapi/index.php - Implement
function myAction(PDO $db): void - Add the endpoint to
docs/openapi.yaml - Add translations for any new UI strings to all 3 language files
Security
If you find a security vulnerability, do not open a public issue. Email evershelfproject@gmail.com directly.
Relevant resources:
- OWASP Top 10
- All SQL must use PDO prepared statements
- Never expose API keys in API responses (boolean flags only)
- Use
hash_equals()for token comparison
License
By contributing you agree that your code will be licensed under the MIT License.