Skip to content

Serrowxd/fluxor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fluxor - Enterprise Inventory Management System

⚠️ ARCHIVED PROJECT - REFERENCE ONLY: This project is no longer maintained and is provided solely for reference purposes. No support, updates, or pull requests will be accepted. The code may not be functional and should not be used in production.

A comprehensive, AI-powered inventory management platform designed for small and medium enterprises (SMEs) that need advanced inventory forecasting, multi-channel synchronization, and automated supplier management. Built with enterprise-grade security, scalability, and modern UI/UX principles.

πŸš€ Features

Core Inventory Management

  • πŸ“Š Real-time Dashboard: Advanced analytics with interactive charts and KPIs
  • πŸ€– AI Forecasting: Multi-model demand prediction with Prophet, ARIMA, and LSTM
  • πŸ”„ Multi-Channel Sync: Unified inventory across Shopify, Amazon, eBay, Square, and custom APIs
  • πŸ“ˆ Smart Reordering: Automated purchase order generation with EOQ optimization
  • πŸͺ Supplier Integration: Complete supplier management with approval workflows

Advanced Analytics

  • πŸ“Š Inventory Turnover Analysis: Industry benchmarks and performance tracking
  • πŸ“‰ Dead Stock Detection: AI-powered identification and liquidation recommendations
  • πŸ’° Cost Analysis: Carrying costs, gross margins, and profitability insights
  • πŸ“ˆ Forecast Accuracy: Continuous model performance monitoring and improvement
  • 🎯 Stockout Prevention: Predictive alerts with lost revenue analysis

Enterprise Security

  • πŸ” Zero-Trust Architecture: Multi-factor authentication and role-based access
  • πŸ›‘οΈ Data Protection: Field-level encryption and comprehensive audit logging
  • πŸ”’ API Security: Rate limiting, input validation, and threat detection
  • πŸ“‹ Compliance Ready: GDPR and SOC 2 Type II preparation

User Experience

  • πŸ“± Progressive Web App: Mobile-first design with offline capabilities
  • 🎨 Modern UI: Dark theme with responsive, accessible components
  • ⚑ Real-time Updates: Live data synchronization and notifications
  • πŸ” Advanced Search: Full-text search with filters and sorting
  • πŸ€– AI Assistant: Integrated Claude-powered chatbot for inventory insights and assistance

πŸ—οΈ Architecture

Technology Stack

Frontend

  • Framework: Next.js 15 with React 19 and TypeScript
  • UI Library: Tailwind CSS with shadcn/ui components
  • Charts: Recharts with D3.js for advanced visualizations
  • State Management: React Query for server state, Zustand for client state
  • Mobile: PWA with Service Workers and barcode scanning

Backend

  • API: Node.js with Express.js and tRPC
  • Authentication: JWT with refresh tokens and MFA support
  • Validation: Zod schemas with express-validator
  • Queue System: BullMQ with Redis for background processing
  • Security: Helmet, rate limiting, and comprehensive input sanitization

Database & Infrastructure

  • Primary Database: PostgreSQL 15 with partitioning and optimization
  • Caching: Redis Cluster for session and query caching
  • Search: Elasticsearch for full-text search capabilities
  • Analytics: ClickHouse for high-performance analytics
  • Hosting: Vercel for frontend, AWS for backend services
  • Monitoring: DataDog, Sentry, and custom metrics

AI & ML Services

  • Forecasting: Python microservice with Prophet, ARIMA, and ensemble models
  • Model Management: Automated retraining and performance tracking
  • External Factors: Integration with weather, economic, and seasonal data
  • Claude Integration: Anthropic's Claude API for intelligent inventory assistant

πŸ“¦ Installation

Prerequisites

  • Node.js: 18+ (LTS recommended)
  • PostgreSQL: 15+ with PostGIS extension
  • Redis: 7+ (Cluster mode for production)
  • Python: 3.11+ with pip
  • Shopify Partner Account: For API access and webhooks

Quick Start

  1. Clone the repository:
git clone <repository-url>
cd fluxor
  1. Install dependencies:
# Frontend dependencies
npm install

# Backend dependencies
cd backend && npm install

# Python AI service dependencies
cd ../ai && pip install -r requirements.txt
  1. Environment Configuration:
# Copy and configure environment files
cp backend/.env.example backend/.env
cp ai/.env.example ai/.env

# Edit with your configuration
nano backend/.env
nano ai/.env
  1. Database Setup:
# Run migrations
cd backend && npm run migrate

# Seed initial data (optional)
npm run seed
  1. Start Development Servers:
# Terminal 1: Frontend (Next.js)
npm run dev

# Terminal 2: Backend API
cd backend && npm run dev

# Terminal 3: AI Service
cd ai && python src/app.py

# Terminal 4: Redis (if not running)
redis-server

# Terminal 5: PostgreSQL (if not running)
pg_ctl -D /usr/local/var/postgres start

Access Points

πŸ—οΈ Project Structure

fluxor/
β”œβ”€β”€ app/                          # Next.js 15 app directory
β”‚   β”œβ”€β”€ dashboard/               # Main dashboard pages
β”‚   β”œβ”€β”€ login/                   # Authentication pages
β”‚   β”œβ”€β”€ settings/                # User settings and configuration
β”‚   └── globals.css              # Global styles
β”œβ”€β”€ backend/                     # Express.js API server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/         # Route handlers and business logic
β”‚   β”‚   β”œβ”€β”€ middleware/          # Authentication, validation, error handling
β”‚   β”‚   β”œβ”€β”€ models/              # Database models and queries
β”‚   β”‚   β”œβ”€β”€ routes/              # API endpoint definitions
β”‚   β”‚   β”œβ”€β”€ services/            # Business services and external integrations
β”‚   β”‚   β”‚   └── channels/        # Multi-channel connector implementations
β”‚   β”‚   β”œβ”€β”€ jobs/                # Background job processors
β”‚   β”‚   β”œβ”€β”€ utils/               # Utility functions and helpers
β”‚   β”‚   └── __tests__/           # Comprehensive test suite
β”‚   └── config/                  # Database and Redis configuration
β”œβ”€β”€ ai/                          # Python AI microservice
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   └── app.py               # Flask application with Prophet integration
β”‚   β”œβ”€β”€ requirements.txt         # Python dependencies
β”‚   └── Dockerfile               # Container configuration
β”œβ”€β”€ components/                  # React component library
β”‚   β”œβ”€β”€ dashboard/               # Dashboard-specific components
β”‚   β”œβ”€β”€ ui/                      # Reusable UI components (shadcn/ui)
β”‚   β”œβ”€β”€ fluxor/                  # Custom Fluxor components
β”‚   └── chat/                    # AI chatbot components
β”œβ”€β”€ modules/                     # Modular refactor in progress
β”‚   β”œβ”€β”€ api-gateway/             # API gateway module (empty)
β”‚   β”œβ”€β”€ business-domains/        # Domain-driven modules
β”‚   β”œβ”€β”€ configuration/           # Configuration service (empty)
β”‚   β”œβ”€β”€ core-platform/           # Core platform services (empty)
β”‚   β”œβ”€β”€ infrastructure/          # Infrastructure modules (empty)
β”‚   β”œβ”€β”€ notification/            # Notification service (empty)
β”‚   └── shared/                  # Shared types and utilities (empty)
β”œβ”€β”€ lib/                         # Utilities, hooks, and configurations
β”œβ”€β”€ hooks/                       # Custom React hooks
β”œβ”€β”€ public/                      # Static assets
β”œβ”€β”€ specs/                       # Comprehensive documentation
β”‚   β”œβ”€β”€ design.md                # System architecture and design
β”‚   β”œβ”€β”€ feature_design.md        # Feature implementation strategy
β”‚   β”œβ”€β”€ feature_considerations.md # Security and scalability considerations
β”‚   β”œβ”€β”€ modular_refactor_*.md    # Modular refactor documentation
β”‚   β”œβ”€β”€ chatbot_*.md             # AI chatbot design and implementation
β”‚   └── tickets/                 # Implementation guides and summaries
└── CLAUDE.md                    # AI assistant guidance and commands

πŸ§ͺ Testing

Running Tests

# Backend tests
cd backend && npm test

# Frontend tests
npm run test

# E2E tests
npm run test:e2e

# Test coverage
npm run test:coverage

Test Coverage

  • Backend: 95%+ coverage with comprehensive unit and integration tests
  • Frontend: Component testing with React Testing Library
  • E2E: Playwright tests for critical user workflows
  • Security: Automated penetration testing and vulnerability scanning

πŸš€ Deployment

Production Deployment

# Build frontend
npm run build

# Deploy to Vercel
vercel --prod

# Deploy backend to AWS
cd backend && npm run deploy

# Deploy AI service to Heroku
cd ai && heroku container:push web

Environment Variables

Required environment variables for production:

# Database
DATABASE_URL=postgresql://user:pass@host:port/db
REDIS_URL=redis://host:port

# Authentication
JWT_SECRET=your-super-secret-jwt-key
JWT_REFRESH_SECRET=your-refresh-secret

# AI Services
ANTHROPIC_API_KEY=your-anthropic-api-key

# Shopify Integration
SHOPIFY_API_KEY=your-shopify-api-key
SHOPIFY_API_SECRET=your-shopify-api-secret

# Email Service
MAILGUN_API_KEY=your-mailgun-key
MAILGUN_DOMAIN=your-domain.com

# Security
ENCRYPTION_KEY=your-32-byte-encryption-key
CORS_ORIGIN=https://yourdomain.com

# Monitoring
SENTRY_DSN=your-sentry-dsn
DATADOG_API_KEY=your-datadog-key

πŸ“š Documentation

Comprehensive Guides

Implementation Status

βœ… Completed Features

  • Backend Infrastructure: Express.js API with PostgreSQL and Redis
  • Authentication System: JWT with refresh tokens and role-based access
  • Database Models: Complete schema with all required tables (users, stores, products, sales, forecasts)
  • Forecasting Microservice: Python Flask service with Prophet integration and 7-day fallback
  • Dashboard UI: Interactive charts (sales trends, inventory levels) and reorder suggestions table
  • Settings Management: User preferences, Shopify connection, and alert configuration
  • Multi-Channel Framework: Base framework with channel factory and connector interfaces
  • Channel Connectors: Shopify, Amazon, eBay, Square, and Custom API connectors implemented
  • Supplier Management: Complete supplier service with automated PO generation
  • Advanced Analytics: Turnover analysis, dead stock detection, margin analysis
  • Background Jobs: Bull queue setup for async processing
  • Security Framework: Input validation, rate limiting, and secure authentication
  • Test Suite: 95%+ backend test coverage with comprehensive unit tests
  • AI Chatbot: Claude-powered assistant with context-aware inventory help
  • Chat Interface: Floating chat widget with conversation history
  • Demo Mode: Interactive demo with sample data for exploration
  • Chatbot Testing: Unit tests for chat context builder, prompt engineering, and OpenAI service
  • Migration Tests: Database migration tests for chatbot tables
  • Cache Testing: Redis cache configuration tests for chat performance

πŸ”„ In Progress

  • Modular Refactor: Transitioning to microservices architecture (modules folder structure created)
  • Shopify OAuth: Complete OAuth flow implementation needed
  • Webhook System: Endpoint registration for real-time updates
  • Email Alerts: Mailgun integration with alert templates
  • Reports Export: CSV generation and signed URL downloads
  • Error Handling: Comprehensive error boundaries and user-friendly messages
  • Frontend Testing: Component and E2E test implementation

🚧 Current Branch: modular-refactor

The project is currently undergoing a modular refactor to transition from monolithic to microservices architecture. The modules/ directory contains the new structure with domain-driven design principles.

πŸ€– AI Agent Reference Guide

Quick Context for AI/LLM Assistants

This section provides essential information for AI agents and LLMs working on the Fluxor project.

Project Type

  • Category: Enterprise SaaS Inventory Management System
  • Target: Small to medium enterprises (SMEs) using e-commerce platforms
  • Core Value: AI-powered demand forecasting with multi-channel inventory sync

Tech Stack Summary

  • Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS, shadcn/ui
  • Backend: Node.js, Express.js, PostgreSQL, Redis, Bull queue
  • AI Service: Python Flask with Facebook Prophet
  • Authentication: JWT with refresh tokens
  • Deployment: Vercel (frontend), AWS/Heroku (backend/AI)

Key Files for Context

  • CLAUDE.md: Essential commands and project-specific instructions
  • specs/design.md: Complete system architecture and implementation status
  • backend/src/models/: Database schema and model implementations
  • backend/src/services/: Business logic and integrations
  • components/ui/: Reusable UI components (40+ shadcn/ui components)

Current State

  • Branch: modular-refactor (transitioning to microservices)
  • Core Features: Working (auth, dashboard, forecasting, multi-channel base)
  • Integrations: Shopify OAuth and webhooks need completion
  • Test Coverage: 95%+ backend, frontend tests needed

Development Commands

# Essential commands (see CLAUDE.md for full list)
npm run dev                      # Start frontend
cd backend && npm run dev        # Start backend
cd ai && python src/app.py       # Start AI service
cd backend && npm run migrate    # Run migrations
cd backend && npm test           # Run tests

Architecture Patterns

  • API Design: RESTful with JWT auth on all endpoints except /auth/*
  • Database: Raw SQL with parameterized queries (no ORM)
  • State Management: Server state via API, client state with React hooks
  • Error Handling: Standardized error responses with status codes
  • Security: Input validation, rate limiting, encrypted tokens

Key Implementation Notes

  • Always check existing components before creating new ones
  • Follow existing code patterns and conventions
  • Use absolute imports and paths
  • Maintain test coverage above 90%
  • Never commit sensitive data or credentials

❌ Contributing

This project is archived and not accepting contributions. Pull requests, issues, and other contributions will not be reviewed or merged.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

❌ Support

No support is provided for this archived project. Issues and discussions may remain visible for reference but will not receive responses.

πŸ™ Acknowledgments

  • Shopify for their excellent API and developer tools
  • Facebook Prophet for the forecasting framework
  • shadcn/ui for the beautiful component library
  • Vercel for the amazing hosting platform
  • Open Source Community for the incredible tools and libraries

Fluxor - Transforming inventory management with AI-powered insights and enterprise-grade reliability.

About

AI Inventory Management Software

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •