{"id":44219067,"url":"https://github.com/krema-build/krema","last_synced_at":"2026-02-19T11:01:17.362Z","repository":{"id":338307807,"uuid":"1156582964","full_name":"krema-build/krema","owner":"krema-build","description":"Modern desktop apps with java backend and web frontend","archived":false,"fork":false,"pushed_at":"2026-02-16T18:41:31.000Z","size":2320,"stargazers_count":52,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-17T12:36:24.792Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://krema.build","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krema-build.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-12T20:15:30.000Z","updated_at":"2026-02-17T09:54:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"d0ce4221-97aa-4a0c-846b-c5e769a48e91","html_url":"https://github.com/krema-build/krema","commit_stats":null,"previous_names":["krema-build/krema"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/krema-build/krema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krema-build%2Fkrema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krema-build%2Fkrema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krema-build%2Fkrema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krema-build%2Fkrema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krema-build","download_url":"https://codeload.github.com/krema-build/krema/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krema-build%2Fkrema/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29575343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T08:38:15.585Z","status":"ssl_error","status_checked_at":"2026-02-18T08:38:14.917Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-10T03:06:58.622Z","updated_at":"2026-02-18T10:02:29.830Z","avatar_url":"https://github.com/krema-build.png","language":"Java","funding_links":[],"categories":["开发框架"],"sub_categories":["Web框架"],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Krema\n\n**Build modern desktop apps with Java and your favorite web framework.**\n\nKrema is to the Java ecosystem what [Tauri](https://tauri.app) is to Rust — lightweight, native desktop applications powered by system webviews instead of a bundled browser. Write your backend in Java, your frontend in React/Vue/Angular/Svelte, and ship small, fast, cross-platform apps.\n\n[![Build](https://github.com/krema-build/krema/actions/workflows/release.yml/badge.svg)](https://github.com/krema-build/krema/actions/workflows/release.yml)\n[![License: BSL 1.1](https://img.shields.io/badge/License-BSL_1.1-blue.svg)](LICENSE)\n[![Java 25](https://img.shields.io/badge/Java-25-orange.svg)](https://jdk.java.net/25/)\n[![npm](https://img.shields.io/npm/v/@krema-build/krema)](https://www.npmjs.com/package/@krema-build/krema)\n\n[Getting Started](#quick-start) · [Documentation](https://krema.build) · [Examples](krema-demos/)\n\n\u003c/div\u003e\n\n---\n\n## Why Krema?\n\n| | Electron | Tauri | Krema |\n|---|---|---|---|\n| **Backend language** | JavaScript | Rust | Java |\n| **Webview** | Bundled Chromium | System | System |\n| **App size** | ~150 MB | ~3 MB | ~5 MB |\n| **Memory usage** | High | Low | Low |\n| **Ecosystem** | npm | Cargo | Maven + npm |\n\nKrema uses the OS-native webview (WebKit on macOS, WebView2 on Windows, WebKitGTK on Linux) and communicates with Java via [Project Panama](https://openjdk.org/projects/panama/) (Foreign Function \u0026 Memory API) — no JNI, no bundled browser, no Electron overhead. You get the full power of the JDK ecosystem for your backend logic, and complete freedom to use any web framework for the UI.\n\n## Features\n\n- **System Webviews** — WebKit (macOS), WebView2 (Windows), WebKitGTK (Linux). No bundled browser.\n- **Project Panama FFI** — Direct native calls via Java 25's Foreign Function \u0026 Memory API. No JNI.\n- **Any Frontend Framework** — React, Vue, Angular, Svelte, or plain HTML/CSS/JS.\n- **Type-Safe IPC** — Annotate Java methods with `@KremaCommand` and call them from the frontend with full type safety.\n- **Backend-to-Frontend Events** — Push real-time events from Java to the UI.\n- **Rich Native APIs** — Window management, menus, dialogs, notifications, clipboard, system tray, global shortcuts, drag \u0026 drop, secure storage, and more.\n- **Plugin System** — Extend with official plugins (SQLite, WebSocket, file upload, window positioning, autostart) or build your own.\n- **Native Packaging** — Bundle as native executables with GraalVM, or ship as JARs.\n- **Splash Screens** — Built-in configurable splash screens.\n- **Cross-Platform** — macOS (ARM64, x64), Linux (x64), Windows (x64).\n\n## Quick Start\n\n### Prerequisites\n\n- Java 25+\n- Maven 3.9+\n\n### Install the CLI\n\n```bash\n# via npm\nnpm install -g @krema-build/krema\n\n# or via curl\ncurl -fsSL https://krema.build/install.sh | bash\n```\n\n### Create and Run a Project\n\n```bash\nkrema init my-app --template react\ncd my-app\nkrema dev\n```\n\nThat's it. A native window opens with your React app, backed by Java.\n\n## How It Works\n\nKrema apps have two sides: a **Java backend** that handles business logic and native APIs, and a **web frontend** that renders the UI in a system webview. They communicate through a type-safe IPC bridge.\n\n### 1. Define Commands in Java\n\nAnnotate any method with `@KremaCommand` to expose it to the frontend:\n\n```java\nimport build.krema.core.KremaCommand;\n\npublic class Commands {\n\n    @KremaCommand\n    public String greet(String name) {\n        return \"Hello, \" + name + \"!\";\n    }\n\n    @KremaCommand\n    public SystemInfo systemInfo() {\n        return new SystemInfo(\n            System.getProperty(\"os.name\"),\n            System.getProperty(\"java.version\"),\n            Runtime.getRuntime().availableProcessors()\n        );\n    }\n\n    public record SystemInfo(String os, String javaVersion, int cpus) {}\n}\n```\n\n### 2. Call Them from the Frontend\n\n```typescript\n// Invoke a command and get a typed response\nconst greeting = await window.krema.invoke\u003cstring\u003e('greet', { name: 'World' });\n\nconst info = await window.krema.invoke\u003cSystemInfo\u003e('systemInfo', {});\nconsole.log(`Running on ${info.os} with Java ${info.javaVersion}`);\n```\n\n### 3. Wire Up the Application\n\n```java\nimport build.krema.core.Krema;\n\npublic class Main {\n    public static void main(String[] args) {\n        Krema.app()\n            .title(\"My App\")\n            .size(1024, 768)\n            .commands(new Commands())\n            .devUrl(\"http://localhost:5173\")  // points to your frontend dev server\n            .run();\n    }\n}\n```\n\n### 4. Push Events from Java to the Frontend\n\n```java\n// Java: emit events to the frontend\nemitter.emit(\"timer-tick\", Map.of(\"count\", tickCount, \"timestamp\", System.currentTimeMillis()));\n```\n\n```typescript\n// Frontend: listen for events\nwindow.krema.on('timer-tick', (data) =\u003e {\n  console.log(`Tick #${data.count}`);\n});\n```\n\n## Configuration\n\nProjects are configured with a `krema.toml` file:\n\n```toml\n[package]\nname = \"my-app\"\nversion = \"1.0.0\"\nidentifier = \"com.example.my-app\"\n\n[window]\ntitle = \"My App\"\nwidth = 1024\nheight = 768\nresizable = true\n\n[build]\nfrontend_command = \"npm run build\"\nfrontend_dev_command = \"npm run dev\"\nfrontend_dev_url = \"http://localhost:5173\"\nmain_class = \"com.example.app.Main\"\n\n[permissions]\nallow = [\"clipboard:read\", \"clipboard:write\", \"notification\"]\n```\n\n## Native APIs\n\nKrema provides built-in access to native platform features, available from both Java and the frontend:\n\n| API | Description |\n|---|---|\n| **Window** | Resize, move, minimize, maximize, fullscreen, frameless mode |\n| **Menu** | Menu bar, context menus, dock menus |\n| **Dialogs** | File open/save, folder picker, message boxes |\n| **Notifications** | Native desktop notifications |\n| **Clipboard** | Read/write text and images |\n| **System Tray** | Tray icons with menus |\n| **Global Shortcuts** | System-wide keyboard shortcuts |\n| **Drag \u0026 Drop** | File drop handling |\n| **Secure Storage** | OS keychain / credential storage |\n| **Store** | Persistent key-value storage |\n| **Shell** | Open URLs, reveal files in Finder/Explorer |\n| **Screen** | Multi-monitor info and positioning |\n| **HTTP Client** | Native HTTP requests |\n\n## Plugins\n\nExtend your app with official plugins:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ebuild.krema\u003c/groupId\u003e\n    \u003cartifactId\u003ekrema-plugin-sql\u003c/artifactId\u003e\n    \u003cversion\u003e0.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n| Plugin | Description |\n|---|---|\n| `krema-plugin-sql` | SQLite database access |\n| `krema-plugin-websocket` | WebSocket connections |\n| `krema-plugin-upload` | File upload handling |\n| `krema-plugin-positioner` | Window positioning (center, corners, etc.) |\n| `krema-plugin-autostart` | Launch at login |\n\n## Project Structure\n\n```\nkrema/                        Core framework\n  krema-core/                 Webview bindings, IPC, window management\n  krema-cli/                  Command-line interface\n  krema-processor/            Annotation processor for @KremaCommand\nkrema-plugins/                Official plugins\n  krema-plugin-sql/           SQLite database access\n  krema-plugin-websocket/     WebSocket connections\n  krema-plugin-upload/        File upload handling\n  krema-plugin-positioner/    Window positioning\n  krema-plugin-autostart/     Launch-at-login\nkrema-demos/                  Example applications\n  krema-react/                React + TypeScript demo\n  krema-vue/                  Vue demo\n  krema-angular/              Angular demo\nkrema-docs/                   Documentation site\n```\n\n## Documentation\n\nFull documentation is available at **[krema.build](https://krema.build)**.\n\n## License\n\nThis project is licensed under the [Business Source License 1.1](LICENSE).\n\n- **Change Date:** 2030-02-06\n- **Change License:** Apache License, Version 2.0\n\nAfter the change date, the code becomes available under the Apache 2.0 license. See the [LICENSE](LICENSE) file for full terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrema-build%2Fkrema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrema-build%2Fkrema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrema-build%2Fkrema/lists"}