How javohir-g/gilamchi works
Gilamchi is a carpet-shop inventory and sales system: sellers authenticate, manage stock, build a basket and record sales; administrators manage branches, staff, finances and reporting. The frontend routes users to role-specific screens, while shared application state calls a REST API. The backend exposes domain routers backed by SQLAlchemy models and a configured database. Product image search and Telegram Web App entry are additional capabilities. Some frontend-to-backend links are shown as unverified because the excerpts do not demonstrate the HTTP wiring across both sides.
Main entry points: main.py API application · api.ts API client · database.py SQL database · App.tsx Role-based app
Components 23
Web application
- Role-based app
frontend/src/app/App.tsx - Selling and debts
frontend/src/app/components/seller - Inventory management
frontend/src/app/components/inventory/Inventory.tsx - Admin operations
frontend/src/app/components/admin - Shared app state
frontend/src/app/context/AppContext.tsx - API client
frontend/src/services/api.ts
Backend API
- API application
backend/app/main.py - Authentication
backend/app/routers/auth.py - Products and search
backend/app/routers/products.py - Sales
backend/app/routers/sales.py - Debts
backend/app/routers/debts.py - Expenses
backend/app/routers/expenses.py - Collections
backend/app/routers/collections.py - Branches
backend/app/routers/branches.py - Staff and settings
backend/app/routers - Telegram enrollment
backend/app/routers/telegram.py
Persistence and services
- SQL database
backend/app/database.py - Product records
backend/app/models/product.py - Image embeddings
backend/app/utils/image_embedding.py
External integrations
- Telegram bot
backend/app/utils/bot_service.py
Other components
- Seller
- Administrator
- Telegram user
Connections 39
- Seller → Role-based app: uses
- Administrator → Role-based app: uses
- Role-based app → Selling and debts: routes to
frontend/src/app/App.tsx - Role-based app → Admin operations: routes to
frontend/src/app/App.tsx - Role-based app → Inventory management: routes to
frontend/src/app/App.tsx - Selling and debts → Shared app state: uses
frontend/src/app/components/seller/AddProduct.tsx - Inventory management → Shared app state: uses
frontend/src/app/components/inventory/Inventory.tsx - Admin operations → Shared app state: uses
frontend/src/app/components/admin/BranchDetail.tsx - Shared app state → API client: calls
frontend/src/app/context/AppContext.tsx - API client → Authentication: HTTP requests
- API client → Products and search: HTTP requests
- API client → Sales: HTTP requests
- API client → Debts: HTTP requests
- API client → Expenses: HTTP requests
- API client → Collections: HTTP requests
- API client → Branches: HTTP requests
- API client → Staff and settings: HTTP requests
- API application → Authentication: registers router
backend/app/main.py - API application → Branches: registers router
backend/app/main.py - API application → Products and search: registers router
backend/app/main.py - API application → Sales: registers router
backend/app/main.py - API application → Debts: registers router
backend/app/main.py - API application → Expenses: registers router
backend/app/main.py - API application → Collections: registers router
backend/app/main.py - API application → Staff and settings: registers routers
backend/app/main.py - API application → Telegram enrollment: registers router
backend/app/main.py - API application → SQL database: creates tables
backend/app/main.py - API application → Telegram bot: starts bot
backend/app/main.py - Products and search → SQL database: queries
backend/app/routers/products.py - Sales → SQL database: queries
backend/app/routers/sales.py - Debts → SQL database: queries
backend/app/routers/debts.py - Expenses → SQL database: queries
backend/app/routers/expenses.py - Collections → SQL database: queries
backend/app/routers/collections.py - Branches → SQL database: queries
backend/app/routers/branches.py - Products and search → Product records: uses model
backend/app/routers/products.py - Products and search → Image embeddings: extracts embeddings
backend/app/routers/products.py - Product records → SQL database: persisted by
- Telegram user → Telegram bot: starts chat
backend/app/utils/bot_service.py - Telegram bot → Telegram enrollment: supports enrollment
backend/app/utils/bot_service.py