georgian-distribution-system
💡 摘要
一个B2B平台,通过实时跟踪和基于角色的访问,现代化格鲁吉亚食品供应链。
🎯 适合人群
🤖 AI 吐槽: “一个比我厨房更有条理的食品分销系统!”
该项目使用JWT进行身份验证,如果没有适当保护,可能会面临令牌盗窃的风险。实施HTTPS和定期令牌过期可以降低风险。
Georgian Distribution System
Overview
The Georgian Distribution System is a comprehensive B2B food distribution platform designed to modernize the traditional Georgian food supply chain. It provides real-time order tracking, role-based access control, and a complete management dashboard for distributors, restaurants, and drivers.
Features
🎯 Core Functionality
- Real-time Order Tracking: Live updates using Supabase Realtime via WebSockets
- Role-Based Access Control (RBAC): Separate interfaces for Admin, Restaurant, Driver, and Demo users
- Dynamic Pricing: Custom pricing per order with profitability calculations
- Multi-language Support: Georgian and English interfaces
- Mobile-First Design: Responsive design for all device types
🏗️ Architecture
- Frontend: Next.js 15 with React 19 and TypeScript
- UI Components: shadcn/ui component library
- Backend: Supabase (PostgreSQL with real-time capabilities)
- Authentication: Supabase Auth with JWT tokens
- Real-time Engine: Supabase Realtime for live notifications
- File Storage: Supabase Storage for product images and logos
- Development: Official Supabase platform for easy development and testing
👥 User Roles
- Administrator: Full access to dashboard, order management, pricing, and analytics
- Restaurant: Order placement, status tracking, and order history
- Driver: Delivery management and status updates
- Demo: Read-only access for potential clients
🔧 Technology Stack
- Framework: Next.js 15.1.6 with App Router
- UI Library: React 19 with TypeScript
- Styling: Tailwind CSS v4
- Database: PostgreSQL 16 with Row-Level Security (RLS)
- State Management: Zustand + React Query
- Forms: React Hook Form with Zod validation
- Icons: Lucide React
- Charts: Recharts for analytics dashboard
Environment Setup
Development Environment
- Backend: Official Supabase project at https://supabase.com
- Frontend: Local development server
- MCP Integration: Full database management via MCP tools
Production Environment
- Backend: Self-hosted Supabase on VPS
- Frontend: Deployed Next.js application
- Domains:
- Frontend: https://greenland77.ge
- Backend: https://data.greenland77.ge
Key Features
Order Management Workflow
- Restaurant Places Order: Digital catalog with product selection
- Administrator Pricing: Custom pricing with profitability analysis
- Driver Assignment: Automatic assignment with notifications
- Real-time Tracking: Live status updates throughout delivery
- Delivery Confirmation: Two-step confirmation process
- Order Completion: Final status with complete transaction history
Security Features
- Row-Level Security (RLS): Database-level access control
- JWT Authentication: Secure token-based authentication
- Input Validation: Zod schemas for all user inputs
- Role Permissions: Granular access control per user role
Performance Optimizations
- Server Components: Optimized Next.js App Router implementation
- Real-time Subscriptions: Efficient WebSocket usage
- Database Optimization: Proper indexing and query optimization
- Caching Strategy: React Query for server state management
Project Structure
Distribution-Managment/
├── frontend/ # Next.js application
│ ├── src/
│ │ ├── app/ # App Router pages
│ │ ├── components/ # Reusable UI components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── lib/ # Utilities and configurations
│ │ ├── services/ # API services
│ │ ├── types/ # TypeScript definitions
│ │ └── validators/ # Zod validation schemas
│ ├── public/ # Static assets
│ └── docs/ # Frontend documentation
├── project-documentation/ # Comprehensive project docs
├── specs/ # Feature specifications
├── database/ # Migration tools and scripts
└── docs/ # General documentation
Development Workflow
Quick Start
- Environment Setup: Use official Supabase for development
- Frontend Development:
cd frontend && npm run dev - Database Management: Via Supabase dashboard and MCP tools
- Testing: Local testing with development environment
MCP Integration
- Supabase MCP: Full database operations and schema management
- GitHub MCP: Repository management and code operations
- Sentry MCP: Error tracking and monitoring
- Perplexity MCP: Research and documentation assistance
Deployment
Current Phase: Development on Hosted Supabase
- Backend: Official Supabase platform for rapid development
- Advantages: No infrastructure setup, managed scaling, built-in backup
Future Phase: Self-Hosted Supabase on VPS
- Infrastructure: Contabo VPS with Dockploy deployment
- Migration: Prepared scripts for zero-downtime migration
- Timeline: After development completion and validation
Monitoring & Observability
- Primary: Sentry for error tracking and performance monitoring
- Uptime: External monitoring service for availability
- Health Checks: Built-in system health monitoring
Documentation
Comprehensive documentation includes:
- Architecture: System design and component relationships
- API Reference: Complete API documentation
- Security Guide: Security best practices and RLS policies
- Deployment Guide: Step-by-step deployment instructions
- Development Guide: Local development setup and workflows
Contributing
This project follows modern development practices with:
- TypeScript: Full type safety across the codebase
- ESLint/Prettier: Code quality and formatting standards
- Testing: Unit and integration tests
- Documentation: Comprehensive inline and external docs
License
Private repository - All rights reserved.
Support
For development support, refer to the project documentation in the project-documentation/ directory or use the MCP tools for immediate assistance.
优点
- 实时订单跟踪增强透明度
- 基于角色的访问提高安全性
- 动态定价支持盈利能力分析
- 移动优先设计确保可访问性
缺点
- 仅限于B2B食品分销行业
- 需要Supabase作为后端功能
- 对新用户可能复杂
- 私有仓库限制社区贡献
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 sitechfromgeorgia.
