Skip to content

Oztechan/CCC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4,797 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Currency Converter & Calculator

A currency converter application for most of the currencies used in the world.

You can quickly convert and make mathematical operations between currencies.

Buy Me a Coffee at ko-fi.com

Modularization

graph TD;

    client-->android(android)
    client-->ios(ios)

    common-->client
    common-->backend(backend)

    test
Loading

All the modules in the project are grouped into 6 targets:

  • android, ios and backend are app modules that contains platform only codes
  • client is a KMM module that shared between ios and android.
  • common is a KMP modules that shared between all the platforms (android, ios and backend)
  • test contains test cases for architecture and coding conventions

The SubMob shared libraries are consumed as external Maven Central dependencies (see Shared libraries)

Shared libraries

CCC depends on the SubMob libraries, published to Maven Central and pinned in gradle/libs.versions.toml:

  • LogMob KMP logging library with Crashlytics support
  • ScopeMob Useful set of Kotlin scope functions with KMP support
  • BaseMob Android base classes
  • ParserMob KMP parsing library

To work on them alongside CCC, check the repositories out as siblings at ../../SubMob/<Name> (relative to the project root); settings.gradle.kts then builds them from source via a Gradle composite build. Without the sibling checkouts, the pinned published versions are used.

How to run

Be sure that you have latest Android Studio Canary build installed and XCode 13.0 or later.

Android

Open CCC folder with Android Studio and select android:app from configurations and run

iOS

Open CCC/ios/CCC.xcworkspace with XCode after the packages are resolved you can run the project. Generally you should use the latest stable XCode version.

Backend

./gradlew :backend:run

Testing

After you run the app probably your all API calls will fail, it is expected since the private URLs are not shared publicly. If you want the test the app with real API calls, I have prepared a fake response. Please replace all the getConversion methods in

  • com.oztechan.ccc.common.core.network.api.backend.BackendApiImpl
  • com.oztechan.ccc.common.core.network.api.premium.PremiumApiImpl

with below;

override suspend fun getConversion(base: String): ExchangeRate = client.get {
    url {
        takeFrom("https://gist.githubusercontent.com/mustafaozhan/fa6d05e65919085f871adc825accea46/raw/d3bf3a7771e872e0c39541fe23b4058f4ae24c41/response.json")
    }
}.body()

Architecture

graph TD;
    subgraph Backend[Backend]
        database(database) --> datasource
        api(api) --> service
    
        datasource --> Controller
        service --> Controller
    
        Controller --> App
    end
    
    subgraph Mobile[Mobile]
        Persistence(Persistence) --> Storage
        Database(Database) --> DataSource
    
        API(API) --> Service
        RemoteConfig(RemoteConfig) --> ConfigService
    
        Storage --> ViewModel
        DataSource --> ViewModel
    
        Repository --> ViewModel
    
        Storage --> Repository
        DataSource --> Repository
        Service --> Repository
        ConfigService --> Repository
    
        Service --> ViewModel
        ConfigService --> ViewModel
    
        ViewModel --> Views
    end
Loading

Android Preview

iOS Preview

Included Currencies

currencies.png

License

Copyright 2017 Mustafa Ozhan

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Packages

 
 
 

Contributors

Languages