AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.
HTML ai-agentcloudflarecloudflare-d1cloudflare-r2cloudflare-workersdockerelectronevernoteevernote-alternativeknowledge-basemcpnote-takingobsidian-alternativeoffline-firstpersonal-knowledge-basepwaself-hostedsqlitetiptapweb-clipper
import SwiftUI
struct RootView: View {
@Environment(AppEnvironment.self) private var env
var body: some View {
Group {
if env.session.isLoading {
ProgressView(env.preferences.t("启动中…", en: "Starting…", ja: "起動しています…", pl: "Uruchamianie…"))
} else if env.session.isSignedIn {
WorkspaceView()
} else {
LoginView()
}
}
.task {
await env.bootstrap()
await AutoLogin.attemptIfConfigured(env: env)
}
.onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in
Task {
if env.session.isSignedIn {
await env.runSyncCycle()
}
}
}
.onReceive(NotificationCenter.default.publisher(for: UIApplication.didEnterBackgroundNotification)) { _ in
Task {
if let scope = env.session.dataScope {
_ = try? await env.outboxFlusher.flush(scope: scope)
}
}
}
}
}