#529 Update env.example#548
Conversation
|
@ytsubhadip is attempting to deploy a commit to the nem-web Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can suggest fixes for GitHub Check annotations.Configure the |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
env.example (1)
19-21:BACKEND_API_URLis currently a no-op in ML service.This variable is defined in ML settings but (per provided snippet context) not used in runtime paths. Either wire it into actual calls or remove it from
env.exampleto avoid false expectations.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@env.example` around lines 19 - 21, The BACKEND_API_URL env var in env.example is declared but unused in the ML service; either remove it from env.example or wire it into the ML runtime by reading process.env.BACKEND_API_URL where the ML service constructs backend calls (e.g., in the ML client/initializer function like MLServiceClient, fetchBackendStatus, or any place that currently uses a hardcoded "http://localhost:8000" URL). If you choose to wire it, add a config loader that sets backendApiUrl = process.env.BACKEND_API_URL || default, and replace hardcoded URLs with backendApiUrl; otherwise delete BACKEND_API_URL from env.example to avoid misleading docs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@env.example`:
- Line 3: Replace the incorrect environment key MONGO_DB with the name the
backend actually reads (MONGO_DB_NAME) in the env.example file so the example
matches runtime configuration; update the variable on line containing
"MONGO_DB=smart_attendance" to "MONGO_DB_NAME=smart_attendance" ensuring any
documentation or references use MONGO_DB_NAME to match the application's DB
selection logic.
- Around line 8-12: The SMTP_* entries in env.example (SMTP_HOST, SMTP_PORT,
SMTP_USER, SMTP_PASS) are obsolete and should be removed; update env.example to
reflect the current Brevo-based email config by replacing that block with the
Brevo-related variables used by the backend (e.g., BREVO_API_KEY and the
project’s sender variable such as EMAIL_FROM or BREVO_SENDER), add brief inline
comments explaining each new variable, and ensure the variable names match the
ones referenced in the code (search for BREVO_API_KEY, EMAIL_FROM, or the email
send helper to confirm exact names).
---
Nitpick comments:
In `@env.example`:
- Around line 19-21: The BACKEND_API_URL env var in env.example is declared but
unused in the ML service; either remove it from env.example or wire it into the
ML runtime by reading process.env.BACKEND_API_URL where the ML service
constructs backend calls (e.g., in the ML client/initializer function like
MLServiceClient, fetchBackendStatus, or any place that currently uses a
hardcoded "http://localhost:8000" URL). If you choose to wire it, add a config
loader that sets backendApiUrl = process.env.BACKEND_API_URL || default, and
replace hardcoded URLs with backendApiUrl; otherwise delete BACKEND_API_URL from
env.example to avoid misleading docs.
| @@ -1,37 +1,45 @@ | |||
| # Database | |||
| MONGO_URI=mongodb://mongo:27017/smart-attendance | |||
| MONGO_DB=smart_attendance | |||
There was a problem hiding this comment.
Use the env key the backend actually reads (MONGO_DB_NAME).
Line 3 defines MONGO_DB, but backend DB selection reads MONGO_DB_NAME; this new key will be ignored.
Suggested fix
-MONGO_DB=smart_attendance
+MONGO_DB_NAME=smart-attendance📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| MONGO_DB=smart_attendance | |
| MONGO_DB_NAME=smart-attendance |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@env.example` at line 3, Replace the incorrect environment key MONGO_DB with
the name the backend actually reads (MONGO_DB_NAME) in the env.example file so
the example matches runtime configuration; update the variable on line
containing "MONGO_DB=smart_attendance" to "MONGO_DB_NAME=smart_attendance"
ensuring any documentation or references use MONGO_DB_NAME to match the
application's DB selection logic.
| # Email Configuration (for notifications) | ||
| SMTP_HOST=smtp.gmail.com | ||
| SMTP_PORT=587 | ||
| SMTP_USER=your-email@gmail.com | ||
| SMTP_PASS=your-app-specific-password |
There was a problem hiding this comment.
SMTP_* variables are stale for current email implementation.
Backend config no longer consumes SMTP_HOST/PORT/USER/PASS; it uses Brevo keys. Keeping this block in env.example is misleading and can cause failed notification setup.
Suggested fix
-# Email Configuration (for notifications)
-SMTP_HOST=smtp.gmail.com
-SMTP_PORT=587
-SMTP_USER=your-email@gmail.com
-SMTP_PASS=your-app-specific-password
+# Email Configuration (Brevo)
+# Use BREVO_API_KEY, BREVO_SENDER_EMAIL, BREVO_SENDER_NAME below📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Email Configuration (for notifications) | |
| SMTP_HOST=smtp.gmail.com | |
| SMTP_PORT=587 | |
| SMTP_USER=your-email@gmail.com | |
| SMTP_PASS=your-app-specific-password | |
| # Email Configuration (Brevo) | |
| # Use BREVO_API_KEY, BREVO_SENDER_EMAIL, BREVO_SENDER_NAME below |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@env.example` around lines 8 - 12, The SMTP_* entries in env.example
(SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS) are obsolete and should be removed;
update env.example to reflect the current Brevo-based email config by replacing
that block with the Brevo-related variables used by the backend (e.g.,
BREVO_API_KEY and the project’s sender variable such as EMAIL_FROM or
BREVO_SENDER), add brief inline comments explaining each new variable, and
ensure the variable names match the ones referenced in the code (search for
BREVO_API_KEY, EMAIL_FROM, or the email send helper to confirm exact names).
🔥 Pull Request Summary
Fixes missing environment variables in
env.examplethat are documented inREADME.mdbut not included in the setup file. This prevents runtime failures (e.g., Cloudinary upload errors) for new contributors.Closes #
📦 Type of Change
Select all that apply:
🧪 How to Test
Steps for reviewers to verify the changes:
env.exampleto.env🎯 Expected Behaviour
The application should run successfully with all required environment variables defined in
env.example. Features like image upload should work without runtime errors caused by missing variables.✔ Pre-Merge Checklist
Please confirm the following: