Step 1 of 6
Configure Email Service Credentials
Provide the app with real SendGrid (or chosen provider) credentials and install the SDK.
The app uses Node.js with npm, has a .env file, and a config module. Use the existing config pattern.
1. Open the project's .env file and add two new lines: SENDGRID_API_KEY=your_real_sendgrid_key and FROM_EMAIL=verified_sender@example.com. 2. Run npm install @sendgrid/mail and verify it appears in package.json. 3. In the config directory (e.g., src/config/index.js), import process.env and export an object containing sendgridKey and fromEmail. 4. Ensure the config file is required wherever environment variables are used. 5. Do NOT add placeholder strings; the key must be a non‑empty string and the email must match a verified SendGrid sender. Provide a diff for each changed file and a short explanation of the changes.
Expected after this step
.env updated with two lines, package.json includes @sendgrid/mail, and src/config/index.js exports the correct keys.
Should not happen
- ✕AI inserts placeholder keys like "YOUR_API_KEY" instead of a non‑empty value.
- ✕Using a mock mailer library or a fake send function instead of @sendgrid/mail.
- ✕Skipping database migration or inserting dummy rows rather than creating an empty table.
- ✕Returning hard‑coded message IDs or success flags without calling the real service.
Verify before continuing
Do not move on until every check is true. The complete button stays locked until then.
Do not continue if…
- !AI inserts placeholder keys like "YOUR_API_KEY" instead of a non‑empty value.
- !Using a mock mailer library or a fake send function instead of @sendgrid/mail.
- !Skipping database migration or inserting dummy rows rather than creating an empty table.
- !Returning hard‑coded message IDs or success flags without calling the real service.
- !Providing UI mockups or suggesting a front‑end form instead of actual backend logic.
- !Omitting error handling or input validation, leading to silent failures.
If the AI messes this up
Use this when the AI fakes progress or breaks the feature. It forces a real fix.
The AI omitted the .env entries or installed a placeholder library. Edit .env to include SENDGRID_API_KEY and FROM_EMAIL, run `npm install @sendgrid/mail`, and modify src/config/index.js to export the values from process.env.