This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
CodeniWork is a job application tracker built with Next.js 16 (App Router) and React 19, using NeonDB (serverless PostgreSQL) via Drizzle ORM, and NextAuth.js v5 (beta) for authentication. It features credential-based login, passkey/WebAuthn support, and a Clean My Mac-inspired glass-morphism UI.
pnpm dev # Start dev server (localhost:3000)
pnpm build # Production build
pnpm lint # ESLint (flat config)
pnpm db:generate # Generate Drizzle migrations from schema
pnpm db:push # Push schema directly to NeonDB
pnpm db:studio # Open Drizzle Studio (DB browser)
pnpm db:seed # Seed database with sample data
pnpm db:clear # Clear all database tables
pnpm db:reset # Clear + reseed database
pnpm auto-reject # Run auto-rejection script (CLI)
pnpm semantic-release # Run semantic-release (CI only, use --dry-run locally)There is no test suite configured.
- NextAuth.js v5 configured in
lib/auth.ts— exportshandlers,auth,signIn,signOut - Uses JWT strategy with credentials provider (email/password via bcrypt)
- Passkey/WebAuthn support implemented manually in
lib/passkey-auth.ts(simplified verification, not using @simplewebauthn/server) - Auth route handler at
app/api/auth/[...nextauth]/route.tsre-exports handlers fromlib/auth.ts proxy.ts(Next.js 16 proxy) checks for session cookies and protects all routes except/,/auth/signin,/auth/signup; redirects authenticated users away from auth pages to/dashboard- Client-side auth via
<AuthProvider>(SessionProvider wrapper) in root layout
- NeonDB (serverless PostgreSQL) connected via
@neondatabase/serverlessHTTP driver - Drizzle ORM with schema in
lib/db/schema.ts, connection inlib/db/index.ts drizzle.config.tspoints tolib/db/schema.tswith output to./drizzle/- Key tables:
users,companies,job_applications(with status enum: applied/screening/interview/offer/rejected/withdrawn),application_events,documents,passkey_credentials, plus NextAuth tables (sessions,accounts,verification_tokens) - Query functions centralized in
lib/db/queries.ts(dashboard stats, applications list, activity feed, auto-rejection logic)
dashboard/applications/— CRUD for job applications;auto-reject/endpoint runs as a Vercel cron (daily at 9 AM, configured invercel.json)dashboard/companies/,dashboard/documents/,dashboard/stats/,dashboard/analytics/,dashboard/activity/— domain-specific endpointsauth/signin/,auth/signup/— credential auth endpointsauth/passkey/— WebAuthn registration and authentication flowsauth/master-password/— master password setup/verify for encryption featuresupload/— Cloudinary-based file uploads (images, documents, company logos)- All protected endpoints use
const session = await auth()and checksession?.user?.id
- @codenificient/analytics-sdk integrated via
lib/analytics.ts(AppAnalytics wrapper class) - Types in
types/analytics.ts; API proxy atapp/api/analytics/track/route.ts <AnalyticsProvider>in root layout auto-tracks page views on route changes- Track auth events via
getAnalytics()?.authAction(...)and custom events viagetAnalytics()?.custom(...) - Enabled in production by default; set
NEXT_PUBLIC_ANALYTICS_ENABLED=truefor dev
- semantic-release automates versioning and changelog via conventional commits
- Config in
.releaserc.json; commit lint rules in.commitlintrc.json - GitHub Actions workflow in
.github/workflows/release.ymltriggers on push tomasterorbeta - Commit types:
feat(minor),fix/perf/refactor(patch),BREAKING CHANGE(major),docs/chore/style/test(no release)
- Root layout (
app/layout.tsx): Inter font, AuthProvider, AnalyticsProvider, Toaster - Dashboard layout (
app/dashboard/layout.tsx): Sidebar + main content area with purple gradient background - Dashboard pages: main dashboard, applications, companies, calendar, contacts, documents, analytics, quick-actions
- Auth pages:
app/auth/signin/,app/auth/signup/ - Profile page:
app/profile/ - UI components in
components/ui/are shadcn/ui based (usecn()fromlib/utils.tsfor class merging) - Dashboard components in
components/dashboard/(dialogs, lists, stats, header)
@/* maps to project root (configured in tsconfig.json). All imports use this alias.
Required: DATABASE_URL, NEXTAUTH_URL, NEXTAUTH_SECRET, GITHUB_ID, GITHUB_SECRET, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET. Optional: CLOUDINARY_CLOUD_NAME, CLOUDINARY_API_KEY, CLOUDINARY_API_SECRET, NEXT_PUBLIC_ANALYTICS_ENABLED, NEXT_PUBLIC_ANALYTICS_API_KEY, NEXT_PUBLIC_ANALYTICS_ENDPOINT. See env.example.
- Spaces inside parentheses and around operators (e.g.,
fn( arg ),a=b) - No semicolons in some files, inconsistent across codebase
- Package manager is pnpm