Skip to content

Commit 4c2d031

Browse files
feat(config): add comprehensive configuration management for FastKit
- Introduced `config.demo.ts` for demo environment variables. - Created `config.env.create.ts` to generate `.env` files with demo content. - Added `config.types.ts` for TypeScript type definitions related to configuration. - Implemented `config.validation.ts` for Zod validation schemas for configuration types. - Defined database configuration types in `db/Db.type.ts`. - Added environment variable management in `env.manager.ts`. - Established constants for environment variables in `constant/env.constant.ts`. - Defined environment types in `type/env.types.ts`.
1 parent c9feadc commit 4c2d031

19 files changed

Lines changed: 6948 additions & 144 deletions

.env.example

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# ===============================================================
2+
# FastKit Environment Configuration
3+
# This file contains sample environment variables for FastKit
4+
# Copy this file to .env and modify the values as needed
5+
# ===============================================================
6+
7+
# Server Configuration
8+
PORT=3000
9+
HOST=localhost
10+
NODE_ENV=development
11+
ENVIRONMENT=development
12+
# SERVER_TIMEOUT=30000
13+
# SERVER_KEEP_ALIVE=true
14+
# SERVER_BODY_LIMIT=100mb
15+
# SERVER_TRUST_PROXY=false
16+
17+
# Database Configuration
18+
DATABASE_TYPE=mongodb
19+
DATABASE_URL=mongodb://localhost:27017/fastkit
20+
# DATABASE_HOST=localhost
21+
# DATABASE_PORT=27017
22+
# DATABASE_USERNAME=your_username
23+
# DATABASE_PASSWORD=your_password
24+
# DATABASE_NAME=fastkit
25+
# DATABASE_POOL_SIZE=10
26+
# DATABASE_CONNECTION_TIMEOUT=30000
27+
# DATABASE_SSL=false
28+
29+
# JWT Configuration (Required)
30+
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production-minimum-32-chars
31+
JWT_EXPIRES_IN=24h
32+
JWT_ALGORITHM=HS256
33+
# JWT_REFRESH_SECRET=your-refresh-secret-minimum-32-chars
34+
# JWT_REFRESH_EXPIRES_IN=7d
35+
# JWT_ISSUER=your-app
36+
# JWT_AUDIENCE=your-users
37+
# JWT_SUBJECT=auth
38+
39+
# CORS Configuration (Optional)
40+
# CORS_ORIGIN=http://localhost:3000,https://yourdomain.com
41+
# CORS_METHODS=GET,POST,PUT,DELETE,PATCH
42+
# CORS_ALLOWED_HEADERS=Content-Type,Authorization
43+
# CORS_CREDENTIALS=true
44+
# CORS_MAX_AGE=86400
45+
46+
# Security Configuration (Optional)
47+
# RATE_LIMIT_WINDOW_MS=900000
48+
# RATE_LIMIT_MAX=100
49+
# SECURITY_HELMET=true
50+
# SECURITY_COMPRESSION=true
51+
# SECURITY_MORGAN=true
52+
# SECURITY_CSRF=false
53+
54+
# Email Configuration (Optional)
55+
# EMAIL_SERVICE=gmail
56+
# EMAIL_HOST=smtp.gmail.com
57+
# EMAIL_PORT=587
58+
# EMAIL_SECURE=false
59+
# EMAIL_USERNAME=your-email@gmail.com
60+
# EMAIL_PASSWORD=your-app-password
61+
# EMAIL_FROM=noreply@yourapp.com
62+
63+
# Storage Configuration (Optional)
64+
# STORAGE_PROVIDER=local
65+
# STORAGE_BUCKET=your-bucket
66+
# STORAGE_REGION=us-east-1
67+
# STORAGE_ACCESS_KEY_ID=your-access-key
68+
# STORAGE_SECRET_ACCESS_KEY=your-secret-key
69+
# STORAGE_CDN_URL=https://cdn.yourapp.com
70+
71+
# Cache Configuration (Optional)
72+
# CACHE_PROVIDER=memory
73+
# CACHE_HOST=localhost
74+
# CACHE_PORT=6379
75+
# CACHE_PASSWORD=your-redis-password
76+
# CACHE_TTL=3600
77+
# CACHE_PREFIX=fastkit:
78+
79+
# Logging Configuration (Optional)
80+
# LOG_LEVEL=info
81+
# LOG_FORMAT=json
82+
# LOG_FILE_PATH=./logs/app.log
83+
# LOG_MAX_FILE_SIZE=10m
84+
# LOG_MAX_FILES=5
85+
86+
# API Configuration (Optional)
87+
# API_VERSION=1.0.0
88+
# API_PREFIX=/api/v1
89+
# API_DOCS_URL=https://docs.yourapp.com
90+
# API_TIMEOUT=30000
91+
92+
# Monitoring Configuration (Optional)
93+
# HEALTH_CHECK=true
94+
# HEALTH_CHECK_PATH=/health
95+
# METRICS=true
96+
# METRICS_PATH=/metrics
97+
# APM_ENABLED=false
98+
# APM_SERVICE_NAME=fastkit-app
99+
# APM_SERVER_URL=https://apm.yourapp.com
100+
# APM_API_KEY=your-apm-key
101+
102+
# Custom Configuration (Optional)
103+
# APP_NAME=FastKit App
104+
# APP_VERSION=1.0.0
105+
# CUSTOM_DEBUG=true

0 commit comments

Comments
 (0)