Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shop Stock — Sajilo Inventory System

A lightweight, offline-first inventory web app for small shops in Biratnagar, Nepal (kirana, hardware, clothing, wholesalers).

  • Frontend: HTML + Tailwind CSS (CDN) — no build step
  • Backend: Node.js + Express
  • Database: SQLite file (database.sqlite) — works without internet after setup

Quick start (about 5 minutes)

1. Install Node.js

Download from https://nodejs.org (LTS version).
On Windows, run the installer and restart your computer if asked.

2. Open terminal in project folder

cd d:\BCA\Project\EMS\backend

3. Install dependencies

npm install

4. Add sample products (first time only)

npm run seed

5. Start the app

npm start

6. Open in browser

Go to: http://localhost:3000

  • Enter your Shop Name (shows in the top bar) and PIN: 1234
  • Or click Continue without PIN for quick local use (you can still set the shop name).

Folder structure

EMS/
├── frontend/          # HTML pages + JS (served by Express)
│   ├── index.html     # Dashboard
│   ├── products.html
│   ├── stock.html
│   ├── sales.html
│   ├── reports.html
│   └── js/
├── backend/
│   ├── server.js      # Main server
│   ├── db.js          # SQLite setup
│   ├── seed.js        # Sample data
│   └── routes/        # REST API
├── database.sqlite    # Created automatically (your data)
└── README.md

Features

Page What it does
Dashboard Total products, stock value, today's sales, low stock alerts
Products Add, edit, delete, search, filter by category
Stock Add stock (purchase) or reduce stock manually
Sales Record sales, auto price & stock update
Reports Daily sales, profit estimate, low stock, CSV export/import

Currency: Nepalese Rupees (Rs.)
Categories: Kirana, Hardware, Clothes, Other


API overview

Method Endpoint Description
GET /api/dashboard Dashboard stats
GET/POST/PUT/DELETE /api/products Product CRUD
POST /api/stock/purchase Add stock
POST /api/stock/reduce Reduce stock
POST /api/sales Record sale
GET /api/sales?date=YYYY-MM-DD Sales for a day
GET /api/reports/daily?date=... Daily report
GET /api/reports/low-stock Low stock list
GET /api/reports/export/csv Download backup
POST /api/reports/import/csv Restore from CSV
POST /api/auth/login Admin PIN login

Offline use

  1. Install once with internet (for npm install and CDN on first load).
  2. After that, run npm start on the shop laptop — no internet needed for daily work.
  3. All data stays in database.sqlite on your computer.

Tip: Copy database.sqlite to a USB drive weekly as backup.


Change admin PIN

Default PIN is 1234, stored in the database settings table.
To change via API (after server is running):

curl -X POST http://localhost:3000/api/auth/change-pin -H "Content-Type: application/json" -d "{\"oldPin\":\"1234\",\"newPin\":\"5678\"}"

Troubleshooting

Problem Solution
npm not found Install Node.js and reopen terminal
Port 3000 in use Set another port: set PORT=3001 then npm start (Windows)
Empty dashboard Run npm run seed in backend folder
Page looks plain First visit needs internet for Tailwind/Lucide CDN

Sample products (after seed)

  1. Sunflower Oil 1L — Kirana
  2. Cement 50kg — Hardware
  3. Men Cotton Shirt — Clothes
  4. Surf Excel 1kg — Kirana
  5. PVC Pipe 2 inch — Hardware (low stock)
  6. School Notebook — Other

Built for small businesses in Biratnagar, Nepal — simple, fast, and easy for non-technical shop owners.

Releases

Packages

Contributors

Languages