A comprehensive e-commerce management application with Flutter frontend and FastAPI backend, featuring WooCommerce integration, role-based access control, and real-time chat.
- Admin: Full system access, user management, credits assignment, sales reporting
- Operator: Invoice management, company management, product/stock management, installation calendar
- Store Manager: Seller management, sales reporting, installation management
- Seller: Product catalog, order registration, customer management, returns
- ✅ WooCommerce integration for products and categories
- ✅ Real-time chat with WebSocket support
- ✅ Role-based navigation and permissions
- ✅ Persian (RTL) language support
- ✅ Installation calendar with color coding
- ✅ Sales reports (day/month/year)
- ✅ Seller performance analytics
- ✅ Invoice management and PDF generation
- ✅ Returns management
- ✅ Company/supplier management
- ✅ Product catalog with tree categories
- ✅ Shopping cart with area-to-package conversion
- ✅ Order registration and tracking
TazeinDecor-Main/
├── backend/
│ ├── app/
│ │ ├── routers/ # API endpoints
│ │ ├── models.py # Database models
│ │ ├── schemas.py # Pydantic schemas
│ │ ├── database.py # Database setup
│ │ ├── config.py # Configuration
│ │ └── websocket_manager.py # WebSocket manager
│ ├── requirements.txt
│ └── .env.example
├── frontend/
│ ├── lib/
│ │ ├── pages/ # Flutter pages
│ │ ├── services/ # API services
│ │ ├── providers/ # State management
│ │ ├── models/ # Data models
│ │ └── utils/ # Utilities
│ ├── pubspec.yaml
│ └── .env.example
└── README.md
-
Navigate to backend directory:
cd backend -
Create virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create
.envfile:cp .env.example .env
Edit
.envand add your WooCommerce credentials and secret key. -
Run the server:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
-
Navigate to frontend directory:
cd frontend -
Install Flutter dependencies:
flutter pub get
-
Update API base URL: Edit
lib/config/app_config.dartand set the correct backend URL. -
Run the app:
flutter run
DATABASE_URL: Database connection stringSECRET_KEY: JWT secret key (min 32 characters)WOOCOMMERCE_URL: WooCommerce site URLWOOCOMMERCE_CONSUMER_KEY: WooCommerce API consumer keyWOOCOMMERCE_CONSUMER_SECRET: WooCommerce API consumer secretCORS_ORIGINS: Allowed CORS origins (comma-separated)
Update lib/config/app_config.dart:
baseUrl: Backend API URL (default: http://localhost:8000)
POST /api/auth/login- User loginGET /api/auth/me- Get current userGET /api/auth/version- Get app version
GET /api/products- Get products (with pagination, search, filters)GET /api/products/{id}- Get product detailsGET /api/products/categories- Get categories (tree structure)POST /api/products/sync- Sync from WooCommerce
POST /api/orders- Create orderGET /api/orders- Get orders (role-based)GET /api/orders/{id}- Get order detailsPUT /api/orders/{id}/confirm- Confirm order (Operator)
GET /api/chat- Get messagesPOST /api/chat- Send text messagePOST /api/chat/image- Send imagePOST /api/chat/voice- Send voiceDELETE /api/chat/{id}- Delete message (Admin/Operator)WS /api/chat/ws- WebSocket for real-time chat
GET /api/reports/sales- Sales reportGET /api/reports/seller-performance- Seller performance
GET /api/installations- Get installationsGET /api/installations/tomorrow- Get tomorrow's installationsPOST /api/installations- Create installationPUT /api/installations/{id}- Update installationDELETE /api/installations/{id}- Delete installation
You can create test users via the API or directly in the database. Default roles:
admin- Full accessoperator- Invoice and company managementstore_manager- Seller and sales managementseller- Product catalog and orders
-
Backend:
- Use PostgreSQL instead of SQLite
- Set strong
SECRET_KEY - Configure proper CORS origins
- Use environment variables for all secrets
- Set up SSL/TLS
-
Frontend:
- Build for production:
flutter build weborflutter build apk - Update API base URL to production backend
- Configure PWA settings in
web/manifest.json
- Build for production:
- Database errors: Ensure database file permissions or PostgreSQL connection
- WooCommerce sync fails: Check API credentials in
.env - WebSocket not working: Ensure WebSocket support in your server/proxy
- Packages not installing: Run
flutter cleanthenflutter pub get - API connection errors: Check backend URL in
app_config.dart - WebSocket connection fails: Verify WebSocket URL format (ws:// or wss://)
This project is proprietary software for TazeinDecor.
For issues and questions, please contact me.