plplpl183 commited on
Commit
dae482b
·
verified ·
1 Parent(s): 609ba3d

Upload apps/api/src/config/index.ts

Browse files
Files changed (1) hide show
  1. apps/api/src/config/index.ts +29 -0
apps/api/src/config/index.ts ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { z } from 'zod';
2
+
3
+ const envSchema = z.object({
4
+ NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
5
+ PORT: z.string().default('4000'),
6
+ DATABASE_URL: z.string(),
7
+ REDIS_URL: z.string().default('redis://localhost:6379'),
8
+ JWT_SECRET: z.string().min(32),
9
+ JWT_REFRESH_SECRET: z.string().min(32),
10
+ JWT_ACCESS_EXPIRY: z.string().default('15m'),
11
+ JWT_REFRESH_EXPIRY: z.string().default('7d'),
12
+ AI_SERVICE_URL: z.string().default('http://localhost:8000'),
13
+ AI_SERVICE_KEY: z.string().default('internal-dev-key'),
14
+ AWS_REGION: z.string().default('us-east-1'),
15
+ S3_BUCKET_NAME: z.string().default('hr-resumes'),
16
+ S3_ENDPOINT: z.string().optional(),
17
+ OPENAI_API_KEY: z.string().optional(),
18
+ GOOGLE_CLIENT_ID: z.string().optional(),
19
+ GOOGLE_CLIENT_SECRET: z.string().optional(),
20
+ });
21
+
22
+ const parsed = envSchema.safeParse(process.env);
23
+
24
+ if (!parsed.success) {
25
+ console.error('Invalid environment variables:', parsed.error.format());
26
+ process.exit(1);
27
+ }
28
+
29
+ export const config = parsed.data;