Skip to content

vym.fyiA tiny, API-only URL shortener

Multi-tenant short links in Rust — an HTTP API and a CLI, deliberately no web UI.

vym.fyi

Docs at a glance ​

vymalo for your information is a small, multi-tenant URL shortener built in Rust. Use this site as the entry point for working with the codebase and understanding how the services fit together.

Running the docs locally ​

The site is a VitePress project in docs/, themed with @vaam-apps/vitepress-md3. It needs Node.js 22.12 or newer and pnpm 12.

bash
cd docs
pnpm install
pnpm dev   # live reload
pnpm build # static site in docs/.vitepress/dist

Design patterns in the app layer ​

  • Strategy: ProvidedSlugStrategy and GeneratedSlugStrategy choose how slugs are created in crates/vym-fyi-server-crud/src/handlers/links.rs.
  • Facade: CrudApp and RedirectApp wrap the DB pool, repository factory, and API-key state (crates/vym-fyi-server-crud/src/app.rs, crates/vym-fyi-server-redirect/src/app.rs).
  • Factory: PgRepositoryFactory implements the RepositoryFactory interface to provide database-backed repositories (crates/vym-fyi-model/src/services/repos.rs).
  • Adapter: LinkListQueryAdapter with QueryParamsBuilder converts list inputs into HTTP query params for both the CLI and Node bindings (crates/vym-fyi-model/src/services/query_adapter.rs).
  • Singleton: HttpClient::global exposes a shared HTTP client for reuse across crates (crates/vym-fyi-model/src/services/http_client.rs).

Tests and coverage ​

  • Unit tests live alongside services (config placeholder resolution, query adapter, HTTP client singleton, link strategies) and run with cargo test --workspace --all-targets.
  • Integration tests validate configuration loading and env resolution at crates/vym-fyi-model/tests/config_flow.rs.
  • CI runs the test suite on every push/PR via .github/workflows/ci.yml.
  • To measure coverage locally, run cargo llvm-cov --workspace --all-features --fail-under-lines 70 (70%+ recommended) and publish the generated report if needed.

Released under the MIT License.