Skip to content

Commit

Permalink
Merge pull request #74 from RotBolt/task/update-docs
Browse files Browse the repository at this point in the history
Update Docs and Readme
  • Loading branch information
RotBolt authored Sep 5, 2023
2 parents aac5fa3 + 17f9cbf commit ce869bf
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 93 deletions.
102 changes: 36 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,103 +1,73 @@
# :construction: Flaker :construction:
![flaker build](https://github.com/rotbolt/flaker/actions/workflows/flaker-ci.yml/badge.svg)
![flaker build](https://github.com/rotbolt/flaker/actions/workflows/flaker-ci.yml/badge.svg) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.rotbolt/flaker-android-okhttp/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/io.github.rotbolt/flaker-android-okhttp)

Developing a mobile app that performs flawlessly in the real world requires thorough testing under a variety of network conditions. Introducing Flaker – your assistant tool for recreating real-world network scenarios directly in your mobile app development environment. 📱💡

A flaky network simulator for your mobile app.
## What is Flaker?
Flaker is a network simulator designed to make your mobile app development process smoother and more efficient. With Flaker, you can effortlessly emulate a wide range of network conditions, enabling you to fine-tune your app's performance and ensure it delivers an exceptional user experience under any circumstance. 🌐🛠️

Imagine effortlessly recreating real-world network scenarios directly for your mobile app development. With Flaker,- you gain the ability to mimic a variety of network conditions tailored for mobile app development.
- **Experience Slow Networks**: Wondering how your app performs on a slow network? Flaker lets you replicate these scenarios, helping you fine-tune your app's responsiveness.
- **Emulate Flaky Networks**: Use fail percentage and variance controls to mirror the unpredictable nature of network connections. Get a firsthand feel for the scenarios your mobile app might encounter.
- **Focused Impact**: Flaker only affects your app's network conditions, leaving your device's overall network functionality undisturbed.
## Key Features:
### Experience Slow Networks 🐢
Ever wondered how your app would perform on a slow and sluggish network? With Flaker, you can replicate these scenarios with ease. Test your app's responsiveness and optimize its behavior under adverse network conditions. 🚀🐌

Whether you're a mobile app developer refining user experiences or a tester validating app resilience, Flaker offers an intuitive solution within your development workflow. Elevate your testing strategies and boost your app's performance with Flaker.
### Emulate Flaky Networks 📶
Network connections in the real world are rarely stable. Flaker allows you to introduce fail percentage and variance controls, mirroring the unpredictable nature of network connections. Gain a firsthand understanding of the challenges your mobile app might face and ensure it remains resilient. 🔮🔌

## Demo
### Focused Impact 🎯
Flaker is designed to impact only your app's network conditions, leaving your device's overall network functionality undisturbed. This means you can test and fine-tune your app's performance without affecting your entire device's connectivity. 📡🔍

https://github.com/RotBolt/Flaker/assets/24780524/3d00e644-0f47-4755-8402-74001fa96a2c
## Who Can Benefit from Flaker?
Whether you're a mobile app developer looking to enhance user experiences or a tester seeking to validate your app's resilience, Flaker provides an intuitive and indispensable tool within your development workflow. Elevate your testing strategies and boost your app's performance with Flaker.

Flaker empowers you to:

## Getting Started
✅ Test under various network conditions

#### Installation (In Progress - Not yet published to maven central)
✅ Optimize your app for slow networks

Add the following dependency to your project.
✅ Prepare your app for flaky network connections

```kotlin
debugImplementation("io.github.rotbolt:flaker-android-okhttp:${latest_version}")
releaseImplementation("io.github.rotbolt:flaker-android-okhttp-no-op:${latest_version}")
```
✅ Ensure your app's stability and reliability

**_NOTE:_** It is not yet published to maven central. But you can download all the modules from [github packages](https://github.com/RotBolt?tab=packages&repo_name=Flaker) and add them to your project for now.

#### flaker-android-okhttp
Add the following statement to your app's onCreate method.
```kotlin
class MainApplication: Application() {
override fun onCreate() {
super.onCreate()
FlakerAndroidOkhttpContainer.install(this)
}
}
```
✅ Enhance user satisfaction and retention

Then in your okhttp client builder, add the following interceptor.
```kotlin
val client = OkHttpClient.Builder()
.addInterceptor(FlakerInterceptor.Builder().build())
.build()
```
Sure, here's the text with emojis added for your GitHub README:

#### flaker-android-ktor (In Progress)

#### flaker-ios-ktor (In Progress)
## Demo
📺 Check out the to see Flaker in action.

That's it. Now you can use the companion app to simulate the network conditions.
https://github.com/RotBolt/Flaker/assets/24780524/3d00e644-0f47-4755-8402-74001fa96a2c

## Development
## Usage
Please refer to the [📚 docs](https://rotbolt.github.io/flaker/) for detailed usage instructions.

### Library Code Map
![library-code-map.png](docs/assets/library-code-map.png#gh-light-mode-only)
![library-code-map.png](docs/assets/library-code-map-dark.png#gh-dark-mode-only)
## Built with

**Kotlin:** 🚀 The primary programming language.

### :hammer: Build
Simply clone this repository in Android Studio Giraffe or above and build the project.
**Kotlin Multiplatform:** 📱🍏 Sharing common logic across Android and iOS.

### Module Details
- **flaker-domain**: Contains domain of flaker library which is used by other modules. Like Network Request and preferences by the user.
- **flaker-data**: Contains data layer of flaker library which is used by other modules to get the locally stored data. All the persistent data should stay here.
- **flaker-okhttp-core**: Core module containing the functionality to intercept the network request and simulate the network conditions using OkHttp Interceptor.
- **flaker-ktor-core**: Core module containing the functionality to intercept the network request and simulate the network conditions using Ktor
- **flaker-android-ui**: Contains the reusable UI elements and components for the android companion app.
- **flaker-android-okhttp**: Contains the companion app which gets installed as a part of library. This should be used for the apps which uses OkHttp as their networking library.
- **flaker-android-ktor**: Contains the companion app which gets installed as a part of library. This should be used for the apps which uses Ktor as their networking library.
- **flaker-android**: Contains the companion app which gets installed as a part of library. This should be used for the apps which uses both okhttp and Ktor as their networking library.
**Jetpack Compose**: 🖼️ For building the UI for the Android companion app. Supports dynamic theming.

### Verify
We use `detekt` for static code analyis and a job is setup in github actions to run it on every PR. You can run it locally using the following command:
```bash
// For android related changes
./gradlew detekt
**SqlDelight:** 📊 For a shared database and persistence layer between multiple platforms.

// For iOS related changes
./gradlew detektMetadataIosMain
**Jetpack DataStore:** 📦 For the shared persistence layer to store user preferences and configuration of Flaker.

// For common code changes
./gradlew detektMetadataCommonMain
```
**Okhttp:** 📡 For creating Flaker for Android apps using Okhttp3 for networking.

If you want to `detekt` to auto correct some of the stuff, please add the flag `--auto-correct` to the above commands.
**Ktor:** 🌐 For creating Flaker targeting both Android and iOS apps using Ktor for networking. (🚧 In Progress)

**SwiftUI:** 🍎 For building the UI for the iOS companion app. Supports dynamic theming. (🚧 In Progress)

## Roadmap
- [x] flaker-android-okhttp
- [ ] flaker-android-ktor
- [ ] flaker-ios-ktor

## Contributing
If you've found an error in this sample, please file an issue.
If you've found an error in this sample, please 🚩 file an issue.

Patches are encouraged and may be submitted by forking this project and submitting a pull request. Since this project is still in its very early stages, if your change is substantial, please raise an issue first to discuss it.
Patches are encouraged and may be submitted by forking this project and submitting a pull request. Since this project is still in its very early stages, if your change is substantial, please raise an issue first to discuss it. 🤝

## License
```
Expand Down
37 changes: 27 additions & 10 deletions docs/development.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
hide:
- navigation
---

## Development

### Library Code Map
### Library Code Map
![library-code-map.png](assets/library-code-map.png#only-light)
![library-code-map.png](assets/library-code-map-dark.png#only-dark)
Expand All @@ -10,14 +14,22 @@
Simply clone this repository in Android Studio Giraffe or above and build the project.

### Module Details
- **flaker-domain**: Contains domain of flaker library which is used by other modules. Like Network Request and preferences by the user.
- **flaker-data**: Contains data layer of flaker library which is used by other modules to get the locally stored data. All the persistent data should stay here.
- **flaker-okhttp-core**: Core module containing the functionality to intercept the network request and simulate the network conditions using OkHttp Interceptor.
- **flaker-ktor-core**: Core module containing the functionality to intercept the network request and simulate the network conditions using Ktor
- **flaker-android-ui**: Contains the reusable UI elements and components for the android companion app.
- **flaker-android-okhttp**: Contains the companion app which gets installed as a part of library. This should be used for the apps which uses OkHttp as their networking library.
- **flaker-android-ktor**: Contains the companion app which gets installed as a part of library. This should be used for the apps which uses Ktor as their networking library.
- **flaker-android**: Contains the companion app which gets installed as a part of library. This should be used for the apps which uses both okhttp and Ktor as their networking library.

**flaker-domain**: Contains the domain of the Flaker library, used by other modules, including network requests and user preferences. 🏠

**flaker-data**: Contains the data layer of the Flaker library, used by other modules to access locally stored data. All persistent data should be kept here. 📊

**flaker-okhttp-core**: Core module containing the functionality to intercept network requests and simulate network conditions using OkHttp Interceptor. 🌐

**flaker-ktor-core**: Core module containing the functionality to intercept network requests and simulate network conditions using Ktor. 🌐

**flaker-android-ui**: Contains reusable UI elements and components for the Android companion app. 📱🎨

**flaker-android-okhttp**: Contains the companion app that gets installed as a part of the library. This should be used for apps that use OkHttp as their networking library. 📱📡

**flaker-android-ktor**: Contains the companion app that gets installed as a part of the library. This should be used for apps that use Ktor as their networking library. 📱🌐

**flaker-android**: Contains the companion app that gets installed as a part of the library. This should be used for apps that use both OkHttp and Ktor as their networking library. 📱📡🌐

### Verify
We use `detekt` for static code analyis and a job is setup in github actions to run it on every PR. You can run it locally using the following command:
Expand All @@ -32,4 +44,9 @@ We use `detekt` for static code analyis and a job is setup in github actions to
./gradlew detektMetadataCommonMain
```

If you want to `detekt` to auto correct some of the stuff, please add the flag `--auto-correct` to the above commands.
If you want to `detekt` to auto correct some of the stuff, please add the flag `--auto-correct` to the above commands.

## Contributing
If you've found an error in this sample, please 🚩 file an issue.

Patches are encouraged and may be submitted by forking this project and submitting a pull request. Since this project is still in its very early stages, if your change is substantial, please raise an issue first to discuss it. 🤝
31 changes: 24 additions & 7 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
---
hide:
- navigation
---

# Usage

#### Installation (In Progress - Not yet published to maven central)
## Installation

Add the following dependency to your project.
Add `mavenCentral()` to repositories in your `build.gradle` file.

```kotlin
debugImplementation("io.github.rotbolt:flaker-android-okhttp:${latest_version}")
releaseImplementation("io.github.rotbolt:flaker-android-okhttp-no-op:${latest_version}")
repositories {
mavenCentral()
}
```

**_NOTE:_** It is not yet published to maven central. But you can download all the modules from [github packages](https://github.com/RotBolt?tab=packages&repo_name=Flaker) and add them to your project for now.
Add the following dependency to your `build.gradle`

```kotlin
dependencies {
debugImplementation("io.github.rotbolt:flaker-android-okhttp:${latest_version}")
releaseImplementation("io.github.rotbolt:flaker-android-okhttp-noop:${latest_version}")
}
```

#### flaker-android-okhttp
Add the following statement to your app's onCreate method.
Expand All @@ -28,9 +41,13 @@ Then in your okhttp client builder, add the following interceptor.
.addInterceptor(FlakerInterceptor.Builder().build())
.build()
```
That's it. Now upon installing your app, a companion app `flaker` will be installed on your device. You can use this app to configure the network conditions for your app.

#### flaker-android-ktor (In Progress)
#### flaker-android-ktor
In progress

#### flaker-ios-ktor (In Progress)
In progress

That's it. Now you can use the companion app to simulate the network conditions.
## Releases
For the latest release versions, please check the [github releases](https://github.com/RotBolt/Flaker/releases)
58 changes: 51 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,62 @@
# Flaker
---
hide:
- navigation
---

A flaky network simulator for your mobile app.
# Flaker: A Flaky Network Simulator for Mobile App Development
Developing a mobile app that performs flawlessly in the real world requires thorough testing under a variety of network conditions. Introducing Flaker – your assistant tool for recreating real-world network scenarios directly in your mobile app development environment. 📱💡

Imagine effortlessly recreating real-world network scenarios directly for your mobile app development. With Flaker,- you gain the ability to mimic a variety of network conditions tailored for mobile app development.
## What is Flaker?
Flaker is a powerful network simulator designed to make your mobile app development process smoother and more efficient. With Flaker, you can effortlessly emulate a wide range of network conditions, enabling you to fine-tune your app's performance and ensure it delivers an exceptional user experience under any circumstance. 🌐🛠️

- **Experience Slow Networks**: Wondering how your app performs on a slow network? Flaker lets you replicate these scenarios, helping you fine-tune your app's responsiveness.
- **Emulate Flaky Networks**: Use fail percentage and variance controls to mirror the unpredictable nature of network connections. Get a firsthand feel for the scenarios your mobile app might encounter.
- **Focused Impact**: Flaker only affects your app's network conditions, leaving your device's overall network functionality undisturbed.
## Key Features:
### Experience Slow Networks 🐢
Ever wondered how your app would perform on a slow and sluggish network? With Flaker, you can replicate these scenarios with ease. Test your app's responsiveness and optimize its behavior under adverse network conditions. 🚀🐌

Whether you're a mobile app developer refining user experiences or a tester validating app resilience, Flaker offers an intuitive solution within your development workflow. Elevate your testing strategies and boost your app's performance with Flaker.
### Emulate Flaky Networks 📶
Network connections in the real world are rarely stable. Flaker allows you to introduce fail percentage and variance controls, mirroring the unpredictable nature of network connections. Gain a firsthand understanding of the challenges your mobile app might face and ensure it remains resilient. 🔮🔌

### Focused Impact 🎯
Flaker is designed to impact only your app's network conditions, leaving your device's overall network functionality undisturbed. This means you can test and fine-tune your app's performance without affecting your entire device's connectivity. 📡🔍

## Who Can Benefit from Flaker?
Whether you're a mobile app developer looking to enhance user experiences or a tester seeking to validate your app's resilience, Flaker provides an intuitive and indispensable tool within your development workflow. Elevate your testing strategies and boost your app's performance with Flaker.

Flaker empowers you to:

✅ Test under various network conditions

✅ Optimize your app for slow networks

✅ Prepare your app for flaky network connections

✅ Ensure your app's stability and reliability

✅ Enhance user satisfaction and retention

## flaker android demo
📺 Checkout the demo here

<video width="800" controls>
<source src="assets/flaker-android.mp4" type="video/mp4">
</video>

## Built with

**Kotlin:** 🚀 The primary programming language.

**Kotlin Multiplatform:** 📱🍏 Sharing common logic across Android and iOS.

**Jetpack Compose**: 🖼️ For building the UI for the Android companion app. Supports dynamic theming.

**SqlDelight:** 📊 For a shared database and persistence layer between multiple platforms.

**Jetpack DataStore:** 📦 For the shared persistence layer to store user preferences and configuration of Flaker.

**Okhttp:** 📡 For creating Flaker for Android apps using Okhttp3 for networking.

**Ktor:** 🌐 For creating Flaker targeting both Android and iOS apps using Ktor for networking. (🚧 In Progress)

**SwiftUI:** 🍎 For building the UI for the iOS companion app. Supports dynamic theming. (🚧 In Progress)


6 changes: 3 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ nav:
- Development: development.md
theme:
name: 'material'
favicon: assets/images/icon-square.png
favicon: assets/logo.png
logo: assets/logo.png
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: teal
primary: red
accent: blue
toggle:
icon: octicons/sun-24
name: "Switch to Dark Mode"
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: teal
primary: red
accent: blue
toggle:
icon: octicons/moon-24
Expand Down

0 comments on commit ce869bf

Please sign in to comment.