Skip to content

#529 Update env.example#548

Open
ytsubhadip wants to merge 1 commit into
nem-web:mainfrom
ytsubhadip:ytsubhadip/529-
Open

#529 Update env.example#548
ytsubhadip wants to merge 1 commit into
nem-web:mainfrom
ytsubhadip:ytsubhadip/529-

Conversation

@ytsubhadip
Copy link
Copy Markdown

@ytsubhadip ytsubhadip commented Mar 20, 2026

🔥 Pull Request Summary

Fixes missing environment variables in env.example that are documented in README.md but not included in the setup file. This prevents runtime failures (e.g., Cloudinary upload errors) for new contributors.

Use keywords like Fixes so GitHub auto-closes the issue.

Closes #


📦 Type of Change

Select all that apply:

  • 🐛 Bug fix (non-breaking fix)
  • ✨ New feature (non-breaking feature)
  • 💥 Breaking change
  • 🎨 UI/UX improvement
  • ♻️ Code refactor (no functional change)
  • ⚡ Performance improvement
  • 🧪 Tests added or updated
  • 📝 Documentation update

🧪 How to Test

Steps for reviewers to verify the changes:

  1. Copy env.example to .env
  2. Fill in all environment variables (including newly added ones)
  3. Start the application
  4. Attempt to upload an image
  5. Confirm that the upload works without errors

🎯 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:

  • Code follows project standards
  • Linting and formatting checks pass
  • Changes tested locally
  • No unintended breaking changes
  • Documentation updated (if needed)
  • Tests added/updated (if applicable)
  • Self-review completed

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 20, 2026

@ytsubhadip is attempting to deploy a commit to the nem-web Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 20, 2026

📝 Walkthrough

Walkthrough

The env.example file is updated to add MongoDB database configuration, SMTP email variables for notifications, separate backend API URL configuration, JWT expiration settings, and ML service host configuration, while reorganizing variable sections.

Changes

Cohort / File(s) Summary
Environment Configuration
env.example
Added MONGO_DB, SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, BACKEND_API_URL, JWT_EXPIRES_MINUTES, and ML_SERVICE_HOST variables. Relocated FRONTEND_BASE_URL to Frontend section. Adjusted section organization and blank-line separators.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Variables multiply like rabbits in spring,
New configs for email and database sing,
JWT timers and backend URLs appear,
The example grows wise, crystal clear!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Update env.example' is directly related to the changeset, which updates the env.example file by adding 8 new configuration variables and reorganizing existing ones.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description follows the template structure and provides context for the changes, though the Linked Issue section is incomplete.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can suggest fixes for GitHub Check annotations.

Configure the reviews.tools.github-checks setting to adjust the time to wait for GitHub Checks to complete.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
env.example (1)

19-21: BACKEND_API_URL is 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.example to 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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 44458b9e-e343-420b-8e49-17f1995119a3

📥 Commits

Reviewing files that changed from the base of the PR and between a2f19d8 and a8fc9da.

📒 Files selected for processing (1)
  • env.example

Comment thread env.example
@@ -1,37 +1,45 @@
# Database
MONGO_URI=mongodb://mongo:27017/smart-attendance
MONGO_DB=smart_attendance
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Suggested change
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.

Comment thread env.example
Comment on lines +8 to +12
# Email Configuration (for notifications)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-specific-password
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Suggested change
# 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant