GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Dey11/pdx

BranchesTags
Open more actions menu

Latest commit

 

History

159 Commits
159 Commits

Folders and files

NameName
Last commit message
Last commit date
prisma
prisma
 
 
public
public
 
 
src
src
 
 
worker
worker
 
 
.dockerignore
.dockerignore
 
 
.env.local.example
.env.local.example
 
 
.env.production.docker.example
.env.production.docker.example
 
 
.env.production.example
.env.production.example
 
 
.eslintrc.json
.eslintrc.json
 
 
.gitignore
.gitignore
 
 
.prettierrc.json
.prettierrc.json
 
 
Dockerfile
Dockerfile
 
 
README.md
README.md
 
 
bun.lock
bun.lock
 
 
components.json
components.json
 
 
docker-compose.yml
docker-compose.yml
 
 
eslint.config.mjs
eslint.config.mjs
 
 
next.config.ts
next.config.ts
 
 
package.json
package.json
 
 
postcss.config.mjs
postcss.config.mjs
 
 
prisma.config.ts
prisma.config.ts
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

NoteFormula

Formerly PDX.

AI study material generator. Paste a syllabus and NoteFormula generates comprehensive, exam-ready PDF study notes and question banks.

This repository is a single deployable unit:

  • a Next.js web app at the repo root (marketing pages, dashboard, auth, API route handlers, BullMQ queue producers, payments)
  • a colocated BullMQ worker under worker/ (AI generation, PDF rendering, PDF merging) that connects to the same Redis instance
  • one Dockerfile with separate web and worker build targets
  • one docker-compose.yml that runs redis, web, and worker (Postgres is an external managed database — Neon)

Stack

  • Next.js 16.2.11 (App Router, Turbopack)
  • React 19.2.8
  • TypeScript 6
  • Tailwind CSS 4 (CSS-first config) with the full shadcn/ui component set
  • Prisma 7.9 with @prisma/adapter-pg (PostgreSQL)
  • Better Auth 1.6.23 (Google, GitHub, email/password)
  • BullMQ 5.80 on Redis
  • Bun runtime and package manager
  • AI SDK v6 — DeepSeek V4 Flash primary with a Gemini fallback chain
  • Cloudflare R2 (via the AWS S3 SDK) for generated PDFs
  • Dodo Payments (webhook verification via standardwebhooks)
  • Resend for transactional email
  • PostHog and Vercel Analytics / Speed Insights

Routes

Pages:

  • /
  • /pricing
  • /about
  • /policy
  • /terms
  • /login
  • /login/reset-password
  • /dashboard
  • /dashboard/generate/theory
  • /dashboard/generate/qbank
  • /history
  • /settings

API:

  • /api/auth/[...all]
  • /api/health
  • /api/credits
  • /api/payment-link/[productId]
  • /api/transactions
  • /api/webhook
  • /api/admin/create-coupon
  • /api/generation/generate-topics
  • /api/generation/enqueue-generation
  • /api/generation/update-task
  • /api/generation/progress
  • /api/generation/progress/[materialId]
  • /api/generation/complete
  • /api/generation/download/[materialId]

Commands

Bun is the only supported toolchain.

bun install

bun run dev            # Next.js dev server (Turbopack)
bun run worker:dev     # run the worker against the same Redis
bun run worker:build   # compile the worker to worker/dist
bun run worker:start   # run the compiled worker

bun run lint           # ESLint

bun run prisma:generate
bun run prisma:push    # only after DATABASE_URL is confirmed

bun run docker:config  # render the compose config
bun run docker:up      # build + start the full stack
bun run docker:down    # stop the stack

prisma.config.ts owns the Prisma datasource URL. bunx prisma generate runs without a live database; do not run bunx prisma db push or migrations until the target DATABASE_URL is confirmed.

ESLint is pinned to 9.39.4 because ESLint 10 currently crashes through the React plugin used by [email protected].

Validation note: builds and type checks are heavy. On the shared VPS run them through the safe-dev-run wrapper (e.g. safe-dev-run bun run build); never launch a raw next build or tsc directly.

The worker

The generation pipeline is not complete with the Next.js server alone. The worker must run and connect to the same Redis instance.

Queues (names shared literally between src/lib/constants.ts and worker/src/constants.ts — never rename one without the other):

  • theoryQueue
  • qbankQueue
  • mergePdfQueue
  • completionQueue

The worker posts progress and results back to the web app:

  • /api/generation/update-task
  • /api/generation/progress
  • /api/generation/complete

These callbacks are authenticated with a shared secret. The worker attaches x-worker-secret: $WORKER_CALLBACK_SECRET (see worker/src/callback.ts) and the web app verifies it with a timing-safe compare (see src/lib/worker-auth.ts). If WORKER_CALLBACK_SECRET is unset, verification is skipped and a one-time warning is logged, so set it on both services in production. worker/src/env.ts requires it in production.

Model fallback chain

Both the web app and the worker read AI_GENERATION_MODELS: an ordered, comma-separated list of provider:model-id entries tried in sequence. Default:

deepseek:deepseek-v4-flash,deepseek:deepseek-chat,google:gemini-2.5-flash

Bare gemini-* IDs are inferred as Google; other bare IDs are inferred as DeepSeek. Reorder or replace the list to change the primary model or fallback chain without editing generator code. AI_GENERATION_MAX_OUTPUT_TOKENS caps output tokens per call.

Environment

Pick the template that matches how you run the app, copy it, and replace every placeholder. Never commit a filled-in file.

  • .env.local.example — local web + worker without Docker
  • .env.production.example — production web + worker run directly on a host/VM
  • .env.production.docker.example — combined env list for docker-compose.yml (also what you paste into Coolify)

Variables by concern:

  • Auth / web — BETTER_AUTH_URL, BETTER_AUTH_SECRET, AUTH_SECRET, AUTH_TRUST_HOST, AUTH_GOOGLE_ID, AUTH_GOOGLE_SECRET, AUTH_GITHUB_ID, AUTH_GITHUB_SECRET
  • Email — AUTH_RESEND_KEY (the single Resend key), AUTH_EMAIL_FROM
  • Database — DATABASE_URL (external managed Postgres — Neon; the compose stack does not run its own Postgres)
  • Redis — REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_TLS (always the compose-managed Redis)
  • Worker link — BACKEND_URL, WORKER_CALLBACK_SECRET
  • AI — AI_GENERATION_MODELS, AI_GENERATION_MAX_OUTPUT_TOKENS (read by both web and worker), plus the API key for each referenced provider (DEEPSEEK_API_KEY, GOOGLE_API_KEY); a key is only required when its provider appears in the model list
  • Storage (Cloudflare R2) — CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_ACCESS_KEY_ID, CLOUDFLARE_SECRET_ACCESS_KEY, BUCKET_NAME
  • PDF rendering — PUPPETEER_EXECUTABLE_PATH (PUPPETEER_SKIP_CHROMIUM_DOWNLOAD is a Docker build arg, not a runtime var)
  • Payments — WEBHOOK_SECRET, STATIC_PAYMENT_LINK, ADMIN_KEY
  • Analytics — NEXT_PUBLIC_POSTHOG_HOST, NEXT_PUBLIC_POSTHOG_KEY

Deployment

docker-compose.yml builds web and worker from the same Dockerfile (targets web and worker) and starts the redis service alongside them. Postgres is external (Neon) via DATABASE_URL. For Coolify, paste .env.production.docker.example (with placeholders replaced) and let the connected GitHub App source auto-deploy on push.

The Compose stack does not run Prisma migrations automatically; applying the schema is a manual step against a confirmed DATABASE_URL.

Known Drift

  • The web app (src/lib zod usage) and the worker (worker/src/zod/schema.ts) maintain independent Zod schemas rather than a shared package.
  • Database schema migration is a manual deployment step (see Deployment).
  • Visual identity still references the old brand pending user input: public/logo.png, public/og-image.png, the design tokens/colors, the social handles (instagram.com/use.pdx, x.com/usepdx_, the @usepdx_ Twitter metadata, @pdxstudios on the About page), the Dodo product IDs (pdt_…), and the Google site-verification file (public/google38d960025354decc.html, tied to the old domain).

About

usepdx.tech

Resources

Readme
Activity

Stars

4 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.