How wajeehasajid/inventory-management-system works
This is a full-stack product inventory system. Users sign in, manage products and their category/supplier references, record stock movements, and inspect inventory analytics; administrators additionally manage roles, delete protected records, and import CSV data. Static browser pages call an Express API, whose route handlers validate requests and query PostgreSQL. The graph preserves documented UI and API capabilities, including CSV operations and API documentation. Backend route-to-database links are supported by the source index; unsampled frontend wiring is represented only where the README describes it.
Main entry points: server.js Express API · api.js Fetch API client · pool.js PostgreSQL pool · auth.js Token and roles
Components 20
Browser interface
- Product screens
frontend/products.js - Category screens
frontend/categories.js - Supplier screens
frontend/suppliers.js - Dashboard screens
frontend/dashboard.js - Login screens
frontend/login.js - Account settings
frontend/settings.js - Fetch API client
frontend/api.js
API and access
- Express API
backend/server.js - Authentication
backend/routes/auth.js - Token and roles
backend/middleware/auth.js - API documentation
backend/swagger.js
Inventory workflows
- Products and CSV
backend/routes/products.js - Categories
backend/routes/categories.js - Suppliers
backend/routes/suppliers.js - Stock movements
backend/routes/products.js - Inventory analytics
backend/routes/dashboard.js
Persistence and errors
- PostgreSQL pool
backend/db/pool.js - Inventory database
- Error responses
backend/middleware/errorHandler.js
Other components
- Inventory user
Connections 36
- Inventory user → Login screens: signs in
README.md - Inventory user → Product screens: manages inventory
README.md - Inventory user → Category screens: manages categories
README.md - Inventory user → Supplier screens: manages suppliers
README.md - Inventory user → Dashboard screens: views analytics
README.md - Inventory user → Account settings: manages account
README.md - Login screens → Fetch API client: requests API
- Product screens → Fetch API client: requests API
- Category screens → Fetch API client: requests API
- Supplier screens → Fetch API client: requests API
- Dashboard screens → Fetch API client: requests API
- Account settings → Fetch API client: requests API
- Fetch API client → Express API: HTTP requests
README.md - Express API → Authentication: mounts routes
backend/server.js - Express API → Token and roles: protects routes
backend/server.js - Express API → Products and CSV: mounts routes
backend/server.js - Express API → Categories: mounts routes
backend/server.js - Express API → Suppliers: mounts routes
backend/server.js - Express API → Inventory analytics: mounts routes
backend/server.js - Express API → API documentation: serves documentation
backend/server.js - Express API → Error responses: registers handler
backend/server.js - Authentication → PostgreSQL pool: queries users
backend/routes/auth.js - Authentication → Token and roles: guards account routes
backend/routes/auth.js - Products and CSV → PostgreSQL pool: queries inventory
backend/routes/products.js - Categories → PostgreSQL pool: queries categories
backend/routes/categories.js - Suppliers → PostgreSQL pool: queries suppliers
backend/routes/suppliers.js - Inventory analytics → PostgreSQL pool: queries analytics
backend/routes/dashboard.js - Products and CSV → Token and roles: checks admin role
backend/routes/products.js - Categories → Token and roles: checks admin role
backend/routes/categories.js - Suppliers → Token and roles: checks admin role
backend/routes/suppliers.js - Stock movements → PostgreSQL pool: records movements
backend/routes/products.js - PostgreSQL pool → Inventory database: reads and writes
backend/db/pool.js - Products and CSV → Error responses: forwards failures
- Categories → Error responses: forwards failures
- Suppliers → Error responses: forwards failures
- Inventory analytics → Error responses: forwards failures