Skip to content

yudin101/email-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email System Backend

Run Locally

Clone the project

git clone https://github.com/yudin101/email-system.git

Go to the project directory

cd email-system

Install dependencies

npm install

Setup variables

echo "PORT = port" > .env
echo "SESSION_SECRET = 'your_session_secret'" >> .env
echo "ENCRYPTION_KEY = 'your_encryption_key'" >> .env

Start the development server

npm run dev

API Routes

/api/register

localhost:3000/api/register
  • Example Body:
{
  "username": "yudin101",
  "email": "yudin@example.com",
  "password": "hello123"
}

/api/login

localhost:3000/api/login
  • Example Body:
{
  "username": "yudin101",
  "password": "hello123"
}

/api/logout

localhost:3000/api/logout

/api/received

localhost:3000/api/received
  • Sample Response:
[
  {
    "id": 1,
    "isReplyTo": null,
    "senderEmail": "yudin@e.com",
    "receiverEmail": "example@e.com",
    "subject": "Example Email",
    "body": "This is a sample email.",
    "time": "2025-06-16 12:39:48"
    "read": 1,
  },
  // More
]

/api/sent

localhost:3000/api/sent
  • Sample Response:
[
  {
    "id": 1,
    "isReplyTo": null,
    "senderEmail": "yudin@e.com",
    "receiverEmail": "example@e.com",
    "subject": "Example Email",
    "body": "This is a sample email.",
    "time": "2025-06-16 12:39:48"
  }
  // More
]

/api/mail/:id

localhost:3000/api/mail/1
  • Sample Response:
{
  "id": 1,
  "isReplyTo": null,
  "senderEmail": "yudin@e.com",
  "receiverEmail": "example@e.com",
  "subject": "Example Email",
  "body": "This is a sample email.",
  "time": "2025-06-16 12:39:48",
  "read": 1 // Will be shown only if you are the receiver
}

/api/send

localhost:3000/api/send
  • Example Body:
{
  "receiverEmails": ["john@example.com"], // Multiple email addresses can be added
  "isReplyTo": 2, // optional
  "subject": "Example Email",
  "body": "This is a sample email."
}

/api/delete/:id

localhost:3000/api/delete/1

Contributing

Contributions are always welcome!

If you’d like to contribute to this project, you can:

License

This project is licensed under the MIT License.

About

Email System API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors