A mobile-first PWA (Progressive Web App) designed to simplify sales calculations and margin management for small fruit and vegetable vendors.
- π± Mobile-First Design - Optimized for small shops and street vendors with large, easy-to-tap icons
- π’ Real-Time Calculations - Instant total calculations based on quantity, per-kilo pricing, and selling prices
- π Margin Tracking - Compare purchase vs. selling prices and calculate profit margins and percentages
- π₯ Multi-Client Management - Handle multiple clients and orders simultaneously with easy switching
- π‘ Offline-First - Full functionality without internet, powered by PouchDB
- π Data Sync - Automatic synchronization when connection returns
- π Sales History - Track completed orders and visualize daily sales
| Category | Technology |
|---|---|
| Framework | SvelteKit 2 + Svelte 5 |
| Styling | Tailwind CSS 4 + Skeleton Labs |
| Database | PouchDB (IndexedDB-based, offline-sync ready) |
| Testing | Vitest + Playwright |
| Deployment | Cloudflare Workers |
| Language | TypeScript 5 (strict mode) |
| Code Quality | ESLint + Prettier |
- pnpm (not npm or yarn) - Installation guide
- Node.js 18+ (typically handled by pnpm)
# Install dependencies
pnpm install
# Start development server
pnpm dev
# Open in browser
pnpm dev -- --openThe app will be available at http://localhost:5173
pnpm dev # Start dev server with hot reload
pnpm build # Build for production (Cloudflare)
pnpm preview # Preview production build (port 4173)pnpm test:unit # Run unit tests (browser + server)
pnpm test:e2e # Run end-to-end tests with Playwright
pnpm test # Run all testspnpm lint # Check ESLint and Prettier
pnpm format # Auto-format code
pnpm check # TypeScript checking (Svelte type safety)
pnpm check:watch # Type checking in watch modekassa/
βββ src/
β βββ routes/ # SvelteKit pages and layouts
β β βββ +layout.svelte # Root layout (imports Tailwind CSS)
β β βββ +page.svelte # Home page
β β βββ *.svelte.spec.ts # Component tests
β βββ lib/ # Reusable utilities, stores, and components
β β βββ assets/ # Static assets (favicon, etc.)
β β βββ index.ts # Lib exports
β βββ app.d.ts # TypeScript app definitions
β βββ app.html # HTML template
βββ e2e/ # End-to-end tests (Playwright)
βββ vite.config.ts # Vitest and Vite configuration
βββ svelte.config.js # SvelteKit configuration
βββ tsconfig.json # TypeScript configuration (strict mode)
βββ eslint.config.js # ESLint rules
βββ .prettierrc # Prettier formatting rules
βββ package.json # Dependencies and scripts
// src/lib/db.ts
import PouchDB from 'pouchdb';
export const db = new PouchDB('kassa-local');
// For data structure
export interface Product {
_id?: string;
_rev?: string;
type: 'product';
name: string;
price_per_unit: number; // purchase price
unit: string; // kg, piece, etc.
}
export interface Order {
_id?: string;
_rev?: string;
type: 'order';
client_name: string;
items: OrderItem[];
total_amount: number;
created_at: Date;
}// Get all documents of a type
const products = await db.allDocs({
include_docs: true,
key: 'product'
});
// Query with Mango (if using pouchdb-find)
const orders = await db.find({
selector: { type: 'order', created_at: { $gte: startDate } }
});// Sync with CouchDB server
db.sync('https://your-couchdb-server/kassa', {
live: true,
retry: true
});- Indentation: Tabs (not spaces)
- Quotes: Single quotes
- Line Length: 100 characters max
- TypeScript: Strict mode - no
anytypes (use proper interfaces) - Svelte 5: Uses Runes (
$state,$derived,$effect) instead of legacy syntax
The project uses a dual-environment testing setup:
-
Client Tests (
*.svelte.spec.ts) - Browser-based component tests- Run in Chromium via Playwright
- For testing Svelte components and UI logic
-
Server Tests (
*.spec.ts) - Node.js environment tests- For testing utilities, helpers, and business logic
- Database queries and PouchDB operations
All tests require at least one assertion (expect.requireAssertions: true).
pnpm buildThis creates an optimized build compatible with Cloudflare Workers.
pnpm previewThe preview server runs on http://localhost:4173
- Sales history with daily summaries
- Data analysis and trend visualization
- Multi-device synchronization (via PouchDB replication)
- Export sales data (CSV, PDF)
- Inventory tracking
- Chrome/Chromium (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
Requires IndexedDB support for PouchDB offline storage.
When contributing:
- Run
pnpm lintto check code quality - Run
pnpm testto ensure tests pass - Use
pnpm formatfor consistent formatting - Follow the project structure and naming conventions
- See
CLAUDE.mdfor development guidelines and architecture notes - See
docs/brief.mdfor project requirements and vision
AGPL-3.0 - Open Source License
This project is free to use, modify, and distribute. See LICENSE for details.
Kassa is an open-source project created by ludoloops at Lelab.
Built 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.
For issues or feature requests, please check the project documentation or contact the development team.
Built with β€οΈ by ludoloops @ Lelab for Filipino small vendors