A blockchain-powered inventory management platform built for industrial companies, enabling secure multi-tenant operations with role-based access control and supply chain transparency.
- Backend: NestJS with TypeScript
- Frontend: React with TypeScript
- Blockchain: Flare Network
- Database: PostgreSQL
- Authentication: JWT with role-based access control
- Multi-tenant architecture supporting multiple companies
- Role-based access control (Super Admin, Admin, Manager, Supervisor, Employee)
- Real-time inventory tracking and management
- Supply chain traceability via blockchain
- Automated reordering and stock alerts
- Comprehensive reporting and analytics
- Immutable audit trails on Flare Network
- Smart contracts for automated workflows
- Anti-counterfeiting through digital fingerprints
- Cross-company transparency with privacy controls
- Integration with external data sources via Flare oracles
├── Authentication & Authorization
├── Multi-tenant data isolation
├── RESTful APIs
├── WebSocket for real-time updates
├── Blockchain integration services
├── Background job processing
└── Comprehensive logging & monitoring
├── Material-UI / Ant Design components
├── Redux Toolkit for state management
├── React Router for navigation
├── Web3 integration for blockchain
├── Real-time notifications
└── Responsive design
├── Smart contracts for inventory tracking
├── State Connector for external data
├── FTSO integration for price feeds
├── Multi-signature wallets for companies
└── Event-driven architecture
- Node.js 18+ and npm/yarn
- PostgreSQL 14+
- Docker & Docker Compose (recommended)
- Flare Network wallet and testnet FLR tokens
git clone https://github.com/your-org/inventory-management-system.git
cd inventory-management-system# Copy environment files
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
# Update configuration values
nano backend/.env
nano frontend/.env# Using Docker (recommended)
docker-compose up -d postgres
# Or install PostgreSQL locally
# Create database: inventory_managementcd backend
npm install
# Run database migrations
npm run migration:run
# Seed initial data
npm run seed
# Start development server
npm run start:devcd frontend
npm install
# Start development server
npm startcd blockchain
# Install dependencies
npm install
# Deploy contracts to Flare testnet
npm run deploy:testnet
# Update contract addresses in backend/.envinventory-management-system/
├── backend/
│ ├── src/
│ │ ├── auth/ # Authentication & JWT
│ │ ├── companies/ # Multi-tenant management
│ │ ├── users/ # User management & RBAC
│ │ ├── inventory/ # Core inventory logic
│ │ ├── blockchain/ # Flare Network integration
│ │ ├── reports/ # Analytics & reporting
│ │ └── common/ # Shared utilities
│ ├── migrations/ # Database migrations
│ └── seeds/ # Initial data
├── frontend/
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API calls & blockchain
│ │ ├── store/ # Redux store
│ │ └── utils/ # Helper functions
├── blockchain/
│ ├── contracts/ # Solidity smart contracts
│ ├── scripts/ # Deployment scripts
│ └── test/ # Contract tests
└── docs/ # Documentation
| Role | Inventory | Users | Reports | Settings | Blockchain |
|---|---|---|---|---|---|
| Super Admin | ✅ Full | ✅ Full | ✅ Full | ✅ Full | ✅ Full |
| Admin | ✅ Full | ✅ Manage | ✅ Full | ✅ Company | ✅ View |
| Manager | ✅ Edit | ✅ View | ✅ Department | ❌ | ✅ View |
| Supervisor | ✅ Edit | ❌ | ✅ Team | ❌ | ❌ |
| Employee | 👁️ View | ❌ | 👁️ Limited | ❌ | ❌ |
{
"sub": "user_id",
"email": "user@company.com",
"company_id": "company_uuid",
"roles": ["admin"],
"permissions": ["inventory:read", "inventory:write"],
"exp": 1234567890
}// Core inventory tracking
function addItem(string itemId, string metadata) external
function updateItem(string itemId, string metadata) external
function transferItem(string itemId, address to) external
// Supply chain tracking
function recordMovement(string itemId, string location, uint256 timestamp) external
function verifyAuthenticity(string itemId) external view returns (bool)
// Multi-company operations
function grantCompanyAccess(address company, string itemId) external
function revokeCompanyAccess(address company, string itemId) external- State Connector: Integration with external inventory systems
- FTSO: Real-time pricing for inventory valuation
- EVM Compatibility: Standard Web3 tooling and libraries
- Low Gas Costs: Cost-effective for high-frequency updates
companies # Multi-tenant company data
users # User accounts with company association
roles # Role definitions and permissions
inventory_items # Core inventory data
movements # Item movement history
blockchain_events # Blockchain transaction records
audit_logs # System audit trail# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/inventory_management
# JWT
JWT_SECRET=your-super-secret-key
JWT_EXPIRATION=24h
# Blockchain
FLARE_RPC_URL=https://flare-api.flare.network/ext/C/rpc
PRIVATE_KEY=your-wallet-private-key
CONTRACT_ADDRESS=0x...
# External Services
REDIS_URL=redis://localhost:6379
EMAIL_SERVICE_API_KEY=your-email-api-keyREACT_APP_API_BASE_URL=http://localhost:3001/api
REACT_APP_BLOCKCHAIN_NETWORK=flare-testnet
REACT_APP_CONTRACT_ADDRESS=0x...cd backend
# Unit tests
npm run test
# Integration tests
npm run test:e2e
# Test coverage
npm run test:covcd frontend
# Component tests
npm test
# E2E tests with Cypress
npm run cypress:opencd blockchain
# Contract unit tests
npm test
# Gas usage analysis
npm run gas-report# Build and start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Scale services
docker-compose up -d --scale backend=3- Database: Set up PostgreSQL instance
- Backend: Deploy NestJS app to cloud provider
- Frontend: Build React app and deploy to CDN
- Blockchain: Deploy contracts to Flare mainnet
- Logging: Structured logging with Winston
- Metrics: Prometheus metrics collection
- Tracing: Distributed tracing with Jaeger
- Alerts: PagerDuty integration for critical issues
- Blockchain Monitoring: Contract event monitoring and alerts
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Full documentation
- API Reference: OpenAPI/Swagger UI
- Issues: GitHub Issues
- Discord: Community Chat
- Multi-tenant architecture
- Basic inventory management
- Flare Network integration
- Role-based access control
- IoT sensor integration
- Advanced analytics & ML predictions
- Mobile applications
- Integration marketplace
- Advanced compliance features
- Multi-region deployment
- Advanced blockchain features
- Enterprise SSO integration
Built with ❤️ for modern supply chain management