Introduction to TecMeli
TecMeli is a robust Android client for Mercado Libre, designed following Senior Engineering standards. It implements a modular, secure, and highly scalable architecture that demonstrates best practices in modern Android development.What is TecMeli?
TecMeli is a production-ready Android application that provides:- Advanced Product Search: Real-time product discovery with reactive state management
- Detailed Product Views: Image galleries, technical specifications, and descriptions
- Secure OAuth 2.0 Authentication: Automatic session management with background token refresh
- Modern UI: Fluid interface built entirely with Jetpack Compose and Material 3
- Robust Network Layer: Safe API call executor with semantic error mapping
This project was built as a demonstration of Clean Architecture principles and modern Android development best practices, making it an excellent learning resource for Android developers.
Technology Stack
TecMeli leverages the latest and most powerful tools in the Android ecosystem:| Area | Technologies |
|---|---|
| Language | Kotlin + Coroutines + Flow |
| UI | Jetpack Compose + Material 3 |
| Dependency Injection | Dagger Hilt |
| Networking | Retrofit + OkHttp + Gson |
| Architecture | Clean Architecture + MVVM |
| Testing | MockK + MockWebServer + JUnit |
Key Dependencies
From the project’slibs.versions.toml:
Architecture Overview
TecMeli implements Clean Architecture optimized for Mercado Libre’s authentication flow. The application is structured in three main layers:1. Presentation Layer (ui)
Built entirely with Jetpack Compose, featuring:
- Home screen with product search
- Product detail screen with image gallery
- Navigation using Navigation 3
- Material 3 theming
2. Domain Layer (domain)
Contains pure business logic:
- Models: Domain entities like
ProductandProductDetail - Use Cases: Business operations like
GetProductsUseCase - Repository Interfaces: Contracts for data access
3. Data Layer (data)
Handles data operations:
- Remote APIs: Retrofit interfaces for Mercado Libre API
- DTOs: Data transfer objects for network responses
- Mappers: Convert DTOs to domain models
- Repository Implementations: Concrete implementations of domain contracts
State Management
TecMeli uses a sealed classUiState<T> to represent all possible UI states:
UiState.kt
- Type Safety: Compile-time guarantees about state handling
- Exhaustive When: Ensures all states are handled in UI
- Reactive Updates: Automatic UI updates via StateFlow
Security & Authentication
TecMeli implements OAuth 2.0 with automatic token refresh:Request Interception
Every request to the Mercado Libre API automatically includes the access token via
AuthInterceptorAuthentication Challenge
When the server returns a
401 Unauthorized, the TokenAuthenticator intercepts the responseAuthInterceptor.kt
Project Structure
What’s Next?
Now that you understand what TecMeli is and its architecture, let’s get it running on your machine:Installation
Set up your development environment and clone the project
Configuration
Configure API credentials and build the application