Skip to content

Ledger is a web app designed for shops and shopkeepers to manage their daily operations efficiently.

License

Notifications You must be signed in to change notification settings

Priyans-hu/ledger

Ledger Logo

Ledger - Shop Management System

A modern, open-source shop management solution for small businesses in India

CI Status License Stars Forks Issues

FeaturesQuick StartDocumentationContributing


Why Ledger?

Managing a small shop shouldn't require expensive software or complex systems. Ledger is built specifically for Indian small business owners who need:

  • Simple billing with GST-compliant invoices
  • Customer tracking to build relationships
  • Expense management to understand where money goes
  • Visual analytics to make better business decisions

All in a modern, easy-to-use web application that works on any device.

Features

Customer Management

  • Add, edit, and delete customers with detailed profiles
  • Search and filter customers instantly
  • Track purchase history and total spending per customer
  • Pagination for handling large customer lists

Transaction Tracking

  • Record credits (income) and debits (expenses)
  • Categorize expenses: rent, utilities, salary, marketing, inventory, and more
  • Filter transactions by date, month, year, or category
  • Export transactions to CSV for spreadsheet analysis

GST Invoice Generation

  • Create professional GST-compliant invoices
  • Add multiple line items with quantity and pricing
  • Automatic tax calculations with configurable tax rates
  • Apply discounts (percentage or fixed amount)
  • Export invoices as PDF documents
  • Track invoice status: draft, sent, paid, cancelled

Dashboard Analytics

  • Visual charts showing monthly revenue trends
  • Credit vs. debit breakdown with pie charts
  • Expense category analysis
  • Quick stats: total customers, transactions, revenue

Security & Authentication

  • Secure JWT-based authentication
  • Password hashing with bcrypt
  • Rate limiting to prevent abuse
  • Protected API routes

Tech Stack

React
React 18
Node.js
Node.js
Express
Express
PostgreSQL
PostgreSQL
Tailwind
Tailwind
Docker
Docker
Layer Technologies
Frontend React 18, Material-UI 5, Tailwind CSS 3, Chart.js, Formik + Yup
Backend Node.js 20, Express 4, PostgreSQL 16
Security Helmet, Express Rate Limit, bcryptjs, JWT
DevOps Docker, Docker Compose, GitHub Actions

Quick Start

Option 1: Docker (Recommended)

# Clone the repository
git clone https://github.com/Priyans-hu/ledger.git
cd ledger

# Start all services
docker-compose up -d

# Access the app
open http://localhost:3000

Option 2: Manual Setup

Prerequisites

  • Node.js 20+
  • PostgreSQL 16+
  • npm 10+

1. Clone & Setup Database

git clone https://github.com/Priyans-hu/ledger.git
cd ledger

# Create database
psql -c "CREATE DATABASE ledger;"

2. Setup Backend

cd server
cp .env.example .env
# Edit .env with your database credentials
npm install
npm run db:setup  # Creates tables
npm run dev

3. Setup Frontend

cd client
cp .env.example .env
npm install
npm start

The app will be available at http://localhost:3000

Project Structure

ledger/
├── client/                     # React frontend
│   ├── src/
│   │   ├── api/               # API client modules
│   │   ├── components/        # Reusable UI components
│   │   │   └── landing/       # Landing page sections
│   │   ├── context/           # React context providers
│   │   ├── pages/             # Page components
│   │   └── types/             # TypeScript type definitions
│   ├── Dockerfile
│   └── package.json
├── server/                     # Express backend
│   ├── config/                # Database and app config
│   ├── controllers/           # Route handlers
│   ├── middleware/            # Auth, validation, rate limiting
│   ├── models/                # PostgreSQL table schemas
│   ├── routes/                # API route definitions
│   ├── types/                 # JSDoc type definitions
│   ├── __tests__/             # Test files
│   ├── Dockerfile
│   └── package.json
├── docker-compose.yml          # Docker orchestration
└── .github/workflows/          # CI/CD pipeline

Documentation

Environment Variables

Server Configuration
Variable Description Default
PORT Server port 5000
DB_HOST PostgreSQL host localhost
DB_PORT PostgreSQL port 5432
DB_USER Database user -
DB_PASSWORD Database password -
DB_NAME Database name ledger
JWT_SECRET JWT signing secret (required) -
JWT_EXPIRY Token expiration time 24h
NODE_ENV Environment development
Client Configuration
Variable Description Default
REACT_APP_API_URL Backend API URL http://localhost:5000/api

API Reference

Authentication Endpoints
Method Endpoint Description
POST /api/store/register Register new store
POST /api/store/login Login and get token
GET /api/store/profile Get store profile
PUT /api/store/profile Update profile
PUT /api/store/change-password Change password
Customer Endpoints
Method Endpoint Description
GET /api/customers List customers (paginated)
POST /api/customers Create customer
GET /api/customers/:id Get customer by ID
PUT /api/customers/:id Update customer
DELETE /api/customers/:id Delete customer
Transaction Endpoints
Method Endpoint Description
GET /api/transactions List transactions (filtered)
POST /api/transactions Create transaction
PUT /api/transactions/:id Update transaction
DELETE /api/transactions/:id Delete transaction
GET /api/transactions/summary Get summary stats
GET /api/transactions/export Export to CSV
Invoice Endpoints
Method Endpoint Description
GET /api/invoices List invoices
POST /api/invoices Create invoice
GET /api/invoices/:id Get invoice by ID
PUT /api/invoices/:id Update invoice
DELETE /api/invoices/:id Delete invoice

Scripts

Server

npm run dev      # Development with hot reload
npm start        # Production mode
npm test         # Run tests with coverage
npm run lint     # Lint code
npm run db:setup # Setup database tables

Client

npm start        # Development server
npm run build    # Production build
npm test         # Run tests
npm run lint     # Lint code

Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

Contributors

Support

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

Priyanshu - Full Stack Developer

LinkedIn GitHub


Made with ❤️ in India

Back to top

About

Ledger is a web app designed for shops and shopkeepers to manage their daily operations efficiently.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 2

  •  
  •