Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rate Flow

Rate Flow is a native Android currency exchange calculator for converting between USDc and a selected fiat currency.

The app is built with Kotlin, Jetpack Compose, Material 3, MVVM, Koin, Coroutines, Flow, Retrofit, and a pragmatic clean architecture package structure.

Features

  • Enter an amount in either field and recalculate the paired amount automatically.
  • Select the non-USDc currency from a Material 3 bottom sheet.
  • Swap the visual positions of USDc and the selected currency.
  • Fetch live USDc exchange rates from the DolarApp ticker API.
  • Attempt to fetch supported currencies from /v1/tickers-currencies.
  • Fall back to a local currency list because the currencies endpoint is not available yet.
  • Handle loading, retry, missing-rate, offline, decimal, invalid-input, and large-value edge cases.
  • Keep user-facing text in Android string resources.
  • The amount input interaction follows familiar fintech currency-converter patterns: fixed currency symbols, grouped digits, decimal validation, right-aligned financial input, and careful handling of large values.

Architecture

The project is intentionally single-module for easy review, with clear package boundaries:

core/           Shared result and money formatting utilities
data/           Retrofit API, DTOs, mappers, connectivity, repository implementations
di/             Koin module definitions
domain/         Business models, repository contracts, conversion use case
presentation/   Compose screen, UI state, events, ViewModel
ui/theme/       Material 3 theme tokens

RateFlowApplication starts Koin and provides the Retrofit API, repositories, use cases, formatter, connectivity observer, and ExchangeViewModel.

ExchangeViewModel exposes immutable StateFlow<ExchangeUiState> and receives user actions through ExchangeUiEvent. Conversion uses BigDecimal to avoid floating-point drift.

API Behavior

Rates are requested from:

GET https://api.dolarapp.dev/v1/tickers?currencies=MXN,ARS

Available currencies are requested from:

GET https://api.dolarapp.dev/v1/tickers-currencies

The assignment states that the currencies endpoint is not available yet. The app still attempts the request first, then falls back to:

ARS, EURC, COP, MXN, BRL

If rates cannot be refreshed, the app shows a retry state and automatically retries when network connectivity is restored.

Run

Open the project in Android Studio and run the app configuration.

You can also build from the command line:

.\gradlew.bat assembleDebug

Tests

Run unit tests:

.\gradlew.bat testDebugUnitTest

Compile Android UI tests:

.\gradlew.bat compileDebugAndroidTestKotlin

Run connected UI tests with an emulator/device:

.\gradlew.bat connectedDebugAndroidTest

About

Native Android solution built with Kotlin, Jetpack Compose, MVVM, Koin, Coroutines/Flow, Retrofit, and Material 3. README includes architecture notes, API fallback behavior, and run/test commands.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages