Skip to content

Project Structure

Sea Lantern is a Tauri 2 + Vue 3 + Rust project. The repository is split into the frontend, backend Rust workspace, shared data, scripts, and source-bound technical docs.

Top-Level Directories

text
SeaLantern/
├── frontend/       # Vue 3 frontend, pages, state, language, themes, and Tauri API wrappers
├── backend/        # Rust workspace with shared crates, Tauri host, and Docker/headless entry
├── shared/         # Shared static data, such as plugin permissions, trusted catalog, and server taxonomy
├── docs/           # Source-bound technical docs, plugin API, CLI, and design notes
├── scripts/        # Tauri launcher, version, notice, Docker smoke scripts
├── docker/         # Docker related files
├── packaging/      # Desktop packaging files
├── panic-log/      # Crash log directory placeholder
├── Cargo.toml      # Backend Rust workspace manifest
├── package.json    # Repository scripts and frontend tool entry
└── pnpm-lock.yaml  # pnpm lockfile

Frontend

frontend/ owns UI, state, language resources, themes, and calls to Tauri backend commands.

text
frontend/
├── index.html
├── package.json
├── scripts/
└── src/
    ├── main.ts
    ├── main.next.ts
    ├── NextRoot.vue
    ├── api/
    ├── router/
    ├── pages/
    ├── views/
    ├── layout/
    ├── shell/
    ├── components/
    ├── composables/
    ├── features/
    ├── services/
    ├── host/
    ├── launcher/
    ├── stores/
    ├── language/
    ├── themes/
    ├── styles/
    ├── contracts/
    ├── types/
    ├── data/
    ├── assets/
    └── utils/

Common Frontend Entry Points

ChangeStart here
Tauri command callsfrontend/src/api/
Routes and page entriesfrontend/src/router/, frontend/src/pages/, frontend/src/views/
Page componentsfrontend/src/components/ and the matching page directory
App shell, navigation, layoutfrontend/src/layout/, frontend/src/shell/, frontend/src/components/shell/, frontend/src/NextRoot.vue
Cross-page flowsfrontend/src/features/, frontend/src/services/
Reusable Vue logicfrontend/src/composables/
Global statefrontend/src/stores/
Plugin state modulesfrontend/src/stores/plugin/
User-facing textfrontend/src/language/
Themes and visual variablesfrontend/src/themes/, frontend/src/styles/
Types and contractsfrontend/src/types/, frontend/src/contracts/

Page Directories

frontend/src/pages/ is organized by product area:

  • home/
  • servers/
  • server-instance/
  • plugins/
  • downloads/
  • settings/
  • paint/
  • tunnel/
  • developer/
  • about/

Single-server pages live under server-instance/, such as console/, config/, players/, and extensions/.

Backend

backend/ is a Rust workspace. The root Cargo.toml manages all crates.

text
backend/
├── runtime/
├── event/
├── i18n/
├── server-config/
├── docker/
├── server-local-setup/
├── server-installer/
├── server-startup-scan/
├── java-installer/
├── server-log/
├── server-plugin/
├── plugin-trust/
├── lua-runtime/
├── server-download-links/
├── starter-links/
├── update/
├── tauri-host/
├── docker-entry/
└── vendor/

Shared Crate Responsibilities

CrateResponsibility
runtimeRuntime mode, HTTP/headless tools, panic reports
eventApp and server event models
i18nBackend language resources
server-configStartup config, JVM args, CPU policy, server.properties rules
dockerDocker preview and Docker rules
server-local-setupLocal server adoption, startup mode inference, local startup preview helpers
server-installerServer installation and core detection
server-startup-scanExisting server directory scanning
java-installerJava download and installation
server-logServer log persistence and reading
server-pluginMinecraft server plugin file scanning and management rules
plugin-trustSea Lantern plugin permission normalization, trust, and review rules
lua-runtimeLua runtime boundary
server-download-linksServer download link parsing
starter-linksStarter links
updateUpdate check, download, and install flow

Reusable rules should live in the owning shared crate. tauri-host should focus on commands, orchestration, persistence, runtime state, and host integration.

Tauri Host

backend/tauri-host/ is the desktop and headless host.

text
backend/tauri-host/
├── tauri.conf.json
├── capabilities/
├── icons/
├── tests/
└── src/
    ├── lib.rs
    ├── main.rs
    ├── runtime/
    ├── commands/
    ├── services/
    ├── models/
    ├── adapters/
    ├── hardcode_data/
    ├── plugins/
    └── utils/

Commands

backend/tauri-host/src/commands/ contains Tauri command implementations:

DirectoryResponsibility
app/App, settings, system, i18n, and host commands
downloads/Downloads, Java, Mod downloads
online/Online, Join ID, tunnel
plugins/Sea Lantern Lua plugin management, market, enable/disable, snapshots
server/Server management, config, players, server plugin files
update/Update check, download, install

When adding or changing commands, check at least:

  1. frontend/src/api/*.ts
  2. backend/tauri-host/src/runtime/command_catalog.rs
  3. backend/tauri-host/src/commands/

Command names, parameters, return structures, error semantics, and event fields are frontend-facing contracts.

Services

backend/tauri-host/src/services/ handles host service orchestration:

DirectoryResponsibility
server/Server management, runtime control, startup, plugin files, runtime adapters
download/Download manager and Java installer
online/Online services and tunnel
java_detector/Java detection

Server startup paths must keep local jar, starter, bat, sh, ps1, custom start, and Docker start separate. When preview and execution must match, prefer shared normalized results from shared crates.

Plugin System

The Sea Lantern Lua plugin system lives in:

text
backend/tauri-host/src/plugins/
├── api/
├── builtin/
├── manager/
└── runtime/
    ├── core/
    ├── console/
    ├── element/
    ├── filesystem/
    ├── http/
    ├── i18n/
    ├── log/
    ├── plugins_api/
    ├── process/
    ├── server/
    ├── storage/
    ├── system/
    └── ui/

Frontend counterparts:

  • frontend/src/api/plugin.ts
  • frontend/src/pages/plugins/
  • frontend/src/components/plugin/
  • frontend/src/components/plugins/
  • frontend/src/stores/plugin/

Keep the two plugin systems separate:

TypeFrontend entryBackend entry
Sea Lantern Lua pluginsfrontend/src/api/plugin.tsbackend/tauri-host/src/plugins/, backend/tauri-host/src/commands/plugins/
Minecraft server plugin filesfrontend/src/api/mcs_plugins.tsbackend/server-plugin/, backend/tauri-host/src/commands/server/

Plugin UI snapshots, sidebar, context menus, component mirror, and permission logs are plugin-visible behavior. Check compatibility before changing them.

Shared Data and Docs

shared/ stores static data used across frontend and backend:

  • plugin-permissions.json
  • plugin-trusted-catalog.json
  • server-core-taxonomy.json
  • startup-modes.json

docs/ keeps technical docs that are tightly bound to source code:

  • docs/plugin/: Sea Lantern Lua plugin runtime API
  • docs/CLI-Guide.md: CLI guide
  • docs/design/: design notes

General user docs, tutorials, and contribution guides should live on the docs site instead of being added to repository docs/.

Scripts

scripts/ currently contains:

  • tauri.mjs: repository-level Tauri launcher
  • version.mjs: version helper
  • notice.mjs: third-party notice helper
  • cli-docker-smoke.ps1: Docker/CLI smoke check

Default desktop development command:

bash
pnpm tauri:dev

Frontend only:

bash
pnpm dev

HTTP / Docker backend only:

bash
pnpm dev:http

Common Change Routes

TaskStart here
Add a frontend pagefrontend/src/router/, frontend/src/pages/, frontend/src/router/pageMeta.ts
Add user-facing textfrontend/src/language/
Add a Tauri callfrontend/src/api/, backend/tauri-host/src/runtime/command_catalog.rs, backend/tauri-host/src/commands/
Server create, import, startupfrontend/src/pages/servers/, backend/server-config/, backend/server-local-setup/, backend/tauri-host/src/services/server/
Docker startup rulesbackend/docker/, backend/tauri-host/src/services/server/runtime/docker_itzg/
Config editorfrontend/src/features/config-editor/, frontend/src/pages/server-instance/config/, backend/server-config/
Console and logsfrontend/src/stores/consoleStore.ts, backend/server-log/, backend host log reading logic
Players, whitelist, bans, OPfrontend/src/api/player.ts, frontend/src/pages/server-instance/players/, backend/tauri-host/src/commands/server/
Downloads, Java, server coresfrontend/src/api/downloader.ts, frontend/src/api/java.ts, backend/java-installer/, backend/server-installer/
Updatesfrontend/src/api/update.ts, frontend/src/stores/updateStore.ts, backend/update/
Auth entryfrontend/src/services/auth*.ts, frontend/src/stores/auth*.ts, frontend/src/router/authRoute.ts

Check Commands

Frontend:

bash
pnpm lint
pnpm build:check
pnpm fmt:check

Backend:

bash
cargo fmt --all -- --check
cargo check --workspace
cargo clippy --workspace -- -D warnings

Language resources:

bash
pnpm i18n:check
pnpm i18n:sync

Released under the GPL-3.0 License