Skip to content

vijayg10/openvyapar

Repository files navigation

OpenVyapar

Open-source Point of Sale for Modern Retail

Multi-tenant POS system built with React, Express, and PostgreSQL — designed for small to medium retail businesses that need fast billing, inventory tracking, and a central admin dashboard.


Overview

OpenVyapar is a full-stack, multi-tenant Point of Sale platform. Each tenant gets an isolated storefront with its own products, customers, and orders — all managed from a shared admin panel.

Key capabilities:

  • Fast billing — barcode scanning, cart management, and receipt generation at the POS terminal
  • Inventory management — track stock levels, set reorder thresholds, and manage product categories
  • Customer management — maintain customer profiles, purchase history, and loyalty data
  • Multi-store support — a single admin console manages multiple store locations and tenants
  • Reporting — sales summaries, top products, and revenue trends out of the box
  • Monitoring — optional Prometheus + Grafana stack for operational visibility

Project Structure

packages/
  backend/          Express API server (port 4000) + Admin API (port 5001)
  frontend/         React POS frontend (port 5173)
  admin-frontend/   React admin dashboard (port 3001)
e2e/                Playwright end-to-end tests

Tech Stack

Layer Technology
Frontend React 18, TypeScript, Vite, Tailwind CSS
Backend Node.js, Express, TypeScript
Database PostgreSQL 16
ORM / Migrations Knex.js
Testing Vitest (unit), Playwright (E2E)
Dev infra Docker Compose, pnpm workspaces
Monitoring Prometheus, Grafana

Prerequisites

  • Node.js >= 20
  • pnpm 10.x
  • Docker (for PostgreSQL)

Quickstart

1. Install dependencies

pnpm install

2. Start PostgreSQL

docker compose up -d

This starts a PostgreSQL 16 instance on port 5432 with default credentials (user/password/pos_db).

3. Configure environment

cp packages/backend/.env.example packages/backend/.env

The defaults work out of the box with the Docker Compose setup.

4. Run database migrations and seed data

pnpm migrate
pnpm seed

5. Start all services

pnpm dev

This starts the backend API, POS frontend, and admin frontend in parallel:

Service URL
POS Frontend http://localhost:5173
Admin Frontend http://localhost:3001
Backend API http://localhost:4000
Admin API http://localhost:5001

Scripts

Command Description
pnpm dev Start all services in dev mode
pnpm build Build all packages
pnpm test Run unit tests
pnpm test:e2e Run Playwright E2E tests
pnpm lint Lint all packages
pnpm migrate Run database migrations
pnpm migrate:rollback Rollback all migrations
pnpm seed Seed the database

Monitoring (optional)

docker compose --profile monitoring up -d

This adds Prometheus (http://localhost:9090) and Grafana (http://localhost:3000, admin/admin).

About

Opensource POS for India

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages