- What is Sentinel?
- Understanding Convenience Store Operations
- Key Features
- System Architecture
- Installation & Setup
- Usage Guide
- API Documentation
- Contributing
- License
Sentinel is a comprehensive AI-powered inventory and operations management system designed specifically for convenience stores and small retail businesses. Originally developed for Daily Delights, a convenience store in Singapore, this system automates the complex daily tasks that store owners face, from tracking inventory to processing payments and generating intelligent restocking recommendations.
Think of it as your digital store assistant that works 24/7 to keep your business running smoothly!
1. Inventory Management ποΈ
- Tracking hundreds of products manually
- Knowing when to reorder items before running out
- Managing supplier relationships and delivery schedules
- Calculating profit margins on each product
2. Financial Tracking π°
- Recording daily sales from multiple payment methods (cash, card, mobile payments)
- Tracking supplier invoices and payment due dates
- Reconciling daily cash register totals
- Managing accounts payable to suppliers
3. Daily Operations π
- Processing customer transactions
- Updating inventory after deliveries
- Analyzing sales patterns to optimize stock
- Handling payment processing across different methods
- Morning: Count cash, check inventory levels
- Throughout Day: Serve customers, receive deliveries, update stock manually
- Evening: Count cash register, record sales, note items running low
- Weekly: Review what needs to be ordered, process supplier payments
- Automated inventory tracking with AI-powered reorder suggestions
- Digital invoice processing that extracts data from photos
- Smart payment management with automated due date tracking
- Real-time sales analytics and profit monitoring
- Telegram bot integration for mobile operations
- Smart Reorder Recommendations: AI analyzes sales patterns to suggest optimal reorder quantities and timing
- Supplier Relationship Management: Track delivery schedules and payment terms for each supplier
- Automated Stock Alerts: Get notified when items are running low
- Profit Optimization: Calculate best-selling items and profit margins
- Telegram Bot Integration: Upload invoices and daily closing reports via mobile
- Photo-to-Data Processing: AI extracts invoice details from photos automatically
- Remote Monitoring: Check store status from anywhere
- Multi-Payment Tracking: Handle cash, NETS (Singapore's payment system), credit cards, and QR payments
- Daily Book Closing: Automated reconciliation of daily sales across all payment methods
- Supplier Payment Tracking: Monitor invoice due dates and payment status
- Financial Analytics: Understand cash flow and profitability trends
- Real-time Analytics: Track sales, inventory levels, and financial health
- Interactive Reports: Visual charts and graphs for easy understanding
- Historical Trends: Analyze performance over time
- Export Capabilities: Generate reports for accounting or analysis
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Telegram Bot β β Web Dashboard β β Google Drive β
β (Mobile UI) β β (Admin UI) β β (Storage) β
βββββββββββ¬ββββββββ βββββββββββ¬ββββββββ βββββββββββ¬ββββββββ
β β β
β β β
ββββββββββββββββββββββββΌβββββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββββ
β Flask Backend β
β (Core Application) β
βββββββββββββββ¬ββββββββββββββ
β
βββββββββββββββΌββββββββββββββ
β SQLite Database β
β (Data Storage) β
βββββββββββββββββββββββββββββ
-
Flask Web Application (
app.py)- Main dashboard for store management
- RESTful API endpoints for data operations
- User authentication and session management
-
AI Recommendation Engine (
orderRecommendations/)- Analyzes sales patterns and inventory levels
- Generates intelligent reorder suggestions
- Optimizes supplier ordering schedules
-
Telegram Bot (
telegramBot.py)- Mobile interface for quick operations
- Photo upload for invoices and daily reports
- Google Drive integration for document storage
-
Data Processing Modules
- Invoice Processing: AI-powered data extraction from photos
- Sales Analysis: Pattern recognition and trend analysis
- Payment Integration: UOB bank email processing for automated payment tracking
- Python 3.8 or higher
- Gmail account for Google Drive integration
- Telegram Bot Token (for mobile features)
- Basic understanding of command line operations
git clone https://github.com/yourusername/sentinel.git
cd sentinelpip install -r requirements.txtCreate a .env file in the root directory:
# Telegram Bot Configuration
BOT_TOKEN=your_telegram_bot_token_here
# Google Drive API (Optional - for document storage)
GOOGLE_DRIVE_FOLDER_ID=your_folder_id
# Together AI API (Optional - for advanced AI features)
TOGETHER_API_KEY=your_together_api_key# Initialize the database
python3 create_product_table.py# Start the web application
python3 app.py
# In a separate terminal, start the Telegram bot (optional)
python3 telegramBot.pyOpen your web browser and navigate to: http://localhost:5000
- Login to the web dashboard
- Add Your Products: Go to Inventory β Add items with names, categories, and prices
- Configure Suppliers: Add supplier information in the Payments section
- Initial Inventory Count: Set current stock levels for all products
Morning Routine:
- Check the Dashboard for overnight insights
- Review Order Recommendations for today's deliveries
- Use Telegram Bot to upload any new invoices received
During the Day:
- Customers make purchases (external POS system handles transactions)
- Receive supplier deliveries
- Upload Invoice Photos via Telegram bot
Evening Routine:
- Upload Daily Closing Report via Telegram bot
- Review Daily Book Closing page to reconcile payment methods
- Check Inventory Levels and note any discrepancies
- Review Analytics: Check sales trends and profit margins
- Process Payments: Review supplier invoices due for payment
- Plan Orders: Use AI recommendations to plan next week's orders
- Inventory Audit: Compare system inventory with physical count
- Receive Invoice from supplier (physical or digital)
- Take Photo of invoice using phone
- Send to Telegram Bot using
/upload_invoicescommand - AI Extracts Data automatically (supplier, items, quantities, prices)
- Review and Confirm data in web dashboard
- Update Inventory levels automatically
- Count Cash Register at end of day
- Take Photo of daily sales report from POS system
- Send to Telegram Bot using
/upload_dailybookclosingcommand - System Processes payment method breakdowns
- Reconcile Amounts in Daily Book Closing page
- Generate Insights for next day operations
- Sales Overview: Today's revenue across all payment methods
- Low Stock Alerts: Items that need immediate attention
- Payment Reminders: Supplier invoices due soon
- Quick Actions: Fast access to common tasks
- Product Catalog: All items with current stock levels
- Stock Movements: Track deliveries and sales
- Price Management: Update costs and selling prices
- Barcode Support: Link products to barcode scanning
- Supplier Invoices: All received invoices with status
- Payment Tracking: Due dates and payment history
- Data Extraction: AI-processed invoice details
- Search and Filter: Find specific invoices quickly
- Outstanding Payments: Invoices waiting for payment
- Payment History: Record of all supplier payments
- Due Date Management: Automated reminders and alerts
- Payment Method Tracking: Cash, bank transfer, check records
- Daily Sales Summary: Revenue breakdown by payment method
- Cash Reconciliation: Compare POS totals with actual cash
- Payment Method Analysis: NETS, credit, cash breakdowns
- Historical Trends: Compare with previous days/weeks
- AI Suggestions: Smart reorder recommendations
- Supplier Schedules: Optimal ordering calendar
- Stock Predictions: Forecasted inventory needs
- Cost Optimization: Best value ordering strategies
- Daily Cash Records: Complete denomination-by-denomination cash counts
- Date Range Filtering: View cash records for specific periods
- Bills vs Coins Totals: Separate tracking of paper money and coin totals
- Bulk Operations: Delete individual or multiple cash records
- Mobile Integration: Records created via Telegram bot
/cash_denominationcommand - Audit Trail: Track when records were created and by whom
All API endpoints require session-based authentication through the web interface.
GET /api/inventory
POST /api/inventory/add
PUT /api/inventory/edit/{id}
DELETE /api/inventory/delete/{id}GET /api/invoices
POST /api/invoices/add
GET /api/invoices/search?q={query}GET /api/payments
POST /api/payments/add
PUT /api/payments/edit/{id}GET /api/daily-book-closing
POST /api/daily-book-closing/addGET /api/order-recommendations?date={YYYY-MM-DD}
GET /api/order-recommendations/14-day-schedule?start_date={YYYY-MM-DD}GET /api/cash-denomination
GET /api/cash-denomination?start_date={YYYY-MM-DD}&end_date={YYYY-MM-DD}
POST /api/cash-denomination/add
PUT /api/cash-denomination/edit/{id}
DELETE /api/cash-denomination/delete/{id}
POST /api/bulk-delete/cash-denomination/start - Initialize the bot
/upload_invoices - Upload supplier invoice photos
/upload_dailybookclosing - Upload daily sales reports
/cash_denomination - Record daily cash count by denomination
/help - Show available commands
The /cash_denomination command provides a streamlined mobile interface for recording daily cash counts by denomination, essential for end-of-day reconciliation.
Features:
- Date Selection: Choose any date (past 7 days, today, next 3 days, or custom date)
- Sequential Flow: Input cash counts in logical order (AUD $100 β $50 β $10 β $5 β $2 β $1 β 50Β’ β 20Β’ β 10Β’ β 5Β’)
- Real-time Calculations: Automatic calculation of totals for each denomination
- Duplicate Prevention: Prevents duplicate entries for the same date
- Web Dashboard Integration: View and manage cash denomination records through the Cash Management page
Usage Workflow:
- Send
/cash_denominationcommand to the bot - Select desired date from quick options or enter custom date
- Enter quantity for each cash denomination when prompted
- Review and confirm the calculated totals
- Data is automatically saved and viewable in the web dashboard
Supported Denominations (Australian Currency):
- Bills: $100, $50, $10, $5, $2
- Coins: $1, 50Β’, 20Β’, 10Β’, 5Β’
We welcome contributions from developers interested in retail technology and AI applications!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests if applicable
- Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- AI/ML Improvements: Enhance recommendation algorithms
- Mobile App Development: Native iOS/Android apps
- Payment Integrations: Additional payment gateway support
- Reporting Features: Advanced analytics and insights
- Multi-language Support: Internationalization
- Performance Optimization: Database and API improvements
- Backend: Python Flask, SQLAlchemy
- Database: SQLite (easily upgradeable to PostgreSQL/MySQL)
- Frontend: HTML, CSS, JavaScript, Bootstrap, DataTables
- AI/ML: Pandas, NumPy for data analysis
- Mobile Interface: Telegram Bot API
- Cloud Storage: Google Drive API
- Authentication: Google OAuth2
- Data Processing: Pydantic for validation, PIL for image processing
- All sensitive data is stored locally in SQLite database
- Google Drive integration uses OAuth2 for secure authentication
- Telegram bot requires token-based authentication
- Session-based authentication for web interface
- No credit card or sensitive financial data stored
- Barcode Scanning Integration: Mobile barcode scanning for inventory
- Advanced Analytics: Sales forecasting and trend analysis
- Multi-store Support: Manage multiple store locations
- Automated Reporting: Email/SMS daily/weekly reports
- Mobile Apps: Native iOS and Android applications
- Advanced AI: Machine learning for demand prediction
- Supplier Integration: Direct API connections with suppliers
- Customer Analytics: Track customer purchase patterns
- Franchise Management: Multi-location dashboard
- E-commerce Integration: Online store management
- Advanced Financial Analytics: Profit optimization tools
- Industry Integrations: POS system partnerships
- Documentation: Comprehensive guides in
/docsfolder - Issues: Report bugs and request features via GitHub Issues
- Discussions: Join community discussions in GitHub Discussions
- Email: Contact maintainers at [email protected]
- Discord: Join our developer community
- Newsletter: Get updates on new features and releases
- Blog: Read case studies and implementation guides
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for GPT-based text processing capabilities
- Google for Drive API and authentication services
- Telegram for bot platform and mobile integration
- Flask Community for the excellent web framework
- Bootstrap for responsive UI components
Made with β€οΈ for small business owners who deserve powerful, affordable technology.
"Empowering every convenience store with AI-driven insights and automation." Originally developed for Daily Delights convenience store, Singapore
Main dashboard showing key metrics, quick actions, and system overview
Dashboard analytics section with charts and performance indicators
Comprehensive product catalog with stock levels, pricing, and search functionality
Supplier invoice tracking with AI-powered data extraction and payment status
Supplier payment management with due dates and payment history
Daily cash denomination tracking with mobile integration and date filtering
End-of-day reconciliation with payment method breakdowns and analytics
Smart reorder suggestions based on sales patterns and inventory optimization
β If this project helps your business, please consider giving it a star!