A MoonBit workspace for building web applications and shared libraries.
Modules
libs
Shared libraries used across the workspace.
url
A complete RFC 3986 URL parsing package, modeled after Go’s net/url. Provides URL parsing, component extraction, percent-encoding, and query string handling.
let u = @url.parse("https://user:pwd@example.com:8080/path?q=v#frag").unwrap()
assert_eq!(u.scheme?, "https")
assert_eq!(u.user_info?.username, "user")
assert_eq!(u.host?, "example.com:8080")
assert_eq!(u.path?, "/path")
assert_eq!(u.query?, "q=v")
assert_eq!(u.fragment?, "frag")
jwt
JWT creation, signing, parsing, and validation with HMAC-SHA256 (HS256). Supports registered claims (RFC 7519) and extensible custom claims.
let method = new_hmac_sha256(b"secret-key")
let claims = RegisteredClaims::new(subject="user123")
let token = Token::sign(method, claims)
let parser = Parser::new()
let (token, claims) = parser.parse("eyJhbG...", method)
assert_eq!(claims.subject?, "user123")
time
A Datetime wrapper around moonbitlang/x/time (ZonedDateTime) with ISO 8601 serialization and PostgreSQL timestamptz compatibility.
let dt = @time.now()
let s = dt.to_iso8601() // "2026-07-03T12:34:56.123Z"
let parsed = @time.Datetime::from_iso8601(s).unwrap()
assert_eq!(dt, parsed)
moonstore
An object storage service with a REST-ish HTTP API, inspired by S3-style buckets and objects.
Buckets & objects — create buckets, upload/download objects, list with prefixes, copy/move/delete
Storage backends — MemoryBackend for tests, LocalFSBackend for filesystem persistence
Metadata repos — in-memory (MemoryBucketRepo/MemoryObjectRepo) or PostgreSQL (PGRepo) via mattn/postgres
Authorization — Cedar policy engine integration through mooncedar
// In-memory server (moonstore/cmd/storage)
let storage = @repo.new_storage()
let router = @pony.Router::Router()
@api.build_bucket_routes(router, storage) catch { _ => panic() }
@api.build_object_routes(router, storage) catch { _ => panic() }
@pony.start("0.0.0.0:3000", router)
// PostgreSQL-backed metadata with local filesystem object storage
let storage = @repo.new_postgres_storage(
"postgres://postgres:111111@localhost:5432/postgres",
)
// Tables are created automatically by migrate().
Getting Started
# Clone the repo
git clone git@github.com:jaredzhou/moonbase.git
cd moonbase
# Run tests
moon test --all
# Check the workspace
moon check
moonbase
A MoonBit workspace for building web applications and shared libraries.
Modules
libs
Shared libraries used across the workspace.
url
A complete RFC 3986 URL parsing package, modeled after Go’s
net/url. Provides URL parsing, component extraction, percent-encoding, and query string handling.jwt
JWT creation, signing, parsing, and validation with HMAC-SHA256 (HS256). Supports registered claims (RFC 7519) and extensible custom claims.
time
A
Datetimewrapper aroundmoonbitlang/x/time(ZonedDateTime) with ISO 8601 serialization and PostgreSQLtimestamptzcompatibility.moonstore
An object storage service with a REST-ish HTTP API, inspired by S3-style buckets and objects.
MemoryBackendfor tests,LocalFSBackendfor filesystem persistenceMemoryBucketRepo/MemoryObjectRepo) or PostgreSQL (PGRepo) viamattn/postgresmooncedarGetting Started
License
Apache 2.0 — see LICENSE for details.