How sebasquintero123/mistockerapp works
1) Overall shape
MiStockerApp is a single Android client module built in Kotlin with Jetpack Compose. The repository does not contain a custom server; the app talks directly to Firebase services for identity and persistence. That makes the architecture centered on the UI/navigation layer plus cloud-backed storage and authentication.
2) App entry point
MainActivity.kt is the Android entry point. Its job is to bootstrap the Compose UI and hand control to the app-level navigation. The manifest and Android resources define the standard Android runtime setup, launcher icon, theme, and app metadata.
3) Navigation boundary
AppNavigation.kt is the main screen router. It coordinates transitions across the app’s functional areas: login/registration, home dashboard, product management, stock viewing, and sales. For an architecture diagram, this is the hub that connects otherwise separate Compose screens.
4) Authentication and account lifecycle
The auth flow is split into dedicated screens:
• LoginScreen.kt
• RegistroScreen.kt
• RecuperarScreen.kt
• VerificacionScreen.kt
These screens form the user onboarding and account recovery boundary. The README indicates Firebase Authentication and email verification are used, so this subsystem depends on Firebase rather than local credential storage.
5) Inventory management subsystem
Product CRUD lives in the inventory screens:
• RegistrarProductoScreen.kt
• EditarProductoScreen.kt
• StockScreen.kt
This subsystem covers creating, updating, deleting, and listing products. It is the main operational flow for maintaining stock records and likely reads/writes user-scoped product documents in Firestore.
6) Sales subsystem
VentasScreen.kt handles sales capture, including multi-product sales and sales history per the README. This is a separate business flow from product maintenance, but it likely reuses product data from Firestore to calculate totals, stock impact, and history entries.
7) Home/dashboard layer
HomeScreen.kt acts as the application landing page after authentication. The README describes it as a financial dashboard with investment, stock, gains, and available units. Architecturally, this screen is an aggregator: it summarizes data from products and sales rather than owning the underlying records.
8) Data model and persistence
Producto.kt is the primary domain model present in the repo tree. The README shows the Firestore structure as user-scoped collections under usuarios/{uid}/productos and usuarios/{uid}/ventas. That means data is partitioned by authenticated user, and the app’s persistence boundary is Firebase Firestore. The included google-services.json confirms Firebase is wired into the Android app.
9) External services and device capabilities
Two external dependencies materially shape the architecture:
• Firebase Authentication for login, registration, password recovery, and verification.
• Firebase Firestore for persistent inventory and sales data.
• Google ML Kit Code Scanner for barcode scanning during product registration.
The barcode scanner is a device-facing capability embedded into the product workflow, not a standalone subsystem.
10) Shared UI and design system
Components.kt contains reusable Compose UI pieces, while OldDesignComponents.kt suggests a legacy component set kept alongside the newer one. The ui/theme folder defines color, typography, and theme configuration. This shared presentation layer reduces duplication across the multiple screens.
11) Project and platform boundaries
This is a conventional Android Gradle project (app/build.gradle.kts, root build.gradle.kts, version catalog, wrapper). The architecture is client-side only: UI, navigation, and cloud integration live in the app module. Testing is present via androidTest and test, but there is no separate backend, API gateway, or domain service layer in the repo.
12) How the main data flows connect
Typical flow is:
1. User authenticates through Firebase Authentication.
2. Navigation moves into the home/dashboard.
3. Product screens create/update Firestore product documents.
4. Sales screens read products, register sales, and update related records.
5. Home/dashboard aggregates product and sales data into business summaries.
For a diagram, the strongest boundaries are: Compose UI/screens, navigation, Firebase Auth, Firestore persistence, and the barcode-scanning device integration.
Main entry points: AppNavigation.kt Navigation · Components.kt Components · RegistrarProductoScreen.kt Registrar Producto · google-services.json Firestore
Components 19
App Shell
Android entry, navigation, and app-wide presentation
- MainActivity · Bootstraps the Compose app and hands off to navigation
app/src/main/java/com/example/mystockerapp/MainActivity.kt - Navigation · Routes between auth, home, inventory, stock, and sales screens
app/src/main/java/com/example/mystockerapp/AppNavigation.kt - Home · Authenticated landing page and business summary view
app/src/main/java/com/example/mystockerapp/HomeScreen.kt
Auth Flow
Login, signup, recovery, and verification screens
- Login · User sign-in flow
app/src/main/java/com/example/mystockerapp/LoginScreen.kt - Registro · Account registration flow
app/src/main/java/com/example/mystockerapp/RegistroScreen.kt - Recuperar · Password recovery flow
app/src/main/java/com/example/mystockerapp/RecuperarScreen.kt - Verificacion · Email or account verification step
app/src/main/java/com/example/mystockerapp/VerificacionScreen.kt
Inventory
Product CRUD and stock management
- Registrar Producto · Creates new product records and supports barcode capture
app/src/main/java/com/example/mystockerapp/RegistrarProductoScreen.kt - Editar Producto · Updates existing product records
app/src/main/java/com/example/mystockerapp/EditarProductoScreen.kt - Stock · Lists and tracks product stock
app/src/main/java/com/example/mystockerapp/StockScreen.kt - Producto · Shared product data structure
app/src/main/java/com/example/mystockerapp/Producto.kt
Sales
Sales capture and history
- Ventas · Captures sales and shows sales history
app/src/main/java/com/example/mystockerapp/VentasScreen.kt
Shared UI
Reusable UI and theme definitions
- Components · Reusable Compose building blocks
app/src/main/java/com/example/mystockerapp/Components.kt - Old Design · Older reusable component set retained in the codebase
app/src/main/java/com/example/mystockerapp/OldDesignComponents.kt - Theme · App colors, typography, and theme setup
app/src/main/java/com/example/mystockerapp/ui/theme/Theme.kt
Cloud & Platform
Firebase and Android runtime boundaries
- Firebase Auth · Authentication, registration, recovery, and verification backend
app/google-services.json - Firestore · Per-user persistence for products and sales
app/google-services.json - Code Scanner · Barcode scanning used in product registration
app/build.gradle.kts - Manifest · Android runtime metadata and launcher configuration
app/src/main/AndroidManifest.xml
Connections 32
- MainActivity → Navigation: starts · Main activity launches the app router
- Navigation → Login: routes · Navigation can enter the authentication flow
- Navigation → Registro: routes · Navigation can enter registration
- Navigation → Recuperar: routes · Navigation can enter password recovery
- Navigation → Verificacion: routes · Navigation can enter verification
- Navigation → Home: routes · Navigation reaches the authenticated dashboard
- Navigation → Registrar Producto: routes · Navigation opens product creation
- Navigation → Editar Producto: routes · Navigation opens product editing
- Navigation → Stock: routes · Navigation opens stock browsing
- Navigation → Ventas: routes · Navigation opens sales capture
- Login → Firebase Auth: auth · Sign-in uses Firebase Authentication
- Registro → Firebase Auth: auth · Account creation uses Firebase Authentication
- Recuperar → Firebase Auth: auth · Password recovery uses Firebase Authentication
- Verificacion → Firebase Auth: auth · Verification depends on Firebase Authentication
- Registrar Producto → Producto: uses · Product form reads and writes the domain model
- Editar Producto → Producto: uses · Edit flow updates the domain model
- Stock → Producto: lists · Stock view displays product records
- Ventas → Producto: reads · Sales flow reuses product data for selection and totals
- Registrar Producto → Firestore: writes · New products are persisted in Firestore
- Editar Producto → Firestore: updates · Edited products are persisted in Firestore
- Stock → Firestore: reads · Stock view loads user-scoped product data
- Ventas → Firestore: reads/writes · Sales flow reads products and stores sales records
- Home → Firestore: aggregates · Dashboard summarizes product and sales data
- Registrar Producto → Code Scanner: scans · Barcode scanning supports product registration
- MainActivity → Manifest: declared by · Android entry point is configured by the manifest
- Components → Login: supports · Shared UI primitives are reused across screens
- Components → Home: supports · Shared UI primitives are reused across screens
- Components → Registrar Producto: supports · Shared UI primitives are reused across screens
- Components → Ventas: supports · Shared UI primitives are reused across screens
- Old Design → Components: legacy · Older design components coexist with the newer set
- Theme → Components: styles · Theme config shapes shared UI appearance
- Theme → Home: styles · Theme config applies to app screens