Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
Signed-off-by: matt-ramotar <[email protected]>
  • Loading branch information
matt-ramotar committed Nov 17, 2024
1 parent 879bf9f commit dbe3835
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 113 deletions.
1 change: 1 addition & 0 deletions .github/images/hero-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/kotlin-foundation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/mobile-native-foundation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
129 changes: 19 additions & 110 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,129 +1,38 @@
<div align="center">
<img src="Images/friendly_robot.png" width="120"/>
<h1 style="font-size:48px">Store5</h1>
</div>

[![codecov](https://codecov.io/gh/MobileNativeFoundation/Store/branch/main/graph/badge.svg?token=0UCmG3QHPf)](https://codecov.io/gh/MobileNativeFoundation/Store)

<div align="center">
<h4>Full documentation can be found on our <a href="https://mobilenativefoundation.github.io/Store/">website</a>!</h4>
<h4>Join our official Slack on <a href="https://kotlinlang.slack.com/archives/C06007Z01HU">kotlinlang</a>!</h4>
</div>

### Concepts

- [Store](https://mobilenativefoundation.github.io/Store/store/store/) is a typed repository that returns a flow
of [Data](https://github.com/MobileNativeFoundation/Store/blob/main/store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/StoreReadResponse.kt#L39)
/[Loading](https://github.com/MobileNativeFoundation/Store/blob/main/store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/StoreReadResponse.kt#L34)
/[Error](https://github.com/MobileNativeFoundation/Store/blob/main/store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/StoreReadResponse.kt#L51)
from local and network data sources
- [MutableStore](https://mobilenativefoundation.github.io/Store/mutable-store/building/overview/) is a mutable repository implementation that allows create **(C)**, read **(R)**,
update **(U)**, and delete **(D)** operations for local and network resources
- [SourceOfTruth](https://mobilenativefoundation.github.io/Store/mutable-store/building/implementations/source-of-truth/) persists items
- [Fetcher](https://mobilenativefoundation.github.io/Store/mutable-store/building/implementations/fetcher/) defines how data will be fetched over network
- [Updater](https://mobilenativefoundation.github.io/Store/mutable-store/building/implementations/updater/) defines how local changes will be pushed to network
- [Bookkeeper](https://mobilenativefoundation.github.io/Store/mutable-store/building/implementations/bookkeeper/) tracks metadata of local changes and records
synchronization failures
- [Validator](https://mobilenativefoundation.github.io/Store/mutable-store/building/implementations/validator/) returns whether an item is valid
- [Converter](https://mobilenativefoundation.github.io/Store/mutable-store/building/implementations/converter/) converts items
between [Network](https://mobilenativefoundation.github.io/Store/mutable-store/building/generics/network)
/[Local](https://mobilenativefoundation.github.io/Store/mutable-store/building/generics/sot)
/[Output](https://mobilenativefoundation.github.io/Store/mutable-store/building/generics/common) representations

### Including Store In Your Project

#### Android
```kotlin
implementation "org.mobilenativefoundation.store:store5:5.1.0-alpha05"
```

#### Multiplatform (Common, JVM, Native, JS)

```kotlin
commonMain {
dependencies {
implementation("org.mobilenativefoundation.store:store5:5.1.0-alpha05")
}
}
```

### Getting Started

#### Building Your First Store

```kotlin
StoreBuilder
.from<Key, Network, Output, Local>(fetcher, sourceOfTruth)
.converter(converter)
.validator(validator)
.build(updater, bookkeeper)
```

#### Creating
<img src=".github/images/hero-light.svg" width="100%"/>

##### Request
# Store5

```kotlin
store.write(
request = StoreWriteRequest.of<Key, Output, Response>(
key = key,
value = value
)
)
```

##### Response

```text
1. StoreWriteResponse.Success.Typed<Response>(response)
```

#### Reading

##### Request

```kotlin
store.stream<Response>(request = StoreReadRequest.cached(key, refresh = false))
```
[![codecov](https://codecov.io/gh/MobileNativeFoundation/Store/branch/main/graph/badge.svg?token=0UCmG3QHPf)](https://codecov.io/gh/MobileNativeFoundation/Store)

##### Response
#### Documentation

```text
1. StoreReadResponse.Data(value, origin = StoreReadResponseOrigin.Cache)
```
Comprehensive guides, tutorials, and API reference: [store.mobilenativefoundation.org](https://store.mobilenativefoundation.org).

#### Updating
#### Getting Started

##### Request
1. Start with the [Quickstart](https://store.mobilenativefoundation.org/docs/quickstart) to build your first Store.
2. Dive into [Store Foundations](https://store.mobilenativefoundation.org/docs/concepts) to learn how Store works.
3. Check out [Handling CRUD](https://store.mobilenativefoundation.org/docs/use-cases/store5/setting-up-store-for-crud-operations) for an advanced guide on supporting create, read, update, and delete operations.

```kotlin
store.write(
request = StoreWriteRequest.of<Key, Output, Response>(
key = key,
value = newValue
)
)
```
#### Getting Help

##### Response
Join our community in the [#store](https://kotlinlang.slack.com/archives/C06007Z01HU) channel on the official Kotlin Slack.

```text
1. StoreWriteResponse.Success.Typed<Response>(response)
```
#### Getting Involved

#### Deleting
Store has a vibrant community of contributors. We welcome contributions of all kinds. Please see our [Contributing Guidelines](CONTRIBUTING.md) for more information on how to get involved.

##### Request
#### Backed By

```kotlin
store.clear(key)
```
<div style="display: flex; align-items: center; gap: 20px;">
<img src=".github/images/mobile-native-foundation.png" width="200"/>
<img src=".github/images/kotlin-foundation.png" width="200"/>
</div>

### License
#### License

```text
Copyright (c) 2024 Mobile Native Foundation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
```

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.jvmargs=-XX:MaxMetaspaceSize=2G

# POM file
GROUP=org.mobilenativefoundation.store
VERSION_NAME=5.1.0-alpha05
VERSION_NAME=5.1.0-SNAPSHOT
POM_PACKAGING=pom
POM_DESCRIPTION = Store5 is a Kotlin Multiplatform network-resilient repository layer

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ testCore = "1.6.1"
kmmBridge = "0.3.2"
ktlint = "0.39.0"
kover = "0.6.0"
store = "5.1.0-alpha05"
store = "5.1.0-SNAPSHOT"
truth = "1.1.3"
binary-compatibility-validator = "0.15.0-Beta.2"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ object Versions {
const val COMPILE_SDK = 34
const val MIN_SDK = 24
const val TARGET_SDK = 34
const val STORE = "5.1.0-alpha05"
const val STORE = "5.1.0-SNAPSHOT"
}


Expand Down

0 comments on commit dbe3835

Please sign in to comment.