SecureNotes is a simple notes app that can be used on both Android and iOS platforms.
All data is encrypted and synced with the Cloud Firestore. Only the owner of the note can decrypt it.
SecureNotes is a KMP project with completely shared code base across Android and iOS platforms. The application UI is based on Compose Material3.
- Compose Multiplatform - shared UI
- Compose ViewModel - shared ViewModel
- Room Database - DB abstraction layer over SQLite
- Data Store - key-value storage for non-secret data
- KVault - encrypted key-value storage for secret data
- Koin - DI Framework
- Firebase - Kotlin-first SDK for Firebase
- Kotlinx Serialization - JSON serialization
- Navigation Compose - Compose Multiplatform adaptation for KMP
- Napier - Logger for KMP
- Libdosium - data encryption with Libsodium for KMP.
Android and iOS applications implements its own base initialization point:
- app for Android
- app-ios for iOS
These initialization points create a global UI controller and a dependency graph. These main things are implemented in the App module.
SecureNotes is a multi-module project: the App module depends on the Feature, Domain, and Core modules.
Feature modules cannot depend on each other.
Domain modules can depend on each other. These dependencies are built hierarchically.
Core modules can also depend on each other. These dependencies are determined by how commonly used they are.
The project's presentational architecture is a simplified version of MVI.
The ViewModel is the central element of the architecture. It contains the declarative state that is updated through its reducer. It receives signals (intents) from the View. It observes the domain state.
The declarative state of the ViewModel is implemented as a composable MutableState. The Composable View observes this state and recomposes whenever it changes.
SecureNotes uses Cloud Firestore as a Backend.
To set up your own project, follow these simple steps:
- Change the app package to your own:
- APPLICATION_ID for Android (buildSrc/src/main/kotlin/Config.kt)
- BUNDLE_ID for iOS (app-ios/Configuration/Config.xcconfig)
- Create a new Firebase Project with this package here
- Set up simple Firestore Rules. In the Firestore Database section, on the Rules tab, you need to add the following code:
service cloud.firestore { match /databases/{database}/documents { match /users/{userId}/notes/{noteId} { allow read, write: if request.auth != null && request.auth.uid == userId; } match /users/{userId}/keys/{keyId} { allow read, write: if request.auth != null && request.auth.uid == userId; } } }
- Generate the project configuration files by opening
Project Settings -> General
. In the "Your apps" section, create applications for Android and iOS, and then download the resulting json and plist files. Then move these configuration files:- google-services.json for Android to the
app/
directory - GoogleService-Info.plist for iOS to the
app-ios/app-ios
directory
- google-services.json for Android to the
Now you have your own version of the SecureNotes and your own Cloud Firestore.
Android/iOS
The project SecureNotes is developed and maintained by Anton Poliakov.