Boteco PRO is a modern, full-stack management system built for Brazilian bars and small restaurants ("botecos"). It's designed to handle everything from table management and order tracking to inventory control, recipes, and productionβall from a sleek, cross-platform interface that works on Android, iOS, and the web.
This is a complete production-ready architecture: a high-performance FastAPI backend connected to Microsoft SQL Server, paired with a feature-rich Flutter frontend that keeps your operation running smoothly.
Built by: Marcelo Santos
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Flutter 3.x + Dart | iOS, Android, Web PWA |
| Backend | FastAPI + Python 3.9+ | REST API with async support |
| Database | Microsoft SQL Server | Transactional data + complex business logic |
| Auth | JWT + bcrypt | Secure login & password hashing |
| Module | Status | What It Does |
|---|---|---|
| Dashboard | β | Real-time sales, active tables, stock alerts |
| Table Management | β | Live table status grid, quick order open/close |
| Product Catalog | β | Full CRUD, category filtering, instant stock adjustment |
| Suppliers | β | Contact registry + order tracking |
| Recipes & Formulas | β | Technical sheets, cost analysis, prep times |
| In-House Production | β | Batch tracking (in-progress β finished) |
| Offline-First Cache | β | Works without internet via SharedPreferences |
| Themes & UI | β | Material 3, Light/Dark modes, smooth animations |
| Employee Mgmt | β | Payroll, shift tracking, role-based access |
| Reporting | β | Financial summaries, stock movements, invoice history |
| Goal | Roadmap Item |
|---|---|
| Live Backend | Seamless API integrationβevery endpoint wired up to real SQL Server data instead of demo JSON |
| Auth & Roles | OAuth2/Google Sign-In β role-based dashboards (waiter vs. manager views) |
| Offline Sync | Upgrade from SharedPreferences to Isar database for robust offline-first experience with automatic sync |
| Reports & Exports | PDF/CSV generation for sales, inventory movements, and recipe cost breakdowns |
| KDS & Printing | Kitchen Display System via WebSocket + Bluetooth/ESC-POS thermal printer integration |
| Analytics | Trend analysis, peak hour detection, customer behavior insights |
- Flutter 3.19+ (stable channel) with Dart 3
- Python 3.9+ (for backend development)
- SQL Server 2019+ (local or cloud instance)
- Git & your favorite terminal
Verify your setup:
flutter --version
dart --version
python --versiongit clone https://github.com/marcelo-m7/FastAPI_Flutter.git
cd FastAPI_Fluttercd Backend/src/api
pip install -r requirements.txt
# Configure your connection
cp .env.example .env
# β Edit .env with your SQL Server credentials
# Start the dev server
uvicorn app.main:app --reloadAPI docs: Open http://localhost:8000/docs (interactive Swagger UI)
cd Frontend/src/v1.2
flutter pub getRun on Web:
flutter run -d chromeRun on Android/iOS:
flutter run # Pick your deviceFastAPI_Flutter/
βββ Backend/ # FastAPI + SQL Server
β βββ src/
β β βββ api/ # FastAPI application
β β β βββ app/
β β β β βββ main.py # Entry point
β β β β βββ db.py # SQL Server connection
β β β β βββ routers/ # API routes (auth, products, orders, etc.)
β β β βββ requirements.txt
β β βββ db/ # Database scripts
β β βββ init/ # Schema creation (11 SQL scripts)
β β βββ use_cases/ # Domain-specific procedures
β βββ docs/ # API docs & architecture guides
β
βββ Frontend/ # Flutter application
β βββ src/
β βββ v1.2/ # Latest stable version
β βββ lib/
β β βββ main.dart
β β βββ models/ # Data classes
β β βββ services/ # ApiService, DatabaseService
β β βββ pages/ # Full-screen views
β β βββ widgets/ # Reusable UI components
β βββ android/ # Android-specific code
β βββ ios/ # iOS-specific code
β βββ web/ # Web PWA assets
β βββ pubspec.yaml
β
βββ README.md # This file
Frontend:
- π Material Design 3 with adaptive light/dark theming inspired by Brazilian bar aesthetics
- π¬ flutter_animate for buttery-smooth transitions and micro-interactions
- π Offline-first architecture with SharedPreferences (upgrading to Isar)
- π i18n ready with pt_BR localization (Currency, dates, etc.)
Backend:
- β‘ FastAPI with async/await for handling high concurrent requests
- π JWT + bcrypt for secure, stateless authentication
- ποΈ Stored Procedures for complex business logic (orders, invoicing, payroll)
- π Triggers for automatic stock adjustments and materialized view updates
Database:
- π 10+ Views for comprehensive financial and operational reporting
- π Materialized Views with indexed performance optimization
- π Complex Queries (TVFs, scalar functions) for cost analysis & forecasting
- βοΈ Referential Integrity with 3NF normalization across 20+ tables
- π Role-based Access Control at database level
- Backend Setup Guide β API architecture, database schema, endpoints
- Frontend Architecture β UI structure, models, services & widgets
- API Specification β Complete OpenAPI/Swagger spec
- Database Schema β ER diagram, table relationships, indexes
- Database Setup Instructions β Step-by-step SQL Server configuration
The SQL Server backend includes:
- 11 initialization scripts in
Backend/src/db/init/that set up the complete schema - Use case procedures organized by domain (Gestor, Estoque, FuncionΓ‘rios, Pedidos)
- Complex triggers that auto-update stock and materialized views in real-time
- Financial views for sales, expenses, and profit reporting
FastAPI provides:
- 11 core routers for all business domains (auth, products, orders, invoices, etc.)
- Connection pooling to SQL Server for optimal performance
- CORS configuration for cross-origin requests from web/mobile clients
- Automatic Swagger documentation at
/docs
Flutter delivers:
- Responsive design that adapts from phone to tablet to desktop
- Offline capability with automatic sync when connection restored
- Dark mode support with Material 3 color system
- Accessibility features (semantic labels, high contrast options)
Contributions are welcome! Found a bug or have a feature idea?
- Open an issue describing the problem or feature request
- Fork the repo and create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes with clear messages (
git commit -m 'Add amazing feature') - Submit a pull request with a clear description
Code is released under the MIT License β see LICENSE.
This is a production-grade full-stack system that demonstrates:
- β Full database design and implementation (SQL Server)
- β Production-grade REST API (FastAPI)
- β Cross-platform mobile application (Flutter)
- β Complex business logic (orders, invoicing, payroll)
- β Real-world architectural patterns (3-tier, offline-first, async)
- Flutter & Dart teams for an amazing, productive framework
- Microsoft for SQL Server documentation and ODBC drivers
- FastAPI community for excellent async tooling and documentation
- Questions? Open a GitHub issue
- Found a bug? Create a detailed bug report with reproduction steps
- Want to collaborate? Reach out to Marcelo Santos
Built with β and π» by Marcelo Santos
"Keep it simple. Cold beer. Busy bar. Happy customers." β Boteco PRO