Skip to content

Another version of the Restaurant Management Plataform, this time made with Python FastAPI + Dart Flutter.

Notifications You must be signed in to change notification settings

marcelo-m7/FastAPI_Flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍻 Boteco PRO – Enterprise Bar Management System

Flutter 3 FastAPI SQL Server License: MIT


🎯 What is Boteco PRO?

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


πŸš€ Stack Overview

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

✨ Feature Breakdown

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

πŸ—ΊοΈ What's Coming Next

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

⚑ Quick Start

Prerequisites

  • 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 --version

1️⃣ Clone & Setup

git clone https://github.com/marcelo-m7/FastAPI_Flutter.git
cd FastAPI_Flutter

2️⃣ Backend Setup (FastAPI)

cd 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 --reload

API docs: Open http://localhost:8000/docs (interactive Swagger UI)

3️⃣ Frontend Setup (Flutter)

cd Frontend/src/v1.2
flutter pub get

Run on Web:

flutter run -d chrome

Run on Android/iOS:

flutter run    # Pick your device

πŸ“‚ Project Architecture

FastAPI_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

🎨 Tech Highlights

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

πŸ“š Documentation


πŸ”‘ Key Components Explained

Database Layer

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

API Layer

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

Mobile/Web Frontend

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)

🀝 Contributing & Support

Contributions are welcome! Found a bug or have a feature idea?

  1. Open an issue describing the problem or feature request
  2. Fork the repo and create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes with clear messages (git commit -m 'Add amazing feature')
  4. Submit a pull request with a clear description

Code is released under the MIT License – see LICENSE.


πŸ“ Project Status

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)

πŸ™Œ Credits & Acknowledgements

  • Flutter & Dart teams for an amazing, productive framework
  • Microsoft for SQL Server documentation and ODBC drivers
  • FastAPI community for excellent async tooling and documentation

πŸ“§ Contact & Support

  • 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

About

Another version of the Restaurant Management Plataform, this time made with Python FastAPI + Dart Flutter.

Topics

Resources

Stars

Watchers

Forks