Inventory & Invoice Management
What we're building and why
Track products, quantities, and stock movements in real-time
Create, manage, and export professional invoices
Admin, Manager, Staff with different permissions
Overview stats, charts, and low-stock alerts
Automatic notifications for low stock levels
Works on desktop, tablet, and mobile devices
Technologies powering Stock Pilot
Frontend UI & interactions
Styling & responsive design
Backend REST API server
Relational database
Database queries & migrations
Authentication & security
Input validation
Invoice PDF generation
Access control matrix for each role
Full system access
Manages users & settings
Manage stock & invoices
View reports & analytics
View stock & create invoices
Limited dashboard access
| Feature | Admin | Manager | Staff | Notes |
|---|---|---|---|---|
| View Dashboard | Full | Full | Limited | Staff sees basic stats only |
| Manage Products | Full | Full | View | Staff can only view products |
| Create Invoices | Yes | Yes | Yes | All roles can create |
| View All Invoices | All | All | Own | Staff sees own invoices only |
| Delete Invoices | Yes | No | No | Admin only for safety |
| Manage Users | Yes | No | No | Admin manages all users |
| Manage Categories | Yes | Yes | No | — |
| View Reports | Yes | Yes | No | — |
| System Settings | Yes | No | No | Admin only |
Minimum viable product feature set
File and folder organization
PostgreSQL tables and relationships
Users 1 → N Invoices •
Users 1 → N StockMovements •
Categories 1 → N ProductsProducts 1 → N StockMovements •
Invoices 1 → N InvoiceItems •
Products 1 → N InvoiceItems
| Column | Type |
|---|---|
| id PK | UUID |
| name | String |
| String (unique) | |
| password | String (hashed) |
| role | Enum (ADMIN|MANAGER|STAFF) |
| createdAt | DateTime |
| Column | Type |
|---|---|
| id PK | UUID |
| name | String |
| description | String? |
| createdAt | DateTime |
| Column | Type |
|---|---|
| id PK | UUID |
| name | String |
| sku | String (unique) |
| categoryId FK | UUID |
| quantity | Integer |
| minQuantity | Integer |
| price | Decimal |
| costPrice | Decimal |
| Column | Type |
|---|---|
| id PK | UUID |
| productId FK | UUID |
| type | Enum (IN|OUT|ADJ) |
| quantity | Integer |
| reason | String? |
| userId FK | UUID |
| createdAt | DateTime |
Invoice tables
| Column | Type |
|---|---|
| id PK | UUID |
| invoiceNumber | String (unique, auto) |
| customerName | String |
| customerEmail | String? |
| status | Enum (DRAFT|SENT|PAID|CANCELLED) |
| subtotal | Decimal |
| tax | Decimal |
| total | Decimal |
| notes | String? |
| createdBy FK | UUID |
| createdAt | DateTime |
| Column | Type |
|---|---|
| id PK | UUID |
| invoiceId FK | UUID |
| productId FK | UUID |
| quantity | Integer |
| unitPrice | Decimal |
| total | Decimal |
RESTful API routes
| Method | Endpoint | Description | Access |
|---|---|---|---|
| POST | /api/auth/login | Login user | Public |
| POST | /api/auth/logout | Logout user | All |
| GET | /api/auth/me | Get current user | All |
| Method | Endpoint | Description | Access |
|---|---|---|---|
| GET | /api/users | List all users | Admin |
| POST | /api/users | Create new user | Admin |
| PUT | /api/users/:id | Update user | Admin |
| DELETE | /api/users/:id | Delete user | Admin |
Products, Categories, Invoices & Dashboard
| Method | Endpoint | Description | Access |
|---|---|---|---|
| GET | /api/products | List all products | All |
| POST | /api/products | Create product | Admin, Manager |
| GET | /api/products/:id | Get product details | All |
| PUT | /api/products/:id | Update product | Admin, Manager |
| DELETE | /api/products/:id | Delete product | Admin, Manager |
| GET | /api/products/low-stock | Low stock items | Admin, Manager |
| Method | Endpoint | Description | Access |
|---|---|---|---|
| GET | /api/categories | List categories | All |
| POST | /api/categories | Create category | Admin, Manager |
| PUT | /api/categories/:id | Update category | Admin, Manager |
| DELETE | /api/categories/:id | Delete category | Admin |
| Method | Endpoint | Description | Access |
|---|---|---|---|
| GET | /api/invoices | List invoices | All (filtered) |
| POST | /api/invoices | Create invoice | All |
| GET | /api/invoices/:id | Get invoice details | Owner / Admin |
| PUT | /api/invoices/:id | Update invoice | Admin, Manager |
| DELETE | /api/invoices/:id | Delete invoice | Admin |
| GET | /api/invoices/:id/pdf | Download PDF | Owner / Admin |
| Method | Endpoint | Description | Access |
|---|---|---|---|
| GET | /api/dashboard/stats | Overview statistics | All |
| GET | /api/dashboard/movements | Recent movements | Admin, Manager |
| GET | /api/dashboard/revenue | Revenue data | Admin, Manager |
Application pages and views
Email & password authentication
Stats, charts, alerts, recent activity
Search, filter, stock status table
Add/Edit with all product fields
List & manage product categories
Filter by status, date, customer
Create with line items & auto-totals
View, print, download PDF
Admin view — manage all users
Add/Edit user with role assignment
Edit own info, change password
History log of all stock changes
Step-by-step build roadmap