Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
62 changes: 13 additions & 49 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,53 +1,17 @@
# ================================
# APPLICATION SETTINGS
# ================================
NEXT_PUBLIC_APP_URL='http://localhost:3000'
NODE_ENV=development
APP_NAME="Flash Fathom AI"
APP_DESCRIPTION="Your AI-powered flashcard generator"
APP_VERSION="1.0.0"
APP_HOST=localhost
APP_PORT=3000

# ================================
# POSTGRESQL CONFIGURATION
# ================================
POSTGRES_DB=flashfathom
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your_secure_password_here
POSTGRES_PORT=5432

# ================================
# CLERK AUTHENTICATION
# ================================
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="your nextjs publishable key"
CLERK_SECRET_KEY="your clerk secret key"
# Clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=

# Clerk URLs
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/generate
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/
# Razorpay
NEXT_PUBLIC_RAZORPAY_KEY_ID=
RAZORPAY_KEY_ID=
RAZORPAY_KEY_SECRET=

# ================================
# AI APIS
# ================================
GEMINI_API_KEY=""
# Database
DATABASE_URL=

# ================================
# EMAIL CONFIGURATION
# ================================
EMAIL_USER=
EMAIL_PASS=
# Gemini API
GEMINI_API_KEY=

# ================================
# DATABASE URL (Updated for Docker)
# ================================
DATABASE_URL="postgresql://postgres:your_secure_password_here@postgres:5432/flashfathom"

# ================================
# RAZORPAY CONFIGURATION
# ================================
RAZORPAY_KEY_ID="your_razorpay_key_id"
RAZORPAY_KEY_SECRET="your_razorpay_key_secret"
NEXT_PUBLIC_RAZORPAY_KEY_ID="your_razorpay_key_id"
# App Port
APP_PORT=3000
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# clerk configuration (can include secrets)
/.clerk/
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# ================================
FROM node:18-alpine AS builder

# Install system dependencies
RUN apk add --no-cache openssl libc6-compat postgresql-client
# Install system dependencies, including the required OpenSSL 1.1 library
RUN apk add --no-cache openssl1.1-compat libc6-compat postgresql-client

WORKDIR /app

Expand Down Expand Up @@ -58,8 +58,8 @@ ENV NEXT_TELEMETRY_DISABLED=1
# Enable corepack and install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate

# Install runtime dependencies INCLUDING postgresql-client for pg_isready
RUN apk add --no-cache openssl libc6-compat postgresql-client
# Install runtime dependencies, including the required OpenSSL 1.1 library
RUN apk add --no-cache openssl1.1-compat libc6-compat postgresql-client

# Create non-root user
RUN addgroup --system --gid 1001 flashfathom \
Expand Down
6 changes: 5 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
// Remove standalone output to avoid Windows symlink permission issues
// output: 'standalone',
Comment on lines +3 to +4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

🧩 Analysis chain

Don’t disable output: 'standalone' unconditionally — gate it for CI/containers.

Disabling standalone can break container/cloud deploys that expect the standalone output. Keep it off for Windows dev, but enable in CI.

Apply this diff and add the helper constant:

+const enableStandalone =
+  process.env.CI === 'true' || process.env.NEXT_STANDALONE === 'true';
 /** @type {import('next').NextConfig} */
 const nextConfig = {
-  // Remove standalone output to avoid Windows symlink permission issues
-  // output: 'standalone',
+  // Standalone for CI/containers; keep off on Windows dev
+  ...(enableStandalone && { output: 'standalone' }),

Run locally to verify deploy parity:


🏁 Script executed:

#!/bin/bash
# Show Next version and whether standalone is enabled
jq -r '.dependencies.next // .devDependencies.next' package.json
CI=true node -e "const cfg=require('./next.config.js'); console.log('output:', cfg.output||'(none)')"

Length of output: 21


Enable standalone in CI/containers (don't disable unconditionally)

Current config has no output set (CI=true test printed "output: (none)"). Gate standalone and apply:

+const enableStandalone = Boolean(process.env.CI) || process.env.NEXT_STANDALONE === 'true';
 /** @type {import('next').NextConfig} */
 const nextConfig = {
-  // Remove standalone output to avoid Windows symlink permission issues
-  // output: 'standalone',
+  // Standalone for CI/containers; keep off on Windows dev
+  ...(enableStandalone && { output: 'standalone' }),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Remove standalone output to avoid Windows symlink permission issues
// output: 'standalone',
const enableStandalone = Boolean(process.env.CI) || process.env.NEXT_STANDALONE === 'true';
/** @type {import('next').NextConfig} */
const nextConfig = {
// Standalone for CI/containers; keep off on Windows dev
...(enableStandalone && { output: 'standalone' }),
🤖 Prompt for AI Agents
In next.config.js around lines 3-4, the config currently comments out output:
'standalone' unconditionally; instead, enable standalone mode when running in CI
or container environments. Change the config to set output: 'standalone' when
process.env.CI === 'true' or process.env.CONTAINER === 'true' (or another CI env
flag your CI uses), and omit or leave undefined for local/dev to avoid Windows
symlink issues; implement this by computing an output value from those env vars
and including it in the exported config.

transpilePackages: ['react-toastify'],
// ✅ FIXED: Updated for Next.js 15 stable
serverExternalPackages: ['@prisma/client'], // Moved from experimental
// Disable static generation to avoid Clerk issues during build
trailingSlash: false,
generateEtags: false,
turbopack: {
// ✅ FIXED: Moved from experimental.turbo
rules: {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@vercel/analytics": "^1.5.0",
"axios": "^1.8.2",
"button": "^1.1.1",
"chart.js": "^4.5.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"dotenv": "^16.4.7",
Expand All @@ -45,6 +46,7 @@
"nodemailer": "^6.10.0",
"razorpay": "^2.9.6",
"react": "^19.0.0",
"react-chartjs-2": "^5.3.0",
"react-dom": "^19.0.0",
"react-hook-form": "^7.54.2",
"react-toastify": "^11.0.5",
Expand Down
Loading