π€ RobotixFunnel AI-Powered Robotised E-Commerce Platform
RobotixFunnel is a full-stack, AI-powered e-commerce platform with a real-time Digital Twin Warehouse featuring autonomous AGV robots, an AI chatbot shopping assistant, and a complete admin panel β built for the Romanian & European electronics market.
π Architecture Overview
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLIENT LAYER β
β β
β π Storefront (8000) π§ Admin Panel (3001) π Dashboard β
β Next.js 15 + React 19 Next.js 16 + React 19 Three.js 3D β
β Tailwind CSS Tailwind CSS 4 WebGL + WS β
ββββββββββββ¬ββββββββββββββββββββββββ¬ββββββββββββββββββββββββ¬βββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββ ββββββββββββββββββββββ ββββββββββββββββββββββ
β Platform Backend β β AI Chat Service β β Warehouse Orch. β
β Fastify 5 (:9000) β β FastAPI (:5050) β β Express (:4000) β
β Drizzle ORM β β Gemini 3 Flash β β Socket.IO + Gemini β
β Stripe Payments β β Product Search β β A* Pathfinding β
β JWT + Google OAuth β β Knowledge Base β β 4 AGV Robots β
βββββββββββ¬ββββββββββββ ββββββββββ¬ββββββββββββ βββββββββββ¬βββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DATA LAYER β
β β
β π PostgreSQL (27 tables) π΄ Redis (cache) β
β Products, Orders, Invoices Session, API cache β
β Customers, Carts, Blog β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π§© Project Structure
RobotixFunnel/
βββ frontend/ # π Customer Storefront (Next.js 15, port 8000)
βββ backend-v2/ # βοΈ Platform Backend API (Fastify 5, port 9000)
βββ Admin01/ # π§ Admin Panel (Next.js 16, port 3001)
βββ warehouse-orchestrator/ # π Digital Twin Warehouse (Express, port 4000)
βββ ai-chat-service/ # π€ AI Chatbot (FastAPI, port 5050)
βββ architecture.md # Architecture documentation
βββ README.md # This file
π Frontend β Customer Storefront
Tech: Next.js 15.3 Β· React 19 Β· Tailwind CSS Β· Turbopack Β· TypeScript
Port: 8000
Package: robotixfunnel-storefront
The storefront is a high-performance SSR/SSG e-commerce frontend with full shopping experience.
Key Features
- Server-Side Rendering with Next.js App Router and Turbopack
- Stripe Payment Integration β Credit card, iDEAL, and more
- Google OAuth β One-click customer login
- AI Chatbot Widget β Embedded Gemini-powered shopping assistant
- Multi-region Support β Country-code based routing (
/ro/,/us/) - Bilingual URLs β English + Romanian routes (
/shipping+/livrare) - Image Optimization β AVIF/WebP with CDN (
cdn.mypni.com) - Product Search & Filtering β By category, brand, price, with sorting
- Responsive Design β Mobile-first Tailwind CSS
Pages & Routes
| Route | Description |
|---|---|
/ |
Homepage with featured products & categories |
/store |
Product catalog with search, filters & sorting |
/products/[handle] |
Product detail page |
/categories/[...handle] |
Category browsing |
/collections/[handle] |
Product collections |
/brands |
Brand listing |
/cart |
Shopping cart |
/checkout |
Multi-step checkout flow |
/payment |
Payment processing (Stripe) |
/account |
Customer dashboard, orders, profile |
/order/[id] |
Order tracking & details |
/blog |
Blog articles |
/about /despre-noi |
About us (EN/RO) |
/shipping /livrare |
Shipping policy (EN/RO) |
/returns /retur |
Return policy (EN/RO) |
/warranty /garantie |
Warranty info (EN/RO) |
/terms /termeni |
Terms & conditions (EN/RO) |
/privacy /confidentialitate |
Privacy policy (EN/RO) |
/contact |
Contact form |
Frontend API Routes
| Endpoint | Description |
|---|---|
/api/auth/google |
Google OAuth callback |
/api/cart |
Cart operations |
/api/products |
Product data (with specs) |
/api/blog |
Blog content |
/api/tracking |
Order tracking |
/api/warehouse |
Warehouse status proxy |
/api/revalidate |
ISR cache revalidation |
Scripts
yarn dev # Start dev server (port 8000, Turbopack)
yarn build # Production build
yarn start # Production server
yarn lint # ESLint
yarn analyze # Bundle analyzer
βοΈ Backend β Platform API
Tech: Fastify 5 Β· Drizzle ORM Β· PostgreSQL Β· Redis Β· Stripe Β· TypeScript
Port: 9000
Architecture: Clean Architecture (Domain β Application β Infrastructure β Presentation)
The backend follows Clean Architecture with dependency injection, providing RESTful APIs for the storefront, admin panel, and warehouse.
Key Features
- Clean Architecture β Domain entities, use cases, repository interfaces
- Stripe Payments β Full payment lifecycle with webhooks
- B2B Supplier Integration β PNI/MyPNI product sync & scraping
- Tiered Pricing β B2B volume-based pricing system
- JWT Authentication β Stateless auth with refresh tokens
- Redis Caching β High-performance API response cache
- Swagger UI β Auto-generated API documentation
- Rate Limiting β Per-route rate limiting
- Structured Logging β Pino logger with pretty-print
API Endpoints
Store APIs (Public)
| Method | Endpoint | Description |
|---|---|---|
| GET | /store/products |
List products (with search, filters, pagination) |
| GET | /store/products/:id |
Product detail |
| GET | /store/product-categories |
Category tree |
| GET | /store/collections |
Product collections |
| GET | /store/regions |
Available regions & countries |
| POST | /store/carts |
Create cart |
| POST | /store/carts/:id/line-items |
Add to cart |
| GET | /store/customers/me |
Current customer profile |
| POST | /store/orders |
Place order |
| GET | /store/orders |
Customer order history |
Admin APIs (Authenticated)
| Method | Endpoint | Description |
|---|---|---|
| CRUD | /admin/products |
Product management |
| CRUD | /admin/product-categories |
Category management |
| CRUD | /admin/orders |
Order management |
| CRUD | /admin/customers |
Customer management |
| CRUD | /admin/invoices |
Invoice management |
| CRUD | /admin/promotions |
Promo code management |
| POST | /admin/pni/sync |
Sync B2B supplier products |
Other
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/login |
Admin login |
| POST | /auth/register |
Customer registration |
| POST | /webhooks/stripe |
Stripe webhook handler |
| GET | /health |
Health check |
Database Schema (27 Tables)
| Table | Purpose |
|---|---|
products |
Product catalog (title, description, price tiers, B2B data) |
product_variants |
SKU, inventory, pricing (RON bani) |
categories |
Hierarchical categories (parent_id) |
brands |
Product brands |
orders |
Full order lifecycle (9 statuses) |
order_items |
Order line items |
carts / cart_items |
Shopping carts |
customers |
Accounts (B2B: CUI, reg number) |
customer_addresses |
Shipping & billing addresses |
invoices / invoice_items |
Romanian-format invoices (RON) |
promotions |
Promo codes (%, fixed, date ranges, usage limits) |
payment_collections / payment_sessions |
Stripe payment records |
regions / region_countries |
Geographic regions with tax rates |
collections / collection_products |
Product collections |
blog_posts / blog_categories |
Blog CMS |
admin_users |
Admin accounts |
system_config |
Key-value system configuration |
platform_log |
Structured logging |
Scripts
npm run dev # Start dev server (tsx watch, port 9000)
npm run build # TypeScript compile
npm run start # Production server
npm run db:generate # Generate Drizzle migrations
npm run db:migrate # Run migrations
npm run db:push # Push schema to DB
npm run db:seed # Seed initial data
npm run db:studio # Drizzle Studio (DB GUI)
npm run test # Run tests (Vitest)
π§ Admin Panel
Tech: Next.js 16 Β· React 19 Β· Tailwind CSS 4 Β· TypeScript
Port: 3001
Base Path: /app
Full-featured admin dashboard for managing the entire e-commerce operation.
Key Features
- Product Management β CRUD, bulk import, B2B supplier sync
- Order Management β View, process, fulfill orders with status tracking
- Customer Management β Customer profiles, B2B company data
- Invoicing (Facturare) β Romanian-format e-invoices (e-Factura)
- Marketing Tools β Email campaigns, promotions, SEO management
- Blog CMS β Content management with AI blog generation
- Media Library β Upload & manage product images
- Supplier Integration β PNI/MyPNI import & API connectivity
- Google Ads β Google advertising integration
- Security Settings β User roles, access control
Admin Pages
| Route | Description |
|---|---|
/app/dashboard |
Overview stats & analytics |
/app/products |
Product catalog management |
/app/products/new |
Create new product |
/app/orders |
Order processing & fulfillment |
/app/customers |
Customer database |
/app/inventory |
Stock management |
/app/promotions |
Discount codes & promotions |
/app/facturare |
Romanian invoice management |
/app/blog |
Blog post editor |
/app/cms |
Static page management |
/app/seo |
SEO settings & sitemap |
/app/email |
Email template manager |
/app/marketing |
Marketing campaigns |
/app/media |
Media library |
/app/settings |
Store configuration |
/app/magazin/furnizori |
Supplier management |
/app/magazin/api-furnizori |
B2B API integration |
/app/google/ads |
Google Ads dashboard |
/app/utilizatori |
User management |
/app/securitate |
Security settings |
Scripts
npm run dev # Start admin panel (port 3001)
npm run build # Production build
npm run start # Production server
npm run lint # ESLint
π Warehouse Orchestrator β Digital Twin
Tech: Express.js Β· Socket.IO Β· Three.js Β· Google Gemini AI Β· TypeScript
Port: 4000
A real-time Digital Twin Warehouse with autonomous AGV robot simulation, AI-powered route optimization, and 3D WebGL visualization.
Key Features
- 3D Warehouse Visualization β Three.js WebGL rendering of warehouse floor
- 4 Autonomous AGV Robots β Octobot, Marcobot, Cyberbot, Vegbot
- A* Pathfinding β Optimal route calculation for robots on 60Γ40 grid
- Real-time WebSocket Streaming β Live robot positions via Socket.IO
- AI Route Optimization β Gemini AI optimizes picking routes
- AI Copilot β Natural language Q&A about warehouse state
- AI Anomaly Detection β Detects stuck robots, low battery, queue buildup
- Voice Commands β Speech-to-text via Gemini for robot control
- Real Stock Integration β Loads actual product inventory from PostgreSQL
- Multi-stage Fulfillment β Pick β Transport β Pack β Ship β Complete
- Demo Mode β Auto-generates orders for demonstration
- Backend Callback β Notifies platform when orders are fulfilled
Warehouse Layout
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π¦ RECEIVING β Radio β Surveillance β Electrical β DIY β
β β Stations β & Video β Electronicsβ β
βββββββββββββββββββΌβββββββββββΌβββββββββββββββΌβββββββββββββ€ β
β β Security β Smart Home β Car β β
β Aisles β Systems β β Electronicsβ β
β (Robot Paths) ββββββββββββΌβββββββββββββββΌβββββββββββββ€ β
β β Photo β Home & β Health & β β
β π€ Octobot β Video β Garden β Wellness β β
β π€ Marcobot β Audio β β β β
β π€ Cyberbot ββββββββββββΌβββββββββββββββΌβββββββββββββ€ β
β π€ Vegbot β Phones & β Miscellaneousβ β β
β β Tablets β β β β
βββββββββββββββββββΌβββββββββββ΄βββββββββββββββ΄βββββββββββββ β
β π¦ PACKING β π CHARGING β
β β β
β π SHIPPING β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Grid: 60 Γ 40 cells Β· 16 Zones (12 category + 4 functional)
Robot States: IDLE β MOVING β PICKING β CARRYING β PACKING β CHARGING
REST API
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health |
Health check (uptime, Gemini status, stock) |
| GET | /api/warehouse/state |
Full warehouse state snapshot |
| GET | /api/warehouse/metrics |
Performance metrics |
| POST | /api/warehouse/order |
Submit order for robot fulfillment |
| GET | /api/warehouse/order/:id |
Track order fulfillment status |
| GET | /api/warehouse/stock |
Stock by zone |
| POST | /api/warehouse/stock/reload |
Reload stock from database |
| POST | /api/ai/copilot |
Ask AI about warehouse (natural language) |
| GET | /api/ai/report |
AI-generated performance report |
| GET | /api/ai/anomalies |
AI anomaly detection |
| POST | /api/ai/transcribe |
Voice command transcription |
WebSocket Events (Socket.IO)
| Event | Direction | Description |
|---|---|---|
warehouseState |
ServerβClient | Real-time state broadcast (every 500ms) |
newOrder |
ServerβClient | New order received |
fulfillmentCreated |
ServerβClient | Order fulfilled by robots |
anomalies |
ServerβClient | AI anomaly alerts |
copilotQuestion |
ClientβServer | Ask AI copilot |
copilotAnswer |
ServerβClient | AI copilot response |
addDemoOrder |
ClientβServer | Trigger demo order |
moveRobot |
ClientβServer | Joystick robot control |
sendRobotTo |
ClientβServer | Send robot to coordinates |
sendRobotToZone |
ClientβServer | Send robot to named zone |
aiRobotCommand |
ClientβServer | Natural language robot command |
optimizeRoute |
ClientβServer | AI route optimization |
Scripts
npm run dev # Start with hot reload (tsx watch, port 4000)
npm run build # Compile TypeScript
npm run start # Production server
π€ AI Chat Service β Shopping Assistant
Tech: FastAPI Β· Google Gemini (gemini-3-flash-preview) Β· Python
Port: 5050
An AI-powered chatbot that helps customers find products, answers store questions, and provides personalized recommendations.
Key Features
- Gemini 3 Flash Preview β Latest Google AI model for fast responses
- Product Search β Searches backend catalog and recommends products
- Knowledge Base β Store policies, categories, shipping, returns
- Product Cards β Returns structured product data for UI rendering
- Conversational AI β Natural greetings, store Q&A, product queries
- Template Fallback β Graceful degradation when AI is unavailable
- CORS Enabled β Cross-origin support for frontend widget
How It Works
User Message β is_conversational?
βββ YES β Gemini AI response (store knowledge)
βββ NO β Extract keywords
β Search backend (/store/products?q=...)
β Gemini AI crafts response with product context
β Return response + ProductCard[] for UI
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Health check (AI enabled, model name) |
| POST | /chat |
Chat endpoint |
POST /chat Request:
{
"message": "show me LED strips",
"history": []
}
Response:
{
"response": "Check out these awesome LED strips! ...",
"products": [
{
"id": "prod_123",
"title": "SK9822 LED Strip 1m 60px",
"handle": "sk9822-led-strip",
"thumbnail": "https://cdn.mypni.com/...",
"price": "45.99",
"currency": "RON"
}
]
}
Knowledge Base Categories
| # | Category | Handle |
|---|---|---|
| 1 | Radio Stations | statii-radio |
| 2 | Video Surveillance | sisteme-supraveghere-video |
| 3 | Electrical & Electronics | electrice-si-electronice |
| 4 | Security Systems | sisteme-securitate |
| 5 | Smart Home | smart-home |
| 6 | Car Electronics | electronice-auto |
| 7 | Photo Video Audio | foto-video-audio |
| 8 | Home & Garden | casa-si-gradina |
| 9 | Health & Wellness | sanatate-si-wellness |
| 10 | Phones & Tablets | telefoane-si-tablete |
| 11 | DIY & Tools | bricolaj-si-scule |
| 12 | Miscellaneous | diverse |
Setup
pip install -r requirements.txt
python main.py # Start on port 5050
π Getting Started
Prerequisites
- Node.js β₯ 20
- Python β₯ 3.10
- PostgreSQL 16
- Redis 7
- Yarn 4.x (for frontend)
1. Clone the Repository
git clone https://github.com/sunnyshin8/RobotixFunnel.git
cd RobotixFunnel
2. Set Up Environment Variables
Create .env files in each service directory:
backend-v2/.env
PORT=9000
HOST=0.0.0.0
NODE_ENV=development
DATABASE_URL=postgresql://robotix:password@localhost:5432/robotixfunnel
REDIS_URL=redis://localhost:6379
JWT_SECRET=your-jwt-secret
COOKIE_SECRET=your-cookie-secret
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
[email protected]
ADMIN_PASSWORD=your-admin-password
WAREHOUSE_ORCHESTRATOR_URL=http://localhost:4000
frontend/.env
NEXT_PUBLIC_BACKEND_URL=http://localhost:9000
NEXT_PUBLIC_BASE_URL=http://localhost:8000
NEXT_PUBLIC_DEFAULT_REGION=ro
NEXT_PUBLIC_STRIPE_KEY=pk_test_...
NEXT_PUBLIC_AI_CHAT_URL=http://localhost:5050
JWT_SECRET=your-jwt-secret
DATABASE_PASSWORD=your-db-password
warehouse-orchestrator/.env
PORT=4000
GEMINI_API_KEY=your-gemini-api-key
DATABASE_URL=postgresql://robotix:password@localhost:5432/robotixfunnel
BACKEND_API_URL=http://localhost:9000
DEMO_MODE=true
TICK_INTERVAL=500
ROBOT_COUNT=4
ai-chat-service/.env
GEMINI_API_KEY=your-gemini-api-key
BACKEND_URL=http://localhost:9000
3. Install Dependencies & Start Services
# Backend
cd backend-v2
npm install
npm run db:push # Create database tables
npm run db:seed # Seed initial data
npm run dev # Start on port 9000
# Frontend
cd ../frontend
yarn install
yarn dev # Start on port 8000
# Warehouse Orchestrator
cd ../warehouse-orchestrator
npm install
npm run dev # Start on port 4000
# AI Chat Service
cd ../ai-chat-service
pip install -r requirements.txt
python main.py # Start on port 5050
# Admin Panel
cd ../Admin01
npm install
npm run dev # Start on port 3001
4. Access the Services
| Service | URL |
|---|---|
| π Storefront | http://localhost:8000 |
| βοΈ Backend API | http://localhost:9000 |
| π Swagger Docs | http://localhost:9000/docs |
| π§ Admin Panel | http://localhost:3001/app |
| π Warehouse 3D | http://localhost:4000 |
| π€ Chat Health | http://localhost:5050/health |
π CDN Layer
A CDN (Content Delivery Network) layer is integrated into the platform to accelerate static asset delivery:
- Domain:
cdn.mypni.comβ whitelisted in the storefront'snext.config.jsfor optimized image delivery. - Purpose: Serves product images, brand logos, and other static media from edge locations closer to end users.
- Next.js Image Optimization: Works in tandem with Next.js
<Image>component to serveavif/webpformats, apply device-aware resizing, and cache responses for 24 hours (minimumCacheTTL: 86400).
π οΈ Tech Stack Summary
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Next.js 15, React 19, Tailwind CSS | Customer storefront |
| Admin | Next.js 16, React 19, Tailwind CSS 4 | Admin dashboard |
| Backend | Fastify 5, TypeScript | REST API server |
| Database | PostgreSQL 16, Drizzle ORM | Data persistence (27 tables) |
| Cache | Redis 7, ioredis | API response caching |
| Payments | Stripe | Credit card & payment processing |
| Auth | JWT, Google OAuth, bcrypt | Authentication & authorization |
| Warehouse | Express, Socket.IO, Three.js | Digital twin simulation |
| AI Chat | FastAPI, Google Gemini 3 | Shopping assistant chatbot |
| AI Warehouse | Google Gemini 2.0/2.5 | Route optimization, copilot, anomaly detection |
| CDN | Cloudflare (cdn.mypni.com) | Image optimization & delivery |
| Styling | Tailwind CSS, Radix UI, Headless UI | Component library |
| Icons | Lucide React | Icon system |
| Logging | Pino | Structured logging |
π Unique Features
π Digital Twin Warehouse
Real-time 3D warehouse simulation with 4 autonomous AGV robots (Octobot, Marcobot, Cyberbot, Vegbot) navigating a 60Γ40 grid using A* pathfinding. Robots autonomously pick, transport, pack, and ship orders with live WebSocket streaming to a Three.js dashboard.
π€ Triple AI Integration
Three separate Google Gemini AI integrations:
- Warehouse Copilot β Natural language Q&A about warehouse operations
- Shopping Assistant β Customer-facing chatbot with product recommendations
- Route Optimizer β AI-optimized picking routes for warehouse robots
π£οΈ Voice-Controlled Warehouse
Speak commands to control warehouse robots β audio is transcribed by Gemini AI and parsed into robot instructions.
π·π΄ Romanian E-Commerce
Full Romanian localization: bilingual URLs (/shipping + /livrare), RON currency, 19% VAT, e-Factura electronic invoicing, Romanian-format invoices.
π¦ Real Stock Sync
Warehouse simulation loads actual product inventory from the PostgreSQL database and distributes items across category-mapped shelf zones.
π B2B Supplier Integration
Automated product syncing from PNI/MyPNI B2B suppliers with web scraping, authentication, and catalog import.
π License
Private β Query Curious Β© 2025
π₯ Team
Owner: Query Curious
Repository: github.com/sunnyshin8/RobotixFunnel
Built With
- ai
- amazon-web-services
- artifical
- chatbot
- fastapi
- nextjs
- payu
- postgresql
- postman
- python
- python-package-index
- react
- reinforcement
- robotics
- stripe

Log in or sign up for Devpost to join the conversation.