A comprehensive web-based purchasing tracker system with request submission, approval workflow, and order tracking capabilities.
- Create purchase requests with vendor selection
- Add multiple products with quantity, price, and description
- Automatic tax calculation
- Dynamic form with add/remove item functionality
- Notes field for special instructions
- Password-protected approval interface for admin and approver roles
- View detailed purchase request information
- Approve or reject purchase requests
- Track approval history and approver information
- Real-time status updates
- Track purchase order progression through multiple stages:
- Pending: Awaiting approval
- Approved: Ready to be ordered
- Rejected: Request rejected
- Ordered: Order placed with vendor
- Partially Received: Some items received
- Completed: All items received
- Visual progress bars showing receiving status
- Item-by-item receiving interface
- Mark orders as received with quantity tracking
- Filter orders by status
- Secure password authentication with bcrypt hashing
- Three user roles with different permissions:
- Admin: Full system access
- Approver: Can approve/reject purchase requests
- Purchaser: Can submit requests and track orders
- Session-based authentication
- Role-based access control
- Backend: Node.js with Express
- Database: SQLite with better-sqlite3
- Authentication: bcryptjs with express-session
- Frontend: Vanilla HTML, CSS, JavaScript
- Styling: Custom CSS with modern gradient design
-
Make sure you have Node.js installed (version 14 or higher)
-
Install dependencies:
npm installStart the server:
npm startThe application will be available at: http://localhost:3000
The system comes with three pre-configured accounts for testing:
| Username | Password | Role | Capabilities |
|---|---|---|---|
| admin | admin123 | Admin | Full access to all features |
| approver | approver123 | Approver | Can approve/reject purchase requests |
| purchaser | purchaser123 | Purchaser | Can submit requests and track orders |
Important: Change these passwords in production!
- Log in with any account
- Go to "New Request" tab (default view)
- Select a vendor from the dropdown
- Add items:
- Click "Add Item" to add product rows
- Enter product name, description, quantity, and unit price
- Line totals calculate automatically
- Adjust tax rate if needed (defaults to 7.5%)
- Add optional notes
- Review the calculated subtotal, tax, and total
- Click "Submit Purchase Request"
- Log in with an admin or approver account
- Go to "Approvals" tab
- View the list of pending requests
- Click "View" to see detailed information
- Click "Approve" or "Reject" to process the request
- Log in with any account
- Go to "Track Orders" tab
- Use the status filter to find specific orders
- Click "Track & Receive" to view order details
- For approved orders:
- Click "Mark as Ordered" once you've placed the order with the vendor
- For ordered/partially received items:
- Enter the quantity received for each item
- Click "Receive" to update the receiving status
- Orders automatically update to "Completed" when all items are received
- users: User accounts with authentication and roles
- vendors: Vendor information
- purchase_requests: Main purchase request records
- purchase_request_items: Individual items within each request
Pending β Approved β Ordered β Partially Received β Completed
β
Rejected
The system includes three pre-configured vendors:
- Office Supplies Inc
- Tech Solutions Ltd
- Industrial Equipment Co
purchasing-tracker/
βββ server.js # Express server and API endpoints
βββ package.json # Node.js dependencies
βββ purchasing.db # SQLite database (created on first run)
βββ public/
βββ index.html # Purchase request submission form
βββ approval.html # Approval interface
βββ tracking.html # Order tracking and receiving
βββ styles.css # Application styling
- Password hashing with bcrypt (10 salt rounds)
- Session-based authentication
- Role-based access control
- CSRF protection through session validation
- SQL injection protection with parameterized queries
POST /api/login- User loginPOST /api/logout- User logoutGET /api/auth/check- Check authentication status
GET /api/vendors- List all vendorsPOST /api/vendors- Create new vendor (admin only)
GET /api/purchase-requests- List purchase requestsGET /api/purchase-requests/:id- Get request detailsPOST /api/purchase-requests- Create new requestPUT /api/purchase-requests/:id/status- Update request statusPUT /api/purchase-requests/:requestId/items/:itemId/receive- Receive items
GET /api/users- List users (admin only)POST /api/users- Create new user (admin only)
The default tax rate is 7.5%. You can:
- Adjust it per-request in the submission form
- Change the default in
public/index.html(line withvalue="7.5")
Log in as admin and use the API endpoint or add directly to the database.
Edit the role field in the users table. Valid values: admin, approver, purchaser
- Chrome (recommended)
- Firefox
- Safari
- Edge
- Any modern browser with ES6 support
- The database file (
purchasing.db) is created automatically on first run - All timestamps are stored in UTC
- The application uses SQLite's WAL mode for better concurrency
- Session data is stored in memory (use a persistent store for production)
Potential features for future versions:
- Email notifications for approvals and receipts
- PDF export of purchase orders
- Advanced reporting and analytics
- Multi-currency support
- Vendor performance tracking
- Budget management and allocation
- File attachments (quotes, invoices)
- Mobile app version
ISC
For issues or questions, please check the documentation or contact your system administrator.