Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ad4e5d6
monorepo
matmanna May 23, 2026
b06aa6d
feat: astro cms
matmanna May 24, 2026
e3c1b39
feat: migrate more from frontmatter
matmanna May 24, 2026
b4d5ffb
prod
matmanna May 24, 2026
d6a8655
fix: build
matmanna May 24, 2026
9ead972
fix: no standalone
matmanna May 25, 2026
d2aa60a
chore: use bun
matmanna May 25, 2026
bcc2de4
chore: run cms in prod behind cloudflare tunnels!
matmanna May 26, 2026
a771528
chore: allowlist eps
matmanna May 26, 2026
a8d4fb3
fix: polish newsroom
matmanna Jun 7, 2026
812a7ea
Merge branch 'payl' of github.com:quackclub/slacker-news into payl
matmanna Jun 7, 2026
c724240
fix: OIDC redirects behind reverse proxy, reorganize post editor fiel…
Jun 7, 2026
3a39e23
fix: issues
matmanna Jun 8, 2026
f950ff0
chore: more pre-prod preparation
matmanna Jun 9, 2026
51850d5
chore: remove seed data and fix TypeScript errors after heroImage/rel…
matmanna Jun 9, 2026
97544f8
feat: cms preview
matmanna Jun 11, 2026
ebf920a
feat: coolify docker compose compatibility
matmanna Jun 14, 2026
eab0ce2
feat: seed mdx posts and categories
matmanna Jun 14, 2026
a6b69e6
Merge remote-tracking branch 'upstream/master' into payl
matmanna Jun 16, 2026
e3bc98e
fix: merge conflict markers
matmanna Jun 16, 2026
39ed2b8
fix: dockerfile
matmanna Jun 16, 2026
3198b89
fix: workspace node_modules paths for bun configVersion 1
matmanna Jun 16, 2026
77481c8
fix: seed-trigger verbose logging & slug-to-id resolution
matmanna Jun 16, 2026
9254042
fix: seed route uses REST API instead of getPayload to avoid server c…
matmanna Jun 16, 2026
2bb936a
fix: seed route uses getPayload with overrideAccess, fix container re…
matmanna Jun 16, 2026
334b030
Merge remote-tracking branch 'upstream/master' into payl
matmanna Jun 17, 2026
673645e
Merge remote-tracking branch 'upstream/master' into payl
matmanna Jun 17, 2026
3190f49
fix: Lexical error #17 list items, incremental seed imports
matmanna Jun 17, 2026
ec0c3d6
fix: re-import existing MDX posts to fix broken Lexical JSON
matmanna Jun 17, 2026
bca0770
fix: only update content field on existing posts, add type cast
matmanna Jun 17, 2026
1fe4937
fix: add overrideAccess to existing posts lookup to find draft posts
matmanna Jun 17, 2026
bc883c6
fix: add tag, start, direction fields to Lexical list nodes
matmanna Jun 17, 2026
9627918
fix: per-slug lookup instead of bulk pre-fetch for existing posts
matmanna Jun 17, 2026
daf583f
fix: sanitize slug whitespace, rename file with space to hyphen
matmanna Jun 17, 2026
8d642e0
fix: try-create with catch fallback to find+update for slug conflicts
matmanna Jun 17, 2026
9c6ba1f
fix: move process.on(unhandledRejection) inside handler to avoid modu…
matmanna Jun 17, 2026
89c2c8c
fix: corrupted pg db
matmanna Jun 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.git
.gitignore
.gitattributes
node_modules
.turbo
.next
.astro
dist
.crush
.agents
*.md
.vscode
.github
.crush
.env
.env.*
.DS_Store
apps/cms/.next
apps/cms/node_modules
apps/web/node_modules
apps/web/.astro
apps/web/dist
packages/*/node_modules
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ on:
jobs:
build:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: sn_cms
POSTGRES_USER: sn_cms
POSTGRES_PASSWORD: sn_cms
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v6

Expand All @@ -25,3 +39,7 @@ jobs:

- name: Build
run: bun run build
env:
DATABASE_URL: postgres://sn_cms:sn_cms@postgres:5432/sn_cms
PAYLOAD_SECRET: test-secret-for-ci
NEXT_PUBLIC_SERVER_URL: http://localhost:3000
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,18 @@ review-import.json
.env.local
.env.development
.env.test
.env.production
.env.production

# Payload default media upload directory
public/media/
public/robots.txt
public/sitemap*.xml

# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/

# Next.js
next-env.d.ts
10 changes: 0 additions & 10 deletions Dockerfile

This file was deleted.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Start the development server with hot reload:
bun run dev
```

```bash
docker compose build cms && docker compose stop cms && docker compose rm -f cms && docker compose up -d cms
```

The site will be available at `http://localhost:3000` by default. Changes to content files, components, and styles rebuild automatically.

Styles are authored in `src/styles/main.scss` and bundled by Astro.
Expand Down
10 changes: 10 additions & 0 deletions apps/cms/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
max_line_length = null
20 changes: 20 additions & 0 deletions apps/cms/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Database connection string
DATABASE_URL=postgres://sn_cms:sn_cms@postgres:5432/sn_cms

# Used to encrypt JWT tokens
PAYLOAD_SECRET=YOUR_SECRET_HERE

# Used to configure CORS, format links and more. No trailing slash
NEXT_PUBLIC_SERVER_URL=http://localhost:3000

# Secret used to authenticate cron jobs
CRON_SECRET=YOUR_CRON_SECRET_HERE

# Used to validate preview requests
PREVIEW_SECRET=YOUR_SECRET_HERE

# Hack Club OIDC
HACKCLUB_CLIENT_ID=YOUR_CLIENT_ID_HERE
HACKCLUB_CLIENT_SECRET=YOUR_CLIENT_SECRET_HERE
# Optional override; defaults to https://your-site/admin/auth/hackclub/callback
HACKCLUB_REDIRECT_URI=http://localhost:3000/admin/auth/hackclub/callback
22 changes: 22 additions & 0 deletions apps/cms/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
build
dist / media
node_modules
.DS_Store
.env
.next
next-env.d.ts
.vercel

# Payload default media upload directory
public/media/

public/robots.txt
public/sitemap*.xml


# Playwright
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
2 changes: 2 additions & 0 deletions apps/cms/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
legacy-peer-deps=true
enable-pre-post-scripts=true
14 changes: 14 additions & 0 deletions apps/cms/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**/payload-types.ts
.tmp
**/.git
**/.hg
**/.pnp.*
**/.svn
**/.yarn/**
**/build
**/dist/**
**/node_modules
**/temp
**/docs/**
tsconfig.json

6 changes: 6 additions & 0 deletions apps/cms/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100,
"semi": false
}
3 changes: 3 additions & 0 deletions apps/cms/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
24 changes: 24 additions & 0 deletions apps/cms/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug full stack",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/next/dist/bin/next",
"runtimeArgs": ["--inspect"],
"skipFiles": ["<node_internals>/**"],
"serverReadyAction": {
"action": "debugWithChrome",
"killOnServerStop": true,
"pattern": "- Local:.+(https?://.+)",
"uriFormat": "%s",
"webRoot": "${workspaceFolder}"
},
"cwd": "${workspaceFolder}"
}
]
}
41 changes: 41 additions & 0 deletions apps/cms/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"npm.packageManager": "pnpm",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"editor.formatOnSaveMode": "file",
"js/ts.tsdk.path": "node_modules/typescript/lib",
"js/ts.tsdk.promptToUseWorkspaceVersion": true,
"[javascript][typescript][typescriptreact]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}
}
42 changes: 42 additions & 0 deletions apps/cms/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM oven/bun:1-alpine AS base
RUN apk add --no-cache libc6-compat

FROM base AS deps
WORKDIR /app
COPY package.json bun.lock turbo.json ./
COPY apps/cms/package.json apps/cms/
COPY packages/ packages/
RUN bun install

FROM base AS dev
WORKDIR /app/apps/cms
COPY --from=deps /app/node_modules /app/node_modules
COPY packages/ /app/packages/
COPY apps/cms/ .
EXPOSE 3000
ENV PORT 3000
CMD ["bun", "run", "dev"]

FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY apps/cms/ apps/cms/
COPY packages/ packages/
ENV NEXT_TELEMETRY_DISABLED 1
ENV NODE_OPTIONS="--max-old-space-size=4096 --no-deprecation"
RUN cd apps/cms && bun run build

FROM base AS runner
WORKDIR /app/apps/cms
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder --chown=nextjs:nodejs /app/apps/cms/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/apps/cms/.next ./.next
COPY --from=builder --chown=nextjs:nodejs /app/apps/cms/package.json ./
COPY --from=deps --chown=nextjs:nodejs /app/node_modules ./node_modules
USER nextjs
EXPOSE 3000
ENV PORT 3000
CMD ["bun", "run", "start"]
17 changes: 17 additions & 0 deletions apps/cms/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.mjs",
"css": "src/app/(frontend)/globals.css",
"baseColor": "slate",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/utilities/ui"
}
}
3 changes: 3 additions & 0 deletions apps/cms/dev-entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
# Run next dev and pipe "y" to handle the schema push prompt
printf "y\n" | cross-env NODE_OPTIONS=--no-deprecation next dev --webpack
38 changes: 38 additions & 0 deletions apps/cms/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { dirname } from 'path'
import { fileURLToPath } from 'url'
import { FlatCompat } from '@eslint/eslintrc'

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

const compat = new FlatCompat({
baseDirectory: __dirname,
})

const eslintConfig = [
...compat.extends('next/core-web-vitals', 'next/typescript'),
{
rules: {
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-empty-object-type': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'warn',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: false,
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^(_|ignore)',
},
],
},
},
{
ignores: ['.next/', 'src/payload-types.ts', 'src/payload-generated-schema.ts'],
},
]

export default eslintConfig
20 changes: 20 additions & 0 deletions apps/cms/next-sitemap.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const SITE_URL =
process.env.NEXT_PUBLIC_SERVER_URL ||
process.env.VERCEL_PROJECT_PRODUCTION_URL ||
'https://example.com'

/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: SITE_URL,
generateRobotsTxt: true,
exclude: ['/posts-sitemap.xml', '/pages-sitemap.xml', '/*', '/posts/*'],
robotsTxtOptions: {
policies: [
{
userAgent: '*',
disallow: '/admin/*',
},
],
additionalSitemaps: [`${SITE_URL}/pages-sitemap.xml`, `${SITE_URL}/posts-sitemap.xml`],
},
}
Loading