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

create-apollo-monorepo

v0.9.0

Published

Scaffold a monorepo with a frontend app and Apollo CMS as a git submodule backend (single-origin via Next.js rewrites + assetPrefix)

Readme

create-apollo-monorepo

Scaffold a pnpm monorepo where your custom frontend lives alongside Apollo CMS mounted as a git submodule backend (read-only — pull updates only).

Usage

npx create-apollo-monorepo thamc-new

With flags:

npx create-apollo-monorepo thamc-new \
  --frontend-name "@thamc/frontend" \
  --db "postgresql://user:pass@localhost:5432/thamc" \
  --url "http://localhost:3000" \
  --locale th

Result

thamc-new/
├── apps/
│   ├── frontend/          ← @thamc/frontend (Next.js skeleton)
│   └── backend/           ← git submodule → apollo-cms
├── package.json           ← root workspace
├── pnpm-workspace.yaml
├── .env.local             ← shared dev env
├── .gitmodules            ← submodule config
└── .gitignore

Routing modes

Single-origin (default)

Both apps share one public origin (the frontend). The frontend's next.config.ts rewrites these paths to the backend so /_next/* doesn't collide:

| Browser path | Goes to | | ------------------------------------ | -------------------- | | /, your custom routes | apps/frontend | | /admin/* | apps/backend (admin pages and their JS chunks) | | /api/auth/*, /api/v1/*, /api/admin/*, /api/email/*, /api/cron, /api/health, /api/mcp, /api/editing-presence/* | apps/backend | | /uploads/* | apps/backend (media) | | /monitoring | apps/backend (Sentry tunnel, no-op without DSN) |

Apollo CMS reads APOLLO_ASSET_PREFIX (default /admin) and serves its built JS under <prefix>/_next/static/. Because the prefix coincides with the admin path, a single /admin/:path* rewrite covers both pages and chunks — no separate asset rewrite is emitted. The frontend must not define routes at /admin, /api/auth, /api/v1, etc.

You can override the prefix:

npx create-apollo-monorepo my-app --admin-prefix /cms

When the prefix is anything other than /admin, the scaffold also emits a matching <prefix>/:path* rewrite for backend chunks.

Separate origins (fallback)

Pass --admin-prefix none (or off/false/disabled) to skip the rewrite wiring. The backend runs at http://localhost:3000 and the frontend at http://localhost:3001. Useful when you'd rather deploy them on separate subdomains (e.g. cms.example.com + example.com).

Flags

| Flag | Default | Description | | -------------------------- | --------------------------------------- | ------------------------------------ | | --frontend-name <name> | @<dir>/frontend | Frontend package.json name | | --backend-url <url> | https://github.com/5Lab-Group-Co-Ltd/apollo-cms.git | Submodule git URL | | --backend-branch <name> | main | Submodule branch to track | | -d, --db <url> | (prompted) | DATABASE_URL for backend | | -u, --url <url> | :3001 single-origin / :3000 separate | NEXT_PUBLIC_SITE_URL | | -l, --locale <code> | en | NEXT_PUBLIC_DEFAULT_LOCALE | | --admin-prefix <path> | /admin | Single-origin admin/asset namespace; none to disable. Alias: --asset-prefix | | --skip-install | off | Don't run pnpm install | | --skip-submodule | off | Don't add the git submodule | | -h, --help | — | Show help |

After install

cd thamc-new
pnpm backend:setup   # push schema + seed apollo-cms
pnpm dev             # frontend :3001 + backend :3000 in parallel

In single-origin mode open http://localhost:3001/admin (the frontend port); the rewrite proxies to the backend and Better Auth's cookies/origins line up because NEXT_PUBLIC_SITE_URL and the backend's trustedProxyHeaders are wired to the public origin.

Updating the backend

pnpm backend:update  # git submodule update --remote --merge apps/backend

Don't edit files inside apps/backend — open issues / PRs against the apollo-cms repository upstream.