Repository navigation
reference configuration
The application uses a layered configuration system with environment variables validated by @t3-oss/env-nextjs and organized into domain-specific config modules.
All environment variables are validated at startup in env.ts. Required variables:
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string (pooled) | -- |
DATABASE_URL_UNPOOLED |
Direct PostgreSQL URL | -- |
AUTH_SECRET |
NextAuth.js session secret | -- |
AUTH_GOOGLE_ID |
Google OAuth client ID | -- |
AUTH_GOOGLE_SECRET |
Google OAuth client secret | -- |
QDRANT_URL |
Qdrant server URL | -- |
QDRANT_API_KEY |
Qdrant API key (required for HTTPS) | -- |
INFINITY_EMBEDDING_URL |
Infinity embedding server URL | -- |
INFINITY_EMBEDDING_MODEL |
Embedding model name | sentence-transformers/all-MiniLM-L6-v2 |
INFINITY_EMBEDDING_DIMENSIONS |
Embedding dimensions | 384 |
OPENAI_API_KEY |
OpenAI API key | -- |
GEMINI_API_KEY |
Google Gemini API key | -- |
S3_BUCKET |
AWS S3 bucket name | -- |
S3_REGION |
AWS S3 region | -- |
S3_ACCESS_KEY |
AWS S3 access key | -- |
S3_SECRET_ACCESS_KEY |
AWS S3 secret key | -- |
FIRECRAWL_API_KEY |
Firecrawl web scraping API key | -- |
RESEND_API_KEY |
Resend email API key | -- |
SCREENSHOTONE_ACCESS_KEY |
ScreenshotOne API key | -- |
RAG_ENABLED |
Enable/disable RAG features | true |
USE_LOCAL_EMBEDDING |
Use Infinity vs cloud embeddings | true |
Public variables (prefixed NEXT_PUBLIC_):
| Variable | Description | Default |
|---|---|---|
NEXT_PUBLIC_SITE_URL |
Public site URL | http://localhost:5175 |
NEXT_PUBLIC_SITE_EMAIL |
Contact email | hello@example.com |
Configuration is split into domain-specific modules in config/:
| Module | File | Purpose |
|---|---|---|
| Site | config/site.ts |
Site name, tagline, description, keywords |
| Media | config/media.ts |
Image size limits, allowed formats |
| Links | config/links.ts |
External link configuration |
| Search | config/search.ts |
Search profiles (default, admin, public, recommendation) |
| Data table | config/data-table.ts |
Admin table pagination and column config |
| Ads | config/ads.ts |
Advertisement display settings |
The aggregated config is exported from config/index.ts for client-safe access, and config/index.server.ts for server-only config that includes secrets.
The following services currently use the original developer's personal API keys. When transferring ownership or setting up a new environment, create your own accounts and replace these keys:
| Service | Env Var(s) | Where to Get |
|---|---|---|
| Firecrawl | FIRECRAWL_API_KEY |
https://www.firecrawl.dev |
| Google Gemini | GEMINI_API_KEY |
https://aistudio.google.com/apikey |
| AWS S3 |
S3_ACCESS_KEY, S3_SECRET_ACCESS_KEY
|
https://console.aws.amazon.com/iam |
| ScreenshotOne | SCREENSHOTONE_ACCESS_KEY |
https://screenshotone.com |
These keys are stored in /srv/stukit/shared/.env.production on the VPS.
config/search.ts defines four search profiles with different parameters:
| Profile | Limit | efSearch | Score Threshold | Cache TTL |
|---|---|---|---|---|
default |
10 | 64 | 0.0 | 3 days |
admin |
50 | 64 | 0.0 | 1 day |
public |
10 | 64 | 0.0 | 3 days |
recommendation |
20 | 0.3 | 0.3 | 1 day |
All profiles include a circuit breaker (5 failures, 30s half-open, 3 successes to close) and 10s timeout. In production, efSearch is multiplied by 1.5 for better accuracy.