Replace Strapi CMS with PocketBase

Strapi + Postgres are gone in favor of PocketBase: a single Go binary
with embedded SQLite, built-in admin UI and per-collection API rules.
No content existed yet, so this is a clean swap with no data migration.

Collections and rules are defined as code in pocketbase/pb_migrations/
and applied automatically on first boot. Draft & Publish has no native
PocketBase equivalent, so it's reproduced with a nullable `publishedAt`
field enforced by listRule/viewRule, matching the old Strapi semantics.

Routing flips: PocketBase's admin UI and REST/file API are hardwired to
`/_/` and `/api/*` at the domain root (its own dashboard assets and API
calls reference those paths directly, so a stripped path prefix like
`/admin/*` would break them). `/api` is therefore reserved for
PocketBase now, and the frontend's Nitro endpoints move to `/content/*`
(frontend/server/routes/content/, not server/api/). A `/admin` vanity
route in Nitro (not Caddy) redirects to `/_/`, so it works the same in
dev, where Caddy isn't part of the stack, and in production.

frontend/server/utils/strapi.ts becomes pocketbase.ts; queries.ts is
rewritten for PocketBase's filter/sort/fields/expand query syntax.
StrapiImage becomes MediaImage (no width/height — PocketBase file
fields don't store dimensions, and the cover images already reserve
their aspect ratio via CSS, so this is not a regression).

docs/*.md, CLAUDE.md and README.md are updated in the same commit.
This commit is contained in:
2026-09-11 11:25:14 +02:00
parent 91540224a9
commit 49c42ecc96
64 changed files with 546 additions and 22706 deletions
+1 -3
View File
@@ -21,9 +21,7 @@ const cover = computed(() => mediaUrl(props.article.cover))
<img
class="cover"
:src="cover"
:alt="article.cover?.alternativeText ?? ''"
:width="article.cover?.width ?? undefined"
:height="article.cover?.height ?? undefined"
:alt="article.cover?.alt ?? ''"
loading="lazy"
>
</NuxtLink>
+5 -5
View File
@@ -1,14 +1,14 @@
import type { StrapiImage } from '#shared/types/blog'
import type { MediaImage } from '#shared/types/blog'
/**
* Strapi returns media paths relative to its own origin; the browser needs
* absolute ones. Remote providers (S3) already return absolute URLs.
* PocketBase returns file paths relative to its own origin; the browser
* needs absolute ones.
*/
export function useMediaUrl() {
const { public: config } = useRuntimeConfig()
return (image: StrapiImage | null | undefined): string | null => {
return (image: MediaImage | null | undefined): string | null => {
if (!image?.url) return null
return image.url.startsWith('http') ? image.url : `${config.strapiUrl}${image.url}`
return image.url.startsWith('http') ? image.url : `${config.pocketbaseUrl}${image.url}`
}
}
+2 -4
View File
@@ -4,7 +4,7 @@ import type { Article } from '#shared/types/blog'
const route = useRoute()
const slug = route.params.slug as string
const { data: article } = await useFetch<Article>(`/api/articles/${slug}`)
const { data: article } = await useFetch<Article>(`/content/articles/${slug}`)
if (!article.value) {
throw createError({ statusCode: 404, statusMessage: 'Article not found', fatal: true })
@@ -79,9 +79,7 @@ useHead({
v-if="cover"
class="cover"
:src="cover"
:alt="article.cover?.alternativeText ?? ''"
:width="article.cover?.width ?? undefined"
:height="article.cover?.height ?? undefined"
:alt="article.cover?.alt ?? ''"
>
<!-- eslint-disable-next-line vue/no-v-html -- rendered server-side from editor Markdown -->
+1 -1
View File
@@ -8,7 +8,7 @@ const page = computed(() => {
return Number.isInteger(value) && value > 0 ? value : 1
})
const { data, error, status } = await useFetch<Paginated<ArticleSummary>>('/api/articles', {
const { data, error, status } = await useFetch<Paginated<ArticleSummary>>('/content/articles', {
query: { page },
})
+2 -2
View File
@@ -9,13 +9,13 @@ const page = computed(() => {
return Number.isInteger(value) && value > 0 ? value : 1
})
const { data: category } = await useFetch<Category>(`/api/categories/${slug}`)
const { data: category } = await useFetch<Category>(`/content/categories/${slug}`)
if (!category.value) {
throw createError({ statusCode: 404, statusMessage: 'Category not found', fatal: true })
}
const { data, error } = await useFetch<Paginated<ArticleSummary>>('/api/articles', {
const { data, error } = await useFetch<Paginated<ArticleSummary>>('/content/articles', {
query: { page, category: slug },
})
+2 -4
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { ArticleSummary, Paginated } from '#shared/types/blog'
const { data, error } = await useFetch<Paginated<ArticleSummary>>('/api/articles', {
const { data, error } = await useFetch<Paginated<ArticleSummary>>('/content/articles', {
key: 'home-articles',
query: { page: 1 },
})
@@ -82,9 +82,7 @@ useSeoMeta({
>
<img
:src="featuredCover"
:alt="featured.cover?.alternativeText ?? ''"
:width="featured.cover?.width ?? undefined"
:height="featured.cover?.height ?? undefined"
:alt="featured.cover?.alt ?? ''"
>
</NuxtLink>