← Crafts
Portal preview

Portal

Platform tooling Solo engineer

Typed TypeScript helpers for JuanFi hotspot pages — vendo API, browser flows, and admin routes without loose fetch calls.

Overview

Custom JuanFi captive portals and vendo integrations usually copy untyped scripts between machines. Portal (juanfi-toolkit) publishes npm packages that wrap vendo endpoints, browser-side hotspot flows, and the firmware admin API with consistent result types.

Packages

  • @svene/juanfi-api — portal-side vendo calls (top-up, coin check, vouchers, rates, charging ports, e-load)
  • @svene/juanfi-hotspot — browser helpers: voucher/member login, CHAP, coin and e-load flows, timers, storage
  • @svene/juanfi-admin — typed /admin/api/* client with 65-field system config parser and dashboard snapshot
  • Vitest test suite and workspace builds via tsdown
  • Public npm packages with version badges in README
  • Explicit non-goals: no MikroTik install, no JuanFI admin UI replacement, no version guarantee
HotspotPage juanfi-hotspot juanfi-api JuanFi vendo HTTP AdminApp juanfi-admin /admin/api/*
Toolkit boundaries
export function createJuanFiApi(options: JuanFiApiOptions): JuanFiApi {
  const core = createCore(options);
  return {
    startTopup: (input) => startTopup(core, input),
    cancelTopup: (input) => cancelTopup(core, input),
    checkCoin: (input) => checkCoin(core, input),
    useVoucher: (input) => useVoucher(core, input),
    getRates: (input) => getRates(core, input),
    getChargingPorts: () => getChargingPorts(core),
    // ...
  };
}
JuanFi toolkit package diagram
Screenshot placeholder — typed vendo client usage in a custom hotspot page.