npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mktco/portal

v0.1.12

Published

Portal UI and packaged runtime for the mktco gateway

Readme

Portal

Browser-facing app for the mktco stack.

Owns

  • Better Auth sign-in and sign-up
  • protected chat UI
  • same-origin portal API routes
  • server-side gateway JWT minting
  • preview/live site management UI
  • mandatory portal-owned Gitea account provisioning and account helpers
  • startup-time validation of mandatory Better Auth, gateway, and Gitea config

Core boundary

Browser -> Portal -> Gateway

The browser talks to portal routes only. Gateway JWTs and shared secrets stay server-side.

Main surfaces

  • /{locale}/auth — public auth screen
  • /{locale}/chat — protected chat screen
  • app/api/** — same-origin routes that proxy or orchestrate backend work

Key directories

  • app/ — routes, layouts, and route handlers
  • components/ — UI composition and client hooks
  • lib/ — auth, gateway, site, and mandatory Gitea logic
  • docs/ — stable package-level docs
  • scripts/ — runtime helpers and migrations

Product rules

  • one active run in the UI model
  • there is one logical chat/session per user workspace
  • the portal may keep a best-effort local cached transcript per browser/user for UX resilience, but that cache is not a separate session model
  • preview means the editable workspace's built dist/ output
  • live means a separate checkout deployed from committed workspace state
  • SITE_HOSTING_MODE stays explicit: disabled, local, or managed
  • in local mode, preview/live are inspected through repo helper commands rather than direct public links

Local commands

npm run dev
npm run typecheck
npm run build
npm start

Portal startup validates mandatory Better Auth, gateway, and Gitea configuration before serving requests. Temporary Gitea outages are handled at request time; only missing or placeholder config blocks startup.

Current Gitea setup is manual:

  • GITEA_ADMIN_TOKEN must come from an admin-capable Gitea account that can create users, create repos, reset passwords, and delete users
  • GITEA_SYNC_SERVICE_USERNAME names the separate sync account that portal adds as a collaborator on each provisioned workspace repo
  • GITEA_PASSWORD_SECRET is a required portal secret used to encrypt stored pending Gitea passwords
  • the portal does not create either of these accounts or tokens for you
npm run provision:user-site -- alice

From the repo root (site:preview serves the workspace dist/ output, site:live serves the live checkout dist/ output):

npm run site:preview -- alice
npm run site:live -- alice

Package docs

  • docs/overview.md — scope and boundaries
  • docs/auth-and-gateway.md — auth flow and portal->gateway contract
  • docs/ui.md — chat and website-management UI scope

Related packages

  • gateway contract: ../gateway/README.md
  • deployment/operator docs: ../cli/README.md and ../cli/docs/