Getting started
Quick start
How Polaris CMS will install with v1 (a starter, an Astro integration, Next.js route handlers) and how to get the Polaris CMS kit today.
Coming with v1. The npm commands on this page describe the public release. The packages
polaris-cmsandcreate-polaris-cmsare not published yet, so these commands don't work today. See Today: the Polaris CMS kit for what is available now.
A new site#
One command will create an Astro or Next.js starter with Polaris built in: the blog pages, /studio, the API, the migrations and a Dockerfile.
npm create polaris-cms@latest my-site
An existing Astro site#
Install the package and add the integration. It adds /studio, the API routes under /api/cms/ and the migrations.
npm install polaris-cms
// astro.config.mjs (planned shape, coming with v1)
import { defineConfig } from "astro/config";
import node from "@astrojs/node";
import polaris from "polaris-cms/astro";
export default defineConfig({
adapter: node({ mode: "standalone" }),
integrations: [polaris()],
});
Your static pages stay static. Only the CMS routes render on the server.
An existing Next.js site#
Install the package and add one route file that re-exports the handlers.
npm install polaris-cms
// One route file in your app/ directory (planned shape, coming with v1)
export { GET, POST } from "polaris-cms/next";
The file location and the import paths above are a sketch of the plan, not final names. The v1 docs will fix them.
After installing (all three ways)#
- Point
DATABASE_URLat a PostgreSQL 16+ database. Migrations run on start. - Set
ADMIN_USERNAMEandADMIN_PASSWORD(and a session secret). See Deployment. - Open
/studioon your site and sign in. - Create an API key under API Keys if an agent or a script will publish. See Using with AI agents.
- Write the first post, or send it through the API.
Updates will come through npm update. Polaris runs anywhere Node runs, and a Docker recipe is included.
Today: the Polaris CMS kit#
Until v1 is out, the Polaris CMS kit is available on request: write to hello@scentro.pl. It is the /studio CMS on its own, with its API, database schema and migrations, in an Astro version and a Next.js version, plus step-by-step instructions for adding it to a site you already have.
Adding the Astro version to an existing site, in short:
-
Copy
astro/src/*into yoursrc/, andastro/migrationsandastro/scriptsinto the project root. If you already have amiddleware.ts, merge the/studiogate into it. -
Install the packages the kit is tested with:
npm i @astrojs/node@11.1.9 @astrojs/react@7.1.2 drizzle-orm@0.45.4 postgres@3.4.9 react@19.3.1 react-dom@19.3.1 react-markdown@10.1.0 remark-gfm@4.0.1 sharp@0.35.5 npm i -D tailwindcss@4.3.4 @tailwindcss/vite@4.3.4 -
In
tsconfig.json, add"paths": { "@cms/*": ["./src/cms/*"] }and"jsx": "react-jsx". -
In
astro.config:adapter: node({ mode: "standalone" }),integrations: [react({ include: ["src/cms/**/*.tsx"] })]andvite: { plugins: [tailwindcss()] }. Static pages stay static; the CMS routes opt out withprerender = false. -
Edit
src/config/site.ts(name, URL, locale) andsrc/config/pages.ts(the pages Link Genius and IndexNow offer). -
Add the blog pages that show the posts, using the public read functions in
@cms/journal/public.server.
The Next.js version follows the same idea: copy src/app/studio, src/app/api/cms, src/lib/studio, src/lib/blog and src/db, use output: "standalone", and gate /studio in its layout (no middleware needed). Then, for both:
export DATABASE_URL=postgres://user:pass@host:5432/db
npm run db:migrate
Sign in at /studio, create an API key and hand it to your agents.
Open source under MIT. Public release on GitHub and npm in preparation. Roadmap.