尚未收集仓库信息。
尚未检测到更新。GitHub 发布版本后会显示在这里。
制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗A Next.js journal application built with the App Router, featuring user authentication and database integration.
First, run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying src/app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
npm run lintnpm run formatnpm run format:checkESLint is used for code-quality and correctness checks, while Prettier handles code formatting.
Create a .env.local file in the root of your project with the following variables:
cp .env.example .env.local
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...
# LaunchDarkly feature flags (server-side)
LAUNCHDARKLY_SDK_KEY=sdk-...
# Optional: LaunchDarkly client-side id (for future client SDK usage)
NEXT_PUBLIC_LAUNCHDARKLY_CLIENT_SIDE_ID=...
# Database (Neon/PostgreSQL)
DATABASE_URL=postgresql://user:password@host:port/database
# Entry content encryption (base64-encoded 32-byte key)
ENTRY_CONTENT_ENCRYPTION_KEY=replace-with-openssl-rand-base64-32
# App URL (used in invite links)
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Invite Email Provider (optional)
# Resend is auto-detected when RESEND_API_KEY and RESEND_FROM_EMAIL are set.
# Optionally set INVITE_EMAIL_PROVIDER=resend explicitly, or INVITE_EMAIL_PROVIDER=none to disable email sending.
INVITE_EMAIL_PROVIDER=resend
RESEND_API_KEY=re_...
RESEND_FROM_EMAIL=SharedJournal <[email protected]>
# Support payments (Stripe)
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
SharedJournal can moderate entry and reflection content before writing to the database.
Add these variables to .env.local to enable moderation locally:
# Content moderation
CONTENT_MODERATION_ENABLED=true
CONTENT_MODERATION_PROVIDER=openai
CONTENT_MODERATION_API_KEY=sk-...
# Behavior when provider is unavailable:
# open -> allow writes (default)
# closed -> block writes and return retry message
CONTENT_MODERATION_FAIL_MODE=open
Behavior summary:
CONTENT_MODERATION_ENABLED must be exactly true to enforce moderation.CONTENT_MODERATION_FAIL_MODE=open, provider errors allow writes.CONTENT_MODERATION_FAIL_MODE=closed, provider errors block writes with a generic retry error.For full implementation details, see docs/content-moderation-implementation.md.
SharedJournal supports optional one-time "buy me a coffee" style contributions via Stripe Checkout.
/supportsrc/app/support/actions.ts/api/webhooks/stripe/support/successsupport_paymentsConfigure these events for your webhook endpoint:
checkout.session.completedcheckout.session.async_payment_succeededcheckout.session.async_payment_failedcheckout.session.expiredSTRIPE_SECRET_KEY=sk_test_...npm run dev
stripe listen --events checkout.session.completed,checkout.session.async_payment_succeeded,checkout.session.async_payment_failed,checkout.session.expired --forward-to http://localhost:3000/api/webhooks/stripe
whsec_...) and set:STRIPE_WEBHOOK_SECRET=whsec_...Notes:
4242 4242 4242 4242.For deployed environments (Vercel preview or production):
https://<your-domain>/api/webhooks/stripeSTRIPE_WEBHOOK_SECRET in that environment.Important:
whsec_... is different from production/preview dashboard endpoint secrets.sk_test_... vs sk_live_...).Stripe support payments require the support_payments table migration. Run:
npm run db:migrate
before testing checkout.
SharedJournal now includes a server-side LaunchDarkly helper at src/lib/launchdarkly/server-client.ts.
Basic usage in a Server Component or Server Action:
import {
createLaunchDarklyContext,
getLaunchDarklyVariation,
} from '@/lib/launchdarkly/server-client'
const context = createLaunchDarklyContext({
key: appUser.id,
name: appUser.displayName,
})
const isNewExperienceEnabled = await getLaunchDarklyVariation({
flagKey: 'new-experience',
context,
fallback: false,
})
Notes:
LAUNCHDARKLY_SDK_KEY must be set in your environment for the helper to initialize..env.local以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗