Skip to content

A backend service built with Node.js and Express to power the portfolio website, handling form submissions, managing portfolio data, and integrating with an email service.

Notifications You must be signed in to change notification settings

eritech98/Portfolio-Backend-Service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¬ Node.js Email Backend Service

A simple backend service built with Express and Nodemailer to send emails. Designed to be lightweight, environment-configurable, and easily deployable (e.g., on Railway).


πŸš€ Features

  • Built with Node.js and Express
  • Handles CORS and JSON requests
  • Sends emails using Gmail SMTP via Nodemailer
  • .env support for secure config

πŸ“ Project Structure

backend/
β”œβ”€β”€ index.js           # Main server file
β”œβ”€β”€ .env               # Environment variables (not committed)
β”œβ”€β”€ package.json       # NPM scripts and dependencies
└── README.md          # You're reading this

βš™οΈ Environment Variables

Create a .env file in the root directory:

EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_email_app_password
PORT=3000

⚠️ Do not commit this file! Add .env to your .gitignore.


πŸ’» Installation & Running Locally

  1. Clone the repository:
git clone https://github.com/your-username/your-repo-name.git
cd backend
  1. Install dependencies:
npm install
  1. Start the server:
npm start

Or use npm run dev if you're developing with live reload.


πŸ“« Sending an Email

Make a POST request to:

POST http://localhost:3000/send

Request body (JSON):

{
  "to": "recipient@example.com",
  "subject": "Test Email",
  "text": "Hello from Erick's email backend!"
}

🧾 Scripts

Command Description
npm start Start the server
npm run dev Run with nodemon (live reload)
npm run test Placeholder test script

This a sample of what to expect when the route is hit.Please note it uses gmail smtp service.

πŸ‘€ Author

Made with ❀️ by Erick Olando


About

A backend service built with Node.js and Express to power the portfolio website, handling form submissions, managing portfolio data, and integrating with an email service.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published