A modern point-of-sale (POS) and inventory management system designed for small convenience stores and tuck shops. Built with React, TypeScript, Express, and PostgreSQL.
- Point of Sale (POS): Quick checkout system for processing sales
- Inventory Management: Track products with real-time stock levels
- Category Management: Organize products by categories
- Stock Movement Tracking: Complete audit trail of all inventory changes
- Dashboard Analytics: Real-time business metrics and insights
- Refund & Return System: Reversible operations instead of deletions
- Stock Validation: Prevents negative stock levels across all operations
- Date Filtering: Filter stock movements by date range
- PDF Reports: Export data from inventory, stock movements, and dashboard
- Low Stock Alerts: Automatic notifications when items fall below safety levels
- Audit Trail: Product names preserved even after deletion
- React 19 with TypeScript
- Material-UI (MUI) v7
- Vite for build tooling
- jsPDF for PDF generation
- Node.js with Express
- TypeScript
- Knex.js for database migrations and queries
- PostgreSQL database
TuckShop/
├── server/ # Backend application
│ ├── src/
│ │ ├── handlers/ # Route handlers
│ │ ├── services/ # Business logic
│ │ ├── index.ts # Server entry point
│ │ └── knex.ts # Database configuration
│ ├── migrations/ # Database migrations
│ └── seeds/ # Initial data
└── tuckshop_client/ # Frontend application
└── src/
├── components/ # Reusable UI components
├── pages/ # Main application pages
├── api/ # API service layer
└── types/ # TypeScript definitions
- Node.js (v22 or higher)
- PostgreSQL database
- npm or yarn package manager
- Clone the repository
git clone <repository-url>
cd TuckShop- Setup Backend
cd server
npm installCreate a .env file in the server directory:
PG_HOST=localhost
PG_USER=your_db_user
PG_PASSWORD=your_db_password
PG_DATABASE=tuckshop_db
PG_PORT=5432
SERVER_PORT=5000Run migrations:
npx knex migrate:latest
npx knex seed:run- Setup Frontend
cd ../tuckshop_client
npm install- Start the backend server (from
serverdirectory):
npm run startServer runs on http://localhost:5000
- Start the frontend (from
tuckshop_clientdirectory):
npm run devApplication runs on http://localhost:5173
This project is deployed across three free cloud services:
| Service | Role | URL |
|---|---|---|
| Neon | PostgreSQL database | — |
| Render | Node.js backend | — |
| Vercel | React frontend | — |
- Sign up at neon.tech
- Create a new project and copy your connection credentials
- Update
knexfile.tsto includessl: { rejectUnauthorized: false }in the connection object - Run migrations against Neon:
npx knex migrate:latest && npx knex seed:run
- Sign up at render.com and create a Web Service
- Connect your GitHub repository, set root directory to
server - Build command:
npm install && npm run build - Start command:
node dist/src/index.js - Add all
PG_*andSERVER_PORTenvironment variables in the Render dashboard
- Sign up at vercel.com and import your GitHub repository
- Set root directory to
tuckshop_client - Add environment variable:
VITE_API_URL=https://your-render-url.onrender.com
- Never commit your
.envfile — it is listed in.gitignore - All secrets should be set as environment variables in Render and Vercel dashboards
- The university/corporate network may block port 5432 — use a hotspot for local DB operations
View key business metrics including:
- Daily revenue and transaction count
- Refunds processed today
- Total inventory value
- Active categories
- Low stock alerts
- Most popular items (last 30 days)
- Select products from the catalog
- Adjust quantities as needed
- Process sale with automatic stock deduction
- Generate refunds for returned items
- Add, edit products
- View current stock levels
- Export inventory reports to PDF
- Monitor product categories
- Categories: Create and manage product categories
- Stock Movements: View complete history of all stock changes
- Filter by date range
- Track SALE, PURCHASE, REFUND, RETURN, ADJUSTMENT types
- Export to PDF for reporting
- SALE: Deducts stock when items are sold
- PURCHASE: Adds stock when inventory is received
- REFUND: Reverses a SALE (adds stock back)
- RETURN: Reverses a PURCHASE (removes stock)
- ADJUSTMENT: Manual corrections (positive or negative)
- No Hard Deletes: Products can't be permanently deleted; audit trail is preserved
- Reversible Operations: Refunds and returns instead of delete operations
- Stock Validation: Database and application-level checks prevent negative stock
- Audit Trail: Product names stored in stock movements survive product deletion
Key tables:
categories: Product categoriesproducts: Product catalog with pricing and stock levelssales: Transaction recordssale_items: Individual items in each salestockmovements: Complete audit trail of inventory changes
- TypeScript strict mode enabled
- ESLint configured for code quality
- No use of
anytype orinnerHTML - Material-UI custom theme applied
- Responsive design for mobile and desktop