Skip to content

ProtonMail/proton-rust-nation-2026

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Proton + Crux Rust Nation 2026

An example monorepo showcasing a cross-platform and multi-project architecture using Rust and Crux for shared business logic, with native platform UI (iOS).

The repo demonstrates feature reusability across multiple applications through two apps that share the lumo feature:

  • Ask Lumo is a simple app that lets users submit questions to Lumo and receive AI-generated responses. The entire app is built using the reusable lumo feature, demonstrating how a feature can serve as a complete standalone application.

  • Proton News shows a list of the latest articles published on the Proton blog. Users can tap on any article to view its details, where a "Summarize with Lumo" button allows them to get an AI-generated summary. This app demonstrates feature composition: it uses both the articles feature (for displaying blog posts) and the lumo feature (for AI interactions).

Note: Both apps use the guest Lumo API endpoint for network calls, which is rate limited.

iOS Android
Ask Lumo Ask Lumo
iOS Android
Proton News Proton News
iOS Android

Repository Structure

proton-rust-nation-2026/
├── lumo/                              # Lumo feature (shared across apps)
│   ├── shared/                        # [Rust] Lumo Crux app
│   ├── apple/
│   │   ├── AskLumo/                   # [iOS] Ask Lumo app (uses lumo as top-level feature)
│   │   ├── Lumo/                      # [iOS] Lumo feature shell
│   │   └── generated/
│   │       ├── LumoShared/            # [iOS] Core lib + bindings
│   │       └── LumoTypes/             # [iOS] Generated FFI types
│   └── android/
│       ├── app/                       # [Android] Ask Lumo app
│       ├── lumo-ffi/                  # [Android] FFI bindings module
│       │   └── src/main/
│       │       ├── kotlin/generated/  # [Android] Generated Kotlin types
│       │       └── jniLibs/           # [Android] Native .so files
│       ├── response/                  # [Android] Response handling module
│       └── build.gradle.kts           # [Android] Rust codegen tasks
│
├── proton-news/                       # Proton News application
│   ├── shared/                        # [Rust] Top-level Crux app
│   ├── features/                      # Feature modules
│   │   └── articles/                  # Articles feature
│   │       ├── shared/                # [Rust] Articles Crux app
│   │       └── apple/
│   │           ├── Articles/          # [iOS] Articles iOS shell
│   │           └── generated/
│   │               └── ArticlesTypes/ # [iOS] Generated FFI types
│   ├── apple/
│   │   ├── ProtonNews/                # [iOS] Top-level iOS shell (uses articles + lumo)
│   │   └── generated/
│   │       ├── ProtonNewsShared/      # [iOS] Core lib + bindings
│   │       └── ProtonNewsTypes/       # [iOS] Generated FFI types
│   └── android/
│       ├── app/                       # [Android] Proton News app
│       │   └── src/main/
│       │       ├── kotlin/generated/  # [Android] Generated types
│       │       └── jniLibs/           # [Android] Native .so files
│       └── build.gradle.kts           # [Android] Rust codegen rasks
│
├── shared/                            # Cross-app reusable modules
│   ├── rust/
│   │   └── codegen/                   # [Rust] Type gen boilerplate
│   ├── apple/
│   │   ├── Feature/                   # [iOS] Feature boilerplate
│   │   └── generated/
│   │       └── Serde/                 # [iOS] Shared Serde package
│   └── android/
│       ├── feature/                   # [Android] Shared feature module
│       └── network/                   # [Android] Shared network module
│
└── tools/                             # Cross-app CLI tools
    ├── uniffi-bindgen/                # [Rust] UniFFI bindgen tool
    └── serde-codegen/                 # [Rust] Serde codegen CLI

Building the iOS apps

Each build process:

  1. Generates types (serde + facet codegen) for Rust ↔ Swift FFI
  2. Compiles Rust core to static library via cargo swift
  3. Generates UniFFI bindings
  4. Creates Xcode project via xcodegen

Ask Lumo (iOS)

# Build Ask Lumo iOS app + generate Xcode project
just lumo/apple/dev

Proton News (iOS)

# Build Proton News iOS app + generate Xcode project
just proton-news/apple/dev

Building the Android apps

Each project contains two gradle tasks:

  1. setupAndroid
    • Generate Kotlin types
    • Generate UniFFI bindings
    • Build native libraries
  2. cleanRust
    • Purges the generated directores (/generated and /jniLibs)

Ask Lumo (Android)

# Generate the Ask Lumo dependencies
cd lumo/android/
./gradlew setupAndroid

# Build the project
./gradlew assembleDebug

Proton News (Android)

# Generate the Proton News dependencies
cd proton-news/android/
./gradlew setupAndroid

# Build the project
./gradlew assembleDebug

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors