No description
  • Rust 62%
  • Swift 31%
  • C 3.9%
  • TypeScript 2.7%
  • Makefile 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-05-31 19:00:00 -04:00
apps feat: initial impl 2026-05-31 19:00:00 -04:00
bind feat: initial impl 2026-05-31 19:00:00 -04:00
crates/bfmt feat: initial impl 2026-05-31 19:00:00 -04:00
lib/gogaku feat: initial impl 2026-05-31 19:00:00 -04:00
sql feat: initial impl 2026-05-31 19:00:00 -04:00
src feat: initial impl 2026-05-31 19:00:00 -04:00
tests feat: initial impl 2026-05-31 19:00:00 -04:00
.gitignore feat: initial impl 2026-05-31 19:00:00 -04:00
.swift-format feat: initial impl 2026-05-31 19:00:00 -04:00
bun.lock feat: initial impl 2026-05-31 19:00:00 -04:00
Cargo.lock feat: initial impl 2026-05-31 19:00:00 -04:00
Cargo.toml feat: initial impl 2026-05-31 19:00:00 -04:00
cliff.toml feat: initial impl 2026-05-31 19:00:00 -04:00
clippy.toml feat: initial impl 2026-05-31 19:00:00 -04:00
committed.toml feat: initial impl 2026-05-31 19:00:00 -04:00
Justfile feat: initial impl 2026-05-31 19:00:00 -04:00
LICENSE-APACHE chore(license): initial release 2026-05-31 17:00:00 -04:00
LICENSE-MIT feat: initial impl 2026-05-31 19:00:00 -04:00
package.json feat: initial impl 2026-05-31 19:00:00 -04:00
README.md feat: initial impl 2026-05-31 19:00:00 -04:00
rustfmt.toml feat: initial impl 2026-05-31 19:00:00 -04:00

Gogaku

Japanese study companion.

Important

Consider this to be pre-alpha software. I make no guarantee of the stability of any documented APIs until the first official release.

Goal

This project aims to provide a fast, offline-first iOS experience for studying Japanese. Vocabulary lookup is powered by the standard community dictionaries (JMdict, KANJIDIC2, and friends), scheduling runs through the FSRS-5 algorithm, and the interface gradually shifts from English to Japanese as the user's vocabulary matures. Anything the user produces stays portable: cards, their scheduling, the review log and the settings are one SQLite file every frontend reads, which copies out as a backup and back in on another device.

Note

At this time, Gogaku targets iOS only. There are no plans to support Android, web, or desktop.

Organization

The project is partitioned into the top-level gogaku Rust library, the SwiftUI iOS app, and the Swift bindings that bridge the two over the C ABI. A command-line frontend lives alongside as a workspace peer.

Workspace

Cargo (Rust's package manager) manages a workspace of several crates, specified within its manifest. The iOS app is consumed as an Xcode project under apps/ios/ that depends on the Swift package in bind/swift/, which links the C ABI in lib/gogaku/.

./
├── Cargo.lock           # cargo lockfile
├── Cargo.toml           # cargo manifest
├── Justfile             # useful dev commands
├── LICENSE-APACHE       # apache 2.0 license
├── LICENSE-MIT          # mit license
├── README.md            # this document
├── apps/                # frontend apps
│  ├── cli/              # command-line app
│  ├── ios/              # SwiftUI iOS app
│  └── web/              # browser app
├── bind/                # language bindings
│  ├── swift/            # Swift package
│  └── wasm/             # WebAssembly bindings
├── crates/              # supporting crates
├── lib/                 # foreign function interfaces
│  └── gogaku/           # C ABI
├── sql/                 # database schema
└── src/                 # top-level gogaku library

Tip

Run just (or just help) at the repo root to list the available development recipes.

Modules

Main components of gogaku are outlined below.

  • gogaku: top-level library that manages dictionary data and review state. pack is the memory-mapped container every lookup reads, dict holds one module per upstream source, find is the search engine over them, load downloads and builds packs, and card is the study state behind the optional card feature.

Frontends

  • gogaku-cli: a command-line interface for dictionary lookup, review, and store maintenance.
  • gogaku-ios: a native iOS application built with SwiftUI.
  • gogaku-web: a browser application, served as static files.

Bindings

  • libgogaku: the C ABI every foreign binding speaks.
  • GogakuKit: Swift package wrapping that ABI.
  • gogaku-wasm: WebAssembly bindings, dictionaries only.

Supporting

  • bfmt: human-readable byte size formatting and parsing.
  • tests: scheduling parity, checked against Anki and against the FSRS crate the model was transcribed from.

Testing

Rust unit tests live alongside each crate's source and run via cargo test --workspace (or just test). The browser app's tests run with bun run test from apps/web. The iOS app's UI tests run through xcodebuild test against the simulator.

Credits

Gogaku would not be possible without the community dictionaries it depends on. Source files are fetched on-device from upstream; nothing is redistributed by this project.

License

This project is dual-licensed under both the MIT License and the Apache License 2.0. You have permission to use this code under the conditions of either license pursuant to the rights granted by the chosen license.