Skip to content
Merged
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
17 changes: 17 additions & 0 deletions .claude/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": "0.0.1",
"configurations": [
{
"name": "web",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["--filter", "web", "run", "dev"],
"port": 3000
},
{
"name": "backend",
"runtimeExecutable": "sh",
"runtimeArgs": ["-c", "docker compose -f apps/backend/docker-compose.yml up -d && pnpm --filter plotwist-api run dev"],
"port": 3333
}
]
}
6 changes: 6 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"permissions": {
"allow": [
"Bash(gh pr:*)",
"Bash(gh api:*)",
"Bash(git add:*)",
"Bash(source ~/.zshrc)",
"Bash(npx @biomejs/biome check --changed)",
"Bash(npx @biomejs/biome check src/config.ts src/infra/adapters/open-ai.ts src/domain/services/user-stats/get-user-ai-recommendations.ts src/domain/services/user-stats/get-user-ai-recommendations.spec.ts)",
"Bash(pnpm run:*)"
]
}
Expand Down
24 changes: 13 additions & 11 deletions apps/backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ APP_ENV=dev
# General
PORT=3333
BASE_URL=http://localhost:3333
JWT_SECRET=
JWT_SECRET="banana"
CLIENT_URL=http://localhost:3000
RATE_LIMIT_MAX=100
RATE_LIMIT_TIME_WINDOW_MS=60000
IOS_TOKEN=

# Database
DATABASE_URL="postgresql://postgres:postgres@localhost:5432"
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/plotwist_db"

# Stripe
STRIPE_SECRET_KEY=""
# Webhook signing secret (whsec_...) – use for constructEvent in production
STRIPE_WEBHOOK_SECRET=""
# Stripe
STRIPE_SECRET_KEY=

# TMDB
TMDB_ACCESS_TOKEN=
Expand All @@ -31,6 +31,7 @@ CLOUDFLARE_PUBLIC_URL='https://cloudfront.net'
# SQS
AWS_REGION=sa-east-1
LOCALSTACK_ENDPOINT=http://localhost:4566

AWS_ACCESS_KEY_ID=banana
AWS_SECRET_ACCESS_KEY=banana

Expand All @@ -42,13 +43,14 @@ IMPORT_SERIES_QUEUE=import-series-queue
MAL_CLIENT_ID=banana

# Feature Flags
ENABLE_IMPORT_MOVIES=true
ENABLE_IMPORT_SERIES=true
ENABLE_SQS=true
ENABLE_IMPORT_MOVIES=false
ENABLE_IMPORT_SERIES=false
ENABLE_SQS=false
ENABLE_CRON_JOBS=false

# OpenAI
OPENAI_API_KEY=
RECOMMENDATION_AI_PROVIDER=openAI

# Monitors
ENABLE_MONITORS=true
Expand All @@ -58,5 +60,5 @@ MONITOR_CRON_TIME="*/30 * * * *"
ADMIN_EMAILS=admin@plotwist.app

# Telemetry
OTEL_EXPORTER_OTLP_ENDPOINT=localhost
OTEL_EXPORTER_OTLP_HEADERS=
OTEL_EXPORTER_OTLP_ENDPOINT="localhost"
OTEL_EXPORTER_OTLP_HEADERS=""
5 changes: 3 additions & 2 deletions apps/backend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const config = {
sqsQueues: loadSQSQueues(),
featureFlags: loadFeatureFlags(),
myAnimeList: loadMALEnvs(),
openai: loadOpenAIEnvs(),
intelligence: loadAIEnvs(),
google: loadGoogleEnvs(),
monitors: loadMonitorsEnvs(),
telemetry: loadTelemetryEnvs(),
Expand Down Expand Up @@ -115,9 +115,10 @@ function loadMALEnvs() {
return schema.parse(process.env)
}

function loadOpenAIEnvs() {
function loadAIEnvs() {
const schema = z.object({
OPENAI_API_KEY: z.string(),
RECOMMENDATION_AI_PROVIDER: z.enum(['openAI', 'llama']).default('openAI'),
})

return schema.parse(process.env)
Expand Down
Loading
Loading