-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
156 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,157 @@ | ||
# multiplatform-SwissTransfer | ||
# multiplatform-SwissTransfer Core Project | ||
|
||
Core KMP for SwissTransfer application | ||
Core KMP for SwissTransfer application. This repository contains the centralized codebase for the SwissTransfer | ||
project, implemented using Kotlin Multiplatform (KMP) to support both Android and iOS platforms. | ||
|
||
## Overview | ||
|
||
The SwissTransfer Core project is the heart of the SwissTransfer system, providing the essential infrastructure for network | ||
operations, database management, and shared utilities. The core functionality is encapsulated in the `SwissTransferInjection` | ||
model, which integrates various managers to simplify interactions with the database and API calls. | ||
|
||
## Main Modules | ||
|
||
This repository is structured into four main modules: | ||
|
||
### 1. Network | ||
|
||
**Description**: | ||
The Network module handles all network-related operations by utilizing the API. It exposes repositories that can be used if this | ||
module is integrated. | ||
|
||
**Repositories**: | ||
|
||
- `TransferRepository` | ||
- `UploadRepository` | ||
|
||
**Key Features**: | ||
|
||
- Manages API calls | ||
- Provides repositories for network operations | ||
|
||
### 2. Database | ||
|
||
**Description**: | ||
The Database module is responsible for managing the database operations using Realm. It exposes controllers for database | ||
interactions. | ||
|
||
**Key Features**: | ||
|
||
- Manages database operations with Realm | ||
- Exposes controllers for database management | ||
|
||
### 3. Common | ||
|
||
**Description**: | ||
The Common module is used internally and contains shared code that is utilized across other modules. It includes interfaces for | ||
models and various utilities. | ||
|
||
**Key Features**: | ||
|
||
- Provides shared code and utilities | ||
- Contains interfaces for models used across modules | ||
|
||
### 4. Core | ||
|
||
**Description**: | ||
The Core module is the main module that leverages the other modules to expose the `SwissTransferInjection` model. This model | ||
contains managers that abstract the logic of database operations and API calls. Users can simply call the manager to perform an | ||
action without worrying about database storage or API calls. | ||
|
||
**Key Features**: | ||
|
||
- Integrates network and database modules | ||
- Provides `SwissTransferInjection` for centralized management | ||
- Abstracts complex operations into simple manager calls | ||
|
||
## Installation | ||
|
||
### Android | ||
|
||
To install the Core module for Android, follow the next steps. | ||
|
||
#### Step 1 | ||
|
||
Add the following dependency to your `settings.gradle.kts` file: | ||
|
||
```kts | ||
dependencyResolutionManagement { | ||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) | ||
repositories { | ||
mavenCentral() | ||
maven { url = uri("https://jitpack.io") } | ||
} | ||
} | ||
```` | ||
|
||
#### Step 2 | ||
|
||
Add the following dependency to your `build.gradle.kts` file: | ||
|
||
```kts | ||
implementation("com.github.infomaniak.multiplatform-SwissTransfer:core:{tag}") | ||
``` | ||
|
||
`build.gradle` file: | ||
|
||
```gradle | ||
implementation 'com.github.infomaniak.multiplatform-SwissTransfer:core:{tag}' | ||
``` | ||
|
||
For others modules: | ||
|
||
```kts | ||
implementation("com.github.infomaniak.multiplatform-SwissTransfer:{module_name}:{tag}") | ||
``` | ||
|
||
### iOS | ||
|
||
For iOS, the Core module is provided as an XCFramework. Follow these steps to integrate it into your Xcode project: | ||
|
||
1. Download the XCFramework from the [releases page](https://github.com/infomaniak/multiplatform-SwissTransfer/releases). | ||
2. Drag and drop the XCFramework into your Xcode project. | ||
3. Make sure the framework is correctly linked in your target’s build settings. | ||
|
||
## Getting Started | ||
|
||
To get started with the SwissTransfer Core project, clone this repository and follow the setup instructions for your respective | ||
platform (Android or iOS). | ||
|
||
## Usage | ||
|
||
Here’s a brief example of how to use the `SwissTransferInjection` class from the Core module: | ||
|
||
```kotlin | ||
val core = SwissTransferInjection() | ||
core.loadDefaultAccount() | ||
|
||
val manager = core.transferManager | ||
// Use the manager to perform actions | ||
``` | ||
|
||
## Contributing | ||
|
||
If you see a bug or an enhanceable point, feel free to create an issue, so that we can discuss about it, and once approved, we or | ||
you (depending on the priority of the bug/improvement) will take care of the issue and apply a merge request. | ||
Please, don't do a merge request before creating an issue. | ||
|
||
## License | ||
|
||
This project is licensed under the GNU General Public License. See the LICENSE file for more details. | ||
|
||
``` | ||
Copyright (C) 2024 Infomaniak Network SA | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
``` |