-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: drop PayloadCMS legacy traces and consolidate DB SSL handling #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ed42adf
feat: add /intro/history page with payloadcms
sboh1214 8ad9467
feat: add markdowns and reports
sboh1214 4bb83d7
chore: update pnpm dependencies
sboh1214 c4af1f1
feat: migrate to pure prisma, better-auth (remove payload.js)
sboh1214 7976864
chore: fix database ssl
sboh1214 534f216
refactor: drop PayloadCMS legacy traces and consolidate DB SSL handling
sboh1214 4d78278
fix: make prisma config resilient to placeholder DATABASE_URL
sboh1214 11c6a1e
fix(prisma): let prisma generate run without DATABASE_URL
sboh1214 fe9b978
ci: drop automatic Prisma migration step from CD
sboh1214 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,12 @@ | ||
| .github | ||
| .idea | ||
| .next | ||
| .env | ||
| .env.* | ||
| !.env.example | ||
| node_modules | ||
| eslint.config.mjs | ||
| prettier.config.mjs | ||
| .gitignore | ||
| README.md | ||
| tsconfig.tsbuildinfo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # PROJECT KNOWLEDGE BASE | ||
|
|
||
| ## OVERVIEW | ||
|
|
||
| STDev Corp. (사단법인 에스티데브) Korean nonprofit homepage. Next.js 16 App Router + React 19 + Prisma/Postgres DIY CMS + better-auth + Chakra UI v3, shipped as a standalone Docker image. | ||
|
|
||
| ## STRUCTURE | ||
|
|
||
| ``` | ||
| stdev/ | ||
| ├── prisma/schema.prisma # CMS/auth data model | ||
| ├── prisma.config.ts # Prisma config; reads DATABASE_URL | ||
| ├── src/ | ||
| │ ├── app/ # (stdev) public site, (cms) admin, api/auth | ||
| │ ├── components/ # UI building blocks | ||
| │ └── utils/ # cms.ts, prisma.ts, auth.ts, menus/links/date helpers | ||
| ├── public/images/ # intro/, business/, gov/ static assets | ||
| └── .github/workflows/ # ci.yml (build+lint), cd.yml (ghcr.io image) | ||
| ``` | ||
|
|
||
| ## WHERE TO LOOK | ||
|
|
||
| | Task | Location | Notes | | ||
| | ----------------------- | -------------------------------------------------------------------------------------- | --------------------------------------------------------- | | ||
| | Change CMS schema | `prisma/schema.prisma` | Then run `pnpm db:generate` and create/apply a migration | | ||
| | Public CMS query | `src/utils/cms.ts` | Server-only helpers used by async pages | | ||
| | Prisma client | `src/utils/prisma.ts` | Reuses one client during dev hot reload | | ||
| | Auth config | `src/utils/auth.ts` + `src/utils/admin-auth.ts` + `src/app/api/auth/[...all]/route.ts` | Google-only better-auth with Prisma adapter | | ||
| | Admin UI | `src/app/(cms)/admin/**` | DIY CMS forms protected by better-auth | | ||
| | Add a public page/route | `src/app/(stdev)/<path>/page.tsx` | Also update `src/utils/menus.ts` and `src/utils/links.ts` | | ||
| | Shared layout chrome | `src/components/layout/` | `basic-layout`, `left-menu-layout`, `navbar`, `footer` | | ||
| | Markdown rendering | `src/components/markdown/markdown-view.tsx` | Chakra-mapped react-markdown + remark-gfm | | ||
|
|
||
| ## CONVENTIONS | ||
|
|
||
| - **Package manager**: pnpm@10.33.3 only. Never commit a non-pnpm lockfile. | ||
| - **Prettier**: `semi: false`, `singleQuote: true`, `trailingComma: 'all'`, `tabWidth: 2`. | ||
| - **Import alias**: `@/*` → `./src/*`. | ||
| - **Server vs client**: Pages are async server components by default. Client components declare `'use client'`. | ||
| - **Rendering**: `(stdev)/layout.tsx` sets `export const dynamic = 'force-dynamic'` for request-time CMS reads. | ||
| - **Locale**: `<html lang="ko">` + Korean UI strings; dates format as `YYYY년 M월 D일`. | ||
| - **Styling**: Public site uses Chakra v3 primitives. Admin currently uses simple React/HTML forms. | ||
| - **Env enforcement**: Required public envs are thrown on missing in layout/providers. | ||
|
|
||
| ## ANTI-PATTERNS | ||
|
|
||
| - Do not edit generated Prisma client output in `node_modules`; change `prisma/schema.prisma` and regenerate. | ||
| - Do not add semicolons. | ||
| - Do not statically render `(stdev)`. | ||
| - Do not add new image remote hosts without updating `next.config.ts` `images.remotePatterns`. | ||
|
|
||
| ## COMMANDS | ||
|
|
||
| ```bash | ||
| pnpm dev # Next.js dev server on :3000 | ||
| pnpm build # Production build | ||
| pnpm start # Run production build | ||
| pnpm lint # ESLint + prettier integration | ||
| pnpm prettier:write # Format all | ||
| pnpm prettier:check # CI-style check | ||
| pnpm db:generate # Generate Prisma client | ||
| pnpm db:migrate # Local schema migration | ||
| pnpm db:migrate:deploy # Production migration deploy | ||
| ``` | ||
|
|
||
| ## NOTES | ||
|
|
||
| - No test suite exists. CI runs build + lint. | ||
| - Docker prod port is 1000. | ||
| - Existing S3 object URLs are preserved as CMS asset URLs; remote host is `stdev-kr.s3.ap-northeast-2.amazonaws.com`. | ||
| - `BETTER_AUTH_SECRET`, `BETTER_AUTH_URL`, `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`, and `DATABASE_URL` are required for the CMS/auth stack. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,28 @@ | ||
| import type { NextConfig } from 'next' | ||
| import { withPayload } from '@payloadcms/next/withPayload' | ||
|
|
||
| const s3Hosts = new Set([ | ||
| 'stdev-kr.s3.ap-northeast-2.amazonaws.com', | ||
| process.env.S3_BUCKET | ||
| ? `${process.env.S3_BUCKET}.s3.${process.env.AWS_REGION ?? 'ap-northeast-2'}.amazonaws.com` | ||
| : null, | ||
| ]) | ||
|
|
||
| const nextConfig: NextConfig = { | ||
| output: 'standalone', | ||
| images: { | ||
| remotePatterns: [ | ||
| { | ||
| remotePatterns: [...s3Hosts] | ||
| .filter((hostname): hostname is string => Boolean(hostname)) | ||
| .map((hostname) => ({ | ||
| protocol: 'https', | ||
| hostname: 'stdev-kr.s3.ap-northeast-2.amazonaws.com', | ||
| hostname, | ||
| port: '', | ||
| pathname: '**', | ||
| search: '', | ||
| }, | ||
| ], | ||
| })), | ||
| }, | ||
| experimental: { | ||
| authInterrupts: true, | ||
| }, | ||
| } | ||
|
|
||
| export default withPayload(nextConfig) | ||
| export default nextConfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify the fenced code block language.
The fence at Line 9 has no language token and will keep MD040 warnings active.
Suggested patch
📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 9-9: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents