{"id":44802597,"url":"https://github.com/lelabdev/kassa","last_synced_at":"2026-02-16T13:35:52.409Z","repository":{"id":326655739,"uuid":"1106396938","full_name":"lelabdev/kassa","owner":"lelabdev","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-29T18:41:23.000Z","size":279,"stargazers_count":0,"open_issues_count":32,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-01T09:57:43.131Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/lelabdev.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":"docs/ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-29T06:51:53.000Z","updated_at":"2025-11-29T18:41:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lelabdev/kassa","commit_stats":null,"previous_names":["lelabdev/kassa"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/lelabdev/kassa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lelabdev%2Fkassa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lelabdev%2Fkassa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lelabdev%2Fkassa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lelabdev%2Fkassa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lelabdev","download_url":"https://codeload.github.com/lelabdev/kassa/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lelabdev%2Fkassa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29509202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: 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":[],"created_at":"2026-02-16T13:35:51.705Z","updated_at":"2026-02-16T13:35:52.404Z","avatar_url":"https://github.com/lelabdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kassa\n\nA mobile-first PWA (Progressive Web App) designed to simplify sales calculations and margin management for small fruit and vegetable vendors.\n\n## Features\n\n- 📱 **Mobile-First Design** - Optimized for small shops and street vendors with large, easy-to-tap icons\n- 🔢 **Real-Time Calculations** - Instant total calculations based on quantity, per-kilo pricing, and selling prices\n- 📊 **Margin Tracking** - Compare purchase vs. selling prices and calculate profit margins and percentages\n- 👥 **Multi-Client Management** - Handle multiple clients and orders simultaneously with easy switching\n- 📡 **Offline-First** - Full functionality without internet, powered by PouchDB\n- 🔄 **Data Sync** - Automatic synchronization when connection returns\n- 📈 **Sales History** - Track completed orders and visualize daily sales\n\n## Tech Stack\n\n| Category         | Technology                                                                            |\n| ---------------- | ------------------------------------------------------------------------------------- |\n| **Framework**    | [SvelteKit 2](https://kit.svelte.dev) + [Svelte 5](https://svelte.dev)                |\n| **Styling**      | [Tailwind CSS 4](https://tailwindcss.com) + [Skeleton Labs](https://www.skeleton.dev) |\n| **Database**     | [PouchDB](https://pouchdb.com) (IndexedDB-based, offline-sync ready)                  |\n| **Testing**      | [Vitest](https://vitest.dev) + [Playwright](https://playwright.dev)                   |\n| **Deployment**   | [Cloudflare Workers](https://workers.cloudflare.com)                                  |\n| **Language**     | [TypeScript](https://www.typescriptlang.org) 5 (strict mode)                          |\n| **Code Quality** | ESLint + Prettier                                                                     |\n\n## Getting Started\n\n### Prerequisites\n\n- **pnpm** (not npm or yarn) - [Installation guide](https://pnpm.io/installation)\n- Node.js 18+ (typically handled by pnpm)\n\n### Installation\n\n```bash\n# Install dependencies\npnpm install\n\n# Start development server\npnpm dev\n\n# Open in browser\npnpm dev -- --open\n```\n\nThe app will be available at `http://localhost:5173`\n\n## Development Commands\n\n### Running the App\n\n```bash\npnpm dev              # Start dev server with hot reload\npnpm build            # Build for production (Cloudflare)\npnpm preview          # Preview production build (port 4173)\n```\n\n### Testing\n\n```bash\npnpm test:unit        # Run unit tests (browser + server)\npnpm test:e2e         # Run end-to-end tests with Playwright\npnpm test             # Run all tests\n```\n\n### Code Quality\n\n```bash\npnpm lint             # Check ESLint and Prettier\npnpm format           # Auto-format code\npnpm check            # TypeScript checking (Svelte type safety)\npnpm check:watch      # Type checking in watch mode\n```\n\n## Project Structure\n\n```\nkassa/\n├── src/\n│   ├── routes/              # SvelteKit pages and layouts\n│   │   ├── +layout.svelte   # Root layout (imports Tailwind CSS)\n│   │   ├── +page.svelte     # Home page\n│   │   └── *.svelte.spec.ts # Component tests\n│   ├── lib/                 # Reusable utilities, stores, and components\n│   │   ├── assets/          # Static assets (favicon, etc.)\n│   │   └── index.ts         # Lib exports\n│   ├── app.d.ts             # TypeScript app definitions\n│   └── app.html             # HTML template\n├── e2e/                     # End-to-end tests (Playwright)\n├── vite.config.ts           # Vitest and Vite configuration\n├── svelte.config.js         # SvelteKit configuration\n├── tsconfig.json            # TypeScript configuration (strict mode)\n├── eslint.config.js         # ESLint rules\n├── .prettierrc              # Prettier formatting rules\n└── package.json             # Dependencies and scripts\n```\n\n## PouchDB Setup Guide\n\n### Basic Initialization\n\n```typescript\n// src/lib/db.ts\nimport PouchDB from 'pouchdb';\n\nexport const db = new PouchDB('kassa-local');\n\n// For data structure\nexport interface Product {\n\t_id?: string;\n\t_rev?: string;\n\ttype: 'product';\n\tname: string;\n\tprice_per_unit: number; // purchase price\n\tunit: string; // kg, piece, etc.\n}\n\nexport interface Order {\n\t_id?: string;\n\t_rev?: string;\n\ttype: 'order';\n\tclient_name: string;\n\titems: OrderItem[];\n\ttotal_amount: number;\n\tcreated_at: Date;\n}\n```\n\n### Querying Data\n\n```typescript\n// Get all documents of a type\nconst products = await db.allDocs({\n\tinclude_docs: true,\n\tkey: 'product'\n});\n\n// Query with Mango (if using pouchdb-find)\nconst orders = await db.find({\n\tselector: { type: 'order', created_at: { $gte: startDate } }\n});\n```\n\n### Syncing with Backend (Optional)\n\n```typescript\n// Sync with CouchDB server\ndb.sync('https://your-couchdb-server/kassa', {\n\tlive: true,\n\tretry: true\n});\n```\n\n## Code Style\n\n- **Indentation**: Tabs (not spaces)\n- **Quotes**: Single quotes\n- **Line Length**: 100 characters max\n- **TypeScript**: Strict mode - no `any` types (use proper interfaces)\n- **Svelte 5**: Uses Runes (`$state`, `$derived`, `$effect`) instead of legacy syntax\n\n## Testing\n\nThe project uses a dual-environment testing setup:\n\n1. **Client Tests** (`*.svelte.spec.ts`) - Browser-based component tests\n   - Run in Chromium via Playwright\n   - For testing Svelte components and UI logic\n\n2. **Server Tests** (`*.spec.ts`) - Node.js environment tests\n   - For testing utilities, helpers, and business logic\n   - Database queries and PouchDB operations\n\n**All tests require at least one assertion** (`expect.requireAssertions: true`).\n\n## Deployment\n\n### Build for Cloudflare\n\n```bash\npnpm build\n```\n\nThis creates an optimized build compatible with Cloudflare Workers.\n\n### Preview Before Deploying\n\n```bash\npnpm preview\n```\n\nThe preview server runs on `http://localhost:4173`\n\n## Features in Progress\n\n- [ ] Sales history with daily summaries\n- [ ] Data analysis and trend visualization\n- [ ] Multi-device synchronization (via PouchDB replication)\n- [ ] Export sales data (CSV, PDF)\n- [ ] Inventory tracking\n\n## Browser Support\n\n- Chrome/Chromium (latest)\n- Firefox (latest)\n- Safari (latest)\n- Edge (latest)\n\nRequires IndexedDB support for PouchDB offline storage.\n\n## Contributing\n\nWhen contributing:\n\n1. Run `pnpm lint` to check code quality\n2. Run `pnpm test` to ensure tests pass\n3. Use `pnpm format` for consistent formatting\n4. Follow the project structure and naming conventions\n\n## Documentation\n\n- See `CLAUDE.md` for development guidelines and architecture notes\n- See `docs/brief.md` for project requirements and vision\n\n## License\n\n**AGPL-3.0** - Open Source License\n\nThis project is free to use, modify, and distribute. See [LICENSE](https://www.gnu.org/licenses/agpl-3.0.txt) for details.\n\n## About\n\n**Kassa** is an open-source project created by [ludoloops](https://lelab.dev) at [Lelab](https://lelab.dev).\n\nBuilt in the Philippines, for Filipino vendors and small business owners (Pinoy merchants) who want to simplify their sales operations without relying on expensive POS systems.\n\n## Support\n\nFor issues or feature requests, please check the project documentation or contact the development team.\n\n---\n\n**Built with ❤️ by ludoloops @ Lelab for Filipino small vendors**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flelabdev%2Fkassa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flelabdev%2Fkassa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flelabdev%2Fkassa/lists"}