https://github.com/eritech98/portfolio-backend-service
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.
https://github.com/eritech98/portfolio-backend-service
express-js gmail-smtp nodejs nodemailer
Last synced: 4 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/eritech98/portfolio-backend-service
- Owner: eritech98
- Created: 2025-04-11T21:50:22.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-06-02T21:59:07.000Z (4 months ago)
- Last Synced: 2025-06-03T12:42:31.643Z (4 months ago)
- Topics: express-js, gmail-smtp, nodejs, nodemailer
- Language: JavaScript
- Homepage:
- Size: 95.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ฌ 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:
```env
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:**
```bash
git clone https://github.com/your-username/your-repo-name.git
cd backend
```2. **Install dependencies:**
```bash
npm install
```3. **Start the server:**
```bash
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):
```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**
---