La Casa del Bordadito is a single-module Android app built entirely with Kotlin, using Firebase as its backend. The project follows a feature-based package layout: each domain area (café menu, embroidery canvas, shopping cart, chat, etc.) lives in its own package and owns its activities, adapters, and data models. A sharedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/AndresLopezCorrales/La-casa-del-bordadito/llms.txt
Use this file to discover all available pages before exploring further.
ApplicationClass bootstraps cross-cutting concerns — online presence tracking and OneSignal push notifications — before any activity starts.
Navigation structure
The app entry point isOpcionesLogin (the launcher activity). After a user authenticates, MainActivity becomes the host for all primary navigation via a BottomNavigationView with five items. Four of those items load a Fragment directly into MainActivity; the fifth item (Taller) launches TallerActivity as a standalone screen.
FragmentInicio
Home screen with a promotional image slider and quick-access cards for featured café items.
FragmentCafe
Café menu browser, filterable by category, with add-to-cart and item detail navigation.
FragmentBordado
Embroidery canvas — loads cross-stitch patterns from Realtime Database and renders them on a custom
BordadoCanvasView.FragmentCuenta
Account hub for regular users (profile, payment methods, order history) and for admins (menu management, pattern management, workshop management).
TallerActivity is a standalone screen launched from the bottom-navigation area to display workshop information and flyers stored in Firebase Storage.
Activities
The full list of activities declared inAndroidManifest.xml:
| Activity | Purpose |
|---|---|
OpcionesLogin | Launcher — choose Email or Google sign-in |
Login_email | Email + password sign-in form |
Registro_email | New account registration |
VerificarEmailActivity | Email verification gate |
MainActivity | Primary host with BottomNavigationView |
DetalleCafeActivity | Full detail view for a café item |
CarritoActivity | Shopping cart review and checkout |
QRActivity | QR code display for order confirmation |
HistorialActivity | Order history list |
HistorialDetalleActivity | Order detail view |
ChatActivity | Real-time 1-on-1 chat screen |
ListaChatActivity | List of all chat conversations |
EditarPerfil | Edit display name and profile photo |
TarjetaAgregarActivity | Add a new credit/debit card |
AgregarCafeActivity | Admin: create or edit a café item |
TallerActivity | Workshop info and flyer viewer |
Fragments
| Fragment | Nav item | Responsibility |
|---|---|---|
FragmentInicio | Inicio (1st) | Home slider and featured items |
FragmentCafe | Cafe (2nd) | Browsable café menu with category filter |
FragmentBordado | Bordado (4th) | Cross-stitch pattern canvas |
FragmentCuenta | Cuenta (5th) | Account settings and admin tools |
TallerActivity directly.
Firebase backend services
Firebase Authentication
Manages user identity with Email/Password and Google Sign-In providers. The UID from
FirebaseAuth is used as the primary key across all other Firebase services.Firestore
Stores structured catalogue data: café items (
cafes), per-user shopping carts (carritos), and placed orders (ordenes).Realtime Database
Stores user profiles (
Usuarios), chat messages (Chats), unread counts (ChatsUnreadCount), embroidery patterns (patrones), and workshop info (TallerInfo).Firebase Storage
Hosts profile photos, images sent in chat, and the workshop promotional flyer.
ApplicationClass and makes direct REST calls to the OneSignal API via OkHttp (see Notifications).
ApplicationClass
ApplicationClass extends Android’s Application class and is declared as the app-level android:name in AndroidManifest.xml. It runs two things at startup:
- OneSignal SDK initialization — reads
BuildConfig.ONESIGNAL_APP_IDand callsOneSignal.initWithContext(), then requests notification permission on a background coroutine. - Online-presence tracking — registers
ActivityLifecycleCallbacksto writeonline = trueto Realtime Database when the app comes to the foreground, andonline = falsewhen it goes to the background.
onDisconnect().setValue(false) call ensures the online flag is cleared even if the device loses connectivity without gracefully stopping the app.
Constantes object
Constantes is a Kotlin object (singleton) that centralises shared utility functions and message-type constants used across the codebase.
MENSAJE_TIPO_TEXTO/MENSAJE_TIPO_IMAGEN— type discriminators stored in eachChatdocument.obtenerFecha/obtenerFechaHora— format epoch milliseconds for display in the order history and chat UI.rutaChat— deterministically generates a shared chat room path for any two users (see Data Model).
Package structure
The Firebase Functions file (
functions/index.js) is present in the repository and contains a welcome-email function (enviarCorreoBienvenida) triggered by a Realtime Database onCreate event on the /Usuarios/{uid} path, but it is not currently deployed. All core business logic — cart management, order placement, notification dispatch — runs client-side in the Android app.