A modern, open-source shop management solution for small businesses in India
Features • Quick Start • Documentation • Contributing
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.
- 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
- 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
- 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
- Visual charts showing monthly revenue trends
- Credit vs. debit breakdown with pie charts
- Expense category analysis
- Quick stats: total customers, transactions, revenue
- Secure JWT-based authentication
- Password hashing with bcrypt
- Rate limiting to prevent abuse
- Protected API routes
|
React 18 |
Node.js |
Express |
PostgreSQL |
Tailwind |
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 |
# 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- Node.js 20+
- PostgreSQL 16+
- npm 10+
git clone https://github.com/Priyans-hu/ledger.git
cd ledger
# Create database
psql -c "CREATE DATABASE ledger;"cd server
cp .env.example .env
# Edit .env with your database credentials
npm install
npm run db:setup # Creates tables
npm run devcd client
cp .env.example .env
npm install
npm startThe app will be available at http://localhost:3000
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
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 |
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 |
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 tablesnpm start # Development server
npm run build # Production build
npm test # Run tests
npm run lint # Lint codeWe welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feat/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feat/amazing-feature) - Open a Pull Request
- Star this repository if you find it useful
- Report bugs by opening an issue
- Request features by opening an issue
This project is licensed under the MIT License - see the LICENSE file for details.
Priyanshu - Full Stack Developer
Made with ❤️ in India