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
61 changes: 42 additions & 19 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,19 +1,42 @@
# Script AI App Environment Variables
# Copy this file to .env and fill in your actual values

# Database Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
NEXT_PUBLIC_SUPABASE_SERVICE_KEY=your_supabase_service_key

# API Keys
GOOGLE_GENERATIVE_AI_API_KEY=your_google_generative_ai_api_key
LINGO_API_KEY=your_lingo_api_key
ELEVENLABS_API_KEY=your_elevenlabs_api_key
RESEND_API_KEY=your_resend_api_key
YOUTUBE_API_KEY=your_youtube_api_key
NEXT_PUBLIC_BASE_URL=your_base_url

# Google OAuth Credentials
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_CLIENT_ID=your_google_client_id
# ===========================================
# Root Environment Variables
# All apps inherit from this file
# ===========================================

# Supabase
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_SERVICE_KEY=your-supabase-service-role-key
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key

# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=

# AI Services
GOOGLE_GENERATIVE_AI_API_KEY=your-google-ai-api-key
OPENAI_API_KEY=your-openai-api-key
ELEVENLABS_API_KEY=your-elevenlabs-api-key
MURF_API_KEY=your-murf-api-key

# Google OAuth
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

# YouTube
YOUTUBE_API_KEY=your-youtube-api-key

# Email
RESEND_API_KEY=your-resend-api-key

# URLs
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
NEXT_PUBLIC_BASE_URL=http://localhost:3000
FRONTEND_DEV_URL=http://localhost:3000
FRONTEND_PROD_URL=https://tryscriptai.com

# Server
NODE_ENV=development
PORT=8000
24 changes: 17 additions & 7 deletions apps/api/.env.example
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# Application Configuration
# Server
NODE_ENV=development
PORT=8000

# Redis Configuration
# CORS
FRONTEND_DEV_URL=http://localhost:3000
FRONTEND_PROD_URL=https://your-production-domain.com

# Supabase
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_KEY=your-supabase-service-role-key

# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=your_strong_password_here
REDIS_PASSWORD=

# Supabase Configuration
SUPABASE_URL=your_supabase_url
SUPABASE_SERVICE_KEY=your_supabase_service_key_here
# AI Services
GOOGLE_GENERATIVE_AI_API_KEY=your-google-ai-api-key
MURF_API_KEY=your-murf-api-key

RESEND_API_KEY=your_resend_api_key
# Email
RESEND_API_KEY=your-resend-api-key
9 changes: 8 additions & 1 deletion apps/api/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { BullModule } from '@nestjs/bullmq';
import * as path from 'path';
import redisConfig from './config/redis.config';
import { SupabaseModule } from './supabase/supabase.module';

Expand All @@ -16,7 +17,13 @@ import { DubbingModule } from './dubbing/dubbing.module';
imports: [
ConfigModule.forRoot({
isGlobal: true,
load: [redisConfig]
load: [redisConfig],
envFilePath: [
'.env',
'.env.local',
path.resolve(process.cwd(), '../../.env'),
path.resolve(process.cwd(), '../../.env.local'),
],
}),
BullModule.forRootAsync({
imports: [ConfigModule],
Expand Down
12 changes: 7 additions & 5 deletions apps/api/src/subtitle/subtitle.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ import { Controller, Get, Post, Body, Patch, Param, Delete, Req, Res, UseGuards,
import { FileInterceptor } from '@nestjs/platform-express';
import { SubtitleService } from './subtitle.service';
import { SupabaseAuthGuard } from '../guards/auth.guard';
import { Request, Response } from 'express';
import type { Request, Response } from 'express';
import { ZodValidationPipe } from '../common/pipes/zod-validation.pipe';
import {
CreateSubtitleSchema,
UpdateSubtitleSchema,
UploadVideoSchema,
BurnSubtitleSchema,
type CreateSubtitleInput,
type UpdateSubtitleInput,
type UploadVideoInput,
type BurnSubtitleInput,
} from '@repo/validation';
import type {
CreateSubtitleInput,
UpdateSubtitleInput,
UploadVideoInput,
BurnSubtitleInput,
} from '@repo/validation';

interface AuthRequest extends Request {
Expand Down
4 changes: 3 additions & 1 deletion apps/api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"extends": "@repo/typescript-config/nestjs.json",
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist"
"outDir": "./dist",
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}
30 changes: 14 additions & 16 deletions apps/web/.env.example
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# Script AI Web App Environment Variables
# Copy this file to .env and fill in your actual values
# Supabase (public)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key

# Database Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
NEXT_PUBLIC_SUPABASE_SERVICE_KEY=your_supabase_service_key
# Backend API
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
NEXT_PUBLIC_BASE_URL=http://localhost:3000

# API Keys
GOOGLE_GENERATIVE_AI_API_KEY=your_google_generative_ai_api_key
LINGO_API_KEY=your_lingo_api_key
ELEVENLABS_API_KEY=your_elevenlabs_api_key
RESEND_API_KEY=your_resend_api_key
YOUTUBE_API_KEY=your_youtube_api_key
NEXT_PUBLIC_BASE_URL=your_base_url
# AI Services
OPENAI_API_KEY=your-openai-api-key
GOOGLE_GENERATIVE_AI_API_KEY=your-google-ai-api-key

# Google OAuth Credentials
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_CLIENT_ID=your_google_client_id
# YouTube
YOUTUBE_API_KEY=your-youtube-api-key

# Email
RESEND_API_KEY=your-resend-api-key
17 changes: 17 additions & 0 deletions packages/train-ai-worker/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Supabase
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_SERVICE_KEY=your-supabase-service-role-key

# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=

# AI Services
GOOGLE_GENERATIVE_AI_API_KEY=your-google-ai-api-key
ELEVENLABS_API_KEY=your-elevenlabs-api-key

# Google OAuth (for YouTube)
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
8 changes: 7 additions & 1 deletion packages/train-ai-worker/src/worker.module.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import { Module } from '@nestjs/common';
import { BullModule } from '@nestjs/bullmq';
import { ConfigModule } from '@nestjs/config';
import * as path from 'path';
import { TrainAiProcessor } from './processor/train-ai.processor';

@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
envFilePath: ['.env.local', '.env'],
envFilePath: [
'.env',
'.env.local',
path.resolve(process.cwd(), '../../.env'),
path.resolve(process.cwd(), '../../.env.local'),
],
}),
BullModule.forRoot({
connection: {
Expand Down
37 changes: 36 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
"globalDependencies": [
"**/.env.*local"
],
"globalDotEnv": [".env"],
"globalEnv": [
"NODE_ENV",
"SUPABASE_URL",
"SUPABASE_ANON_KEY",
"SUPABASE_SERVICE_KEY",
"GOOGLE_GENERATIVE_AI_API_KEY",
"RESEND_API_KEY",
"REDIS_HOST",
"REDIS_PORT",
"REDIS_PASSWORD"
],
"tasks": {
"dev": {
"cache": false,
Expand All @@ -19,7 +31,30 @@
".tsup/**"
],
"cache": true,
"env": ["NODE_ENV"]
"env": [
"NODE_ENV",
"PORT",
"FRONTEND_DEV_URL",
"FRONTEND_PROD_URL",
"NEXT_PUBLIC_SUPABASE_URL",
"NEXT_PUBLIC_SUPABASE_ANON_KEY",
"NEXT_PUBLIC_BACKEND_URL",
"NEXT_PUBLIC_BASE_URL",
"OPENAI_API_KEY",
"GOOGLE_GENERATIVE_AI_API_KEY",
"YOUTUBE_API_KEY",
"RESEND_API_KEY",
"MURF_API_KEY",
"ELEVENLABS_API_KEY",
"GOOGLE_CLIENT_ID",
"GOOGLE_CLIENT_SECRET",
"SUPABASE_URL",
"SUPABASE_ANON_KEY",
"SUPABASE_SERVICE_KEY",
"REDIS_HOST",
"REDIS_PORT",
"REDIS_PASSWORD"
]
},
"db:pull": {
"dependsOn": ["^build"],
Expand Down
Loading