La Previa Restobar is a full-stack Android restaurant management system built with Kotlin and Jetpack Compose. It replaces paper-based order tickets and disconnected spreadsheets with a single, real-time platform that keeps the dining room, kitchen, and administration in perfect sync — even when the internet drops.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/luisumit/LaPreviaRestobar/llms.txt
Use this file to discover all available pages before exploring further.
What the app does
La Previa Restobar is a role-based point-of-sale and kitchen management system. A Mesero (Waiter) selects a table, builds an order from the live product menu, and sends it straight to the kitchen display. A Cocinero (Chef) receives incoming orders in real time, advances each one through the preparation pipeline (ENVIADO → ACEPTADO → EN_PREPARACION → LISTO → ENTREGADO), and triggers automatic inventory deductions. An Admin manages the product catalogue, monitors live dashboard metrics, views sales reports by day/week/month/year, and exports PDF or CSV reports to the device’s Downloads folder.
Every write is persisted to Room first, so orders are never lost when the network is unavailable. WorkManager’s SyncWorker replays any pending changes to Firebase the moment connectivity is restored.
The three user roles
| Role | Spanish label | Primary responsibilities |
|---|---|---|
| Waiter | Mesero | Browse tables, create orders, track order status, free tables |
| Chef | Cocinero | Accept orders, update preparation status, manage inventory deductions |
| Admin | Administrador | Product CRUD, sales reporting, dashboard metrics, report export |
AppNavigation routes each authenticated user directly to their own scoped screen graph (waiter_main, chef_main, or admin_main) based on the UserRole sealed class value stored in Firebase Auth and the local UserPreferencesRepository.
Key technologies
| Technology | Version | Role |
|---|---|---|
| Kotlin | 2.2.10 | Primary language |
| Jetpack Compose + Material 3 | BOM 2024.06.00 | Declarative UI |
| Hilt | 2.57.1 | Dependency injection |
| Firebase Realtime Database | BOM 33.1.2 | Remote data & real-time listeners |
| Firebase Auth | BOM 33.1.2 | Authentication & role identity |
| Room | 2.8.4 | Offline-first local persistence |
| WorkManager | 2.9.1 | Background sync via SyncWorker |
| Retrofit + OkHttp | 2.11.0 / 4.12.0 | REST API calls to the Express.js backend |
| Timber | 5.0.1 | Debug-only structured logging |
| KSP | — | Annotation processing for Room & Hilt |
Architecture overview
The codebase follows Clean Architecture with three clearly separated layers:- Presentation — Jetpack Compose screens and
@HiltViewModelclasses. Each role has its own ViewModel (WaiterViewModel,ChefViewModel,AdminViewModel) plus shared cross-cutting ViewModels (SharedViewModel,LoginViewModel,InventoryViewModel,SyncViewModel). - Domain — Use-case classes (
CreateOrderUseCase,GetProductsUseCase,GetTablesUseCase,UpdateOrderStatusUseCase,CreateProductUseCase,UpdateProductUseCase,DeleteProductUseCase) that contain all business logic and depend only on abstract repository interfaces. - Data — Concrete repository implementations backed by two sources: Room (
AppDatabasewith four DAOs) and Firebase (FirebaseOrderRepositoryImpl,FirebaseProductRepositoryImpl,FirebaseTableRepositoryImpl,FirebaseInventoryRepositoryImpl). TheUnifiedOrderRepository,UnifiedProductRepository,UnifiedTableRepository, andUnifiedInventoryRepositoryclasses merge both sources with a local-first emission strategy.
Explore the documentation
Quickstart
Clone the repo, configure Firebase, and run the app in under 10 minutes.
Architecture
Deep-dive into the Clean Architecture layers, DI modules, and offline sync flow.
User Roles
Detailed breakdown of Mesero, Cocinero, and Admin capabilities and screens.
API Overview
REST and WebSocket endpoints exposed by the Express.js backend.
Feature highlights
Real-Time Order Tracking
Firebase Realtime Database listeners push order-status changes (
ENVIADO, ACEPTADO, EN_PREPARACION, LISTO, ENTREGADO) to all connected clients instantly.Offline-First Architecture
Every write lands in Room with
syncStatus = "PENDING". SyncWorker uploads pending changes hourly (or immediately on network restoration) using exponential backoff.Automatic Inventory Deduction
When a Chef accepts an order (
OrderStatus.ACEPTADO), ChefViewModel deducts item quantities from both Firebase Realtime Database and Room. Low-stock alerts surface in the Admin dashboard.Multi-Role Authentication
Firebase Auth provides per-user credentials. The
UserRole sealed class (MESERO, COCINERO, ADMIN) is stored in UserPreferencesRepository and drives AppNavigation routing with protected composable routes.Sales Reporting & Export
AdminViewModel builds SalesReport objects filtered by day, week, month, year, or custom date range. Reports export to PDF (PdfDocument) or CSV, saved to Downloads/LaPreviaReportes/.Security & Obfuscation
R8 minification and resource shrinking are enabled in the
release build type. Timber logs are suppressed in non-debug builds. Sensitive files (google-services.json, serviceAccountKey.json) are git-ignored.