-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
90 lines (76 loc) · 3.93 KB
/
.env.example
File metadata and controls
90 lines (76 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# ============================================================================
# FLASK CONFIGURATION
# ============================================================================
# PURPOSE: Set the application execution mode.
# WHY: 'development' enables detailed error pages and auto-reloading.
# IMPACT: Controls the internal Flask behavior.
FLASK_ENV=development
# PURPOSE: Toggle debug mode.
# WHY: True enables the interactive debugger in the browser on crash.
# IMPACT: Essential for development, MUST BE FALSE in production for security.
FLASK_DEBUG=True
# PURPOSE: Main security salt for Flask sessions.
# WHY: Used to sign cookies and prevent session tampering.
# IMPACT: System-wide security.
SECRET_KEY=your-secret-key-here-change-in-production
# ============================================================================
# SERVER CONFIGURATION
# ============================================================================
# PURPOSE: Define the network interface the server binds to.
# WHY: '0.0.0.0' makes the server accessible from outside the container or local network.
HOST=0.0.0.0
# PURPOSE: Define the TCP port for the backend.
PORT=5000
# ============================================================================
# DATABASE CONFIGURATION
# ============================================================================
# PURPOSE: Connection string for SQLAlchemy.
# WHY: Tells the app exactly where the user accounts and recipes are stored.
# IMPACT: Persistence layer.
DATABASE_URL=sqlite:///recipe_generator.db
# ============================================================================
# JWT CONFIGURATION
# ============================================================================
# PURPOSE: Secret key specifically for JSON Web Tokens.
# WHY: Protects the integrity of user login sessions.
JWT_SECRET_KEY=your-jwt-secret-key-change-in-production
# PURPOSE: Set the lifespan of a login session.
# WHY: 86400 seconds (24 hours) balance convenience with security.
JWT_ACCESS_TOKEN_EXPIRES=86400
# ============================================================================
# REDIS CONFIGURATION
# ============================================================================
# PURPOSE: URL for the Redis cache server.
# WHY: Used to speed up recipe generation by caching frequent results.
REDIS_URL=redis://localhost:6379/0
# ============================================================================
# RATE LIMITING
# ============================================================================
# PURPOSE: Toggle the API rate limiter.
# WHY: Prevents bots from crashing the server with too many requests.
RATE_LIMIT_ENABLED=True
RATE_LIMIT_PER_MINUTE=10
# ============================================================================
# MODEL CONFIGURATION
# ============================================================================
# PURPOSE: Toggle hardware acceleration.
# WHY: Most cheap/free servers don't have GPUs; False keeps the app compatible.
USE_GPU=False
# PURPOSE: Local path to the AI model weight file.
MODEL_PATH=Foodimg2Ing/data/modelbest.ckpt
# ============================================================================
# FRONTEND URL (FOR CORS)
# ============================================================================
# PURPOSE: Define the allowed origin for web requests.
# WHY: Browsers block scripts from one site (Vite) talking to another (Flask) unless permitted.
# IMPACT: Enables secure frontend-backend communication.
FRONTEND_URL=http://localhost:5173
# ============================================================================
# FILE UPLOAD
# ============================================================================
# PURPOSE: Limit the size of uploaded food images.
# WHY: Prevents users from filling up server disk space with 100MB 4K photos.
# IMPACT: Resource management.
MAX_CONTENT_LENGTH=16777216 # 16MB in bytes
# PURPOSE: Directory where images are stored before processing.
UPLOAD_FOLDER=Foodimg2Ing/static/demo_imgs