{"id":47140646,"url":"https://github.com/ducks/beanledger","last_synced_at":"2026-04-20T23:01:22.099Z","repository":{"id":340813065,"uuid":"1167723687","full_name":"ducks/beanledger","owner":"ducks","description":"Production planner for specialty coffee roasters.","archived":false,"fork":false,"pushed_at":"2026-04-02T01:45:36.000Z","size":2895,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-02T03:56:18.890Z","etag":null,"topics":["coffee","nodejs","svelte"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ducks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-26T16:01:38.000Z","updated_at":"2026-04-02T01:45:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ducks/beanledger","commit_stats":null,"previous_names":["ducks/beanledger"],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/ducks/beanledger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducks%2Fbeanledger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducks%2Fbeanledger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducks%2Fbeanledger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducks%2Fbeanledger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ducks","download_url":"https://codeload.github.com/ducks/beanledger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducks%2Fbeanledger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32069440,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T21:26:33.338Z","status":"ssl_error","status_checked_at":"2026-04-20T21:26:22.081Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coffee","nodejs","svelte"],"created_at":"2026-03-12T22:02:27.789Z","updated_at":"2026-04-20T23:01:22.064Z","avatar_url":"https://github.com/ducks.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BeanLedger\n\nCoffee roaster production planner. Calculate batch requirements from orders.\n\n## Overview\n\nBeanLedger helps coffee roasters plan production:\n\n- Import orders from CSV (ShipStation, batch exports)\n- Manage roast groups (coffee families) and products (SKUs)\n- Track leftovers from previous roasts\n- Calculate green coffee needed and batches to roast\n- Generate pick lists for packaging\n\n## Data Model\n\n- **Roast Group**: Coffee family with shared roast profile (e.g. \"Sure Thing\", \"Nano Genji\")\n  - Batch type (standard 20.2lb, dark 19.8lb, decaf 10.73lb)\n  - Roast loss percentage\n  - Type (blend with components, or single origin)\n\n- **Product**: Individual SKU with bag size (e.g. \"Woodlawn Blend - 10oz\")\n  - Belongs to a roast group\n  - Weight in pounds\n\n- **Order**: Product + quantity\n\n- **Leftover**: Roasted coffee remaining per group\n\n## Workflow\n\n1. Import orders via CSV\n2. Orders aggregate by product → total pounds per roast group\n3. Subtract leftovers → needed green coffee\n4. Calculate batches to roast (accounting for roast loss)\n5. Predict new leftovers after roast\n\n## Tech Stack\n\n- **Frontend**: SvelteKit 5 (with runes)\n- **Backend**: SvelteKit server routes\n- **Database**: PostgreSQL\n- **Auth**: Session-based with scrypt password hashing\n- **Testing**: Vitest (14 tests covering core business logic)\n- **Deployment**: Node.js 22, NixOS service\n\n## Multi-Tenancy\n\nBeanLedger supports multiple roaster companies (tenants) with complete data isolation:\n- Each signup creates a new tenant\n- Users belong to a tenant\n- All data (roast groups, products, orders) is tenant-scoped\n- Composite primary keys allow tenants to use same IDs independently\n\n## Development\n\n```bash\n# Start PostgreSQL\ndocker compose up -d\n\n# Apply schema\ncat schema.sql | docker exec -i beanledger_db psql -U beanledger\n\n# Seed demo data (optional)\ncat seed.sql | docker exec -i beanledger_db psql -U beanledger\n\n# Install dependencies\npnpm install\n\n# Run dev server\npnpm dev\n\n# Run tests\npnpm test              # Run once\npnpm test:watch        # Watch mode\npnpm test:ui           # Interactive UI\n```\n\n## Recent Updates\n\n### 2026-03-21\n- ✅ **CSV Import Tracking** - Track imported orders separately from manual entries\n  - Import history shows filename, timestamp, and order count\n  - Delete individual imports to undo mistakes without affecting manual orders\n  - Production date picker restricted to today or earlier\n\n### 2026-03-01\n- ✅ **Roast Group CRUD UI** - Create, edit, delete roast groups via Catalog modal\n- ✅ **Product Edit UI** - Edit product name, weight, and roast group assignment\n- ✅ **Test Suite** - Vitest with 14 passing tests covering calc.ts business logic\n\n## TODO\n\n### Core Features\n- [x] CSV import tracking and selective deletion\n- [ ] Batch size overrides per tenant\n- [ ] Production date history/archive\n- [ ] Edit/delete orders UI\n- [ ] CSV export for pick lists\n- [ ] Multiple production dates view\n\n### Reports \u0026 Analytics\n- [ ] Roast schedule timeline\n- [ ] Green coffee inventory tracking\n- [ ] Historical production metrics\n- [ ] Cost tracking per roast\n\n### Auth \u0026 User Management\n- [ ] User roles (admin, team member, read-only)\n- [ ] Email verification\n- [ ] Password reset flow\n- [ ] Session timeout/renewal\n- [ ] Invite team members\n\n### Technical\n- [x] Migration scripts for schema changes\n- [ ] Database backup/restore\n- [ ] Error monitoring\n- [ ] Performance optimization for large catalogs\n- [ ] Mobile responsive design improvements\n- [ ] Additional test coverage (API endpoints, CSV parsing)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducks%2Fbeanledger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fducks%2Fbeanledger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducks%2Fbeanledger/lists"}