Clone the project
git clone https://github.com/yudin101/email-system.gitGo to the project directory
cd email-systemInstall dependencies
npm installSetup variables
echo "PORT = port" > .env
echo "SESSION_SECRET = 'your_session_secret'" >> .env
echo "ENCRYPTION_KEY = 'your_encryption_key'" >> .envStart the development server
npm run dev- Request Method:
POST - Definition
- Example URL:
localhost:3000/api/register
- Example Body:
{
"username": "yudin101",
"email": "yudin@example.com",
"password": "hello123"
}- Request Method:
POST - Definition
- Example URL:
localhost:3000/api/login
- Example Body:
{
"username": "yudin101",
"password": "hello123"
}- Request Method:
GET - Definition
- Example URL:
localhost:3000/api/logout
- Request Method:
GET - Definition
- Example URL:
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
]- Request Method:
GET - Definition
- Example URL:
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
]- Request Method:
GET - Definition
- Example URL:
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
}- Request Method:
POST - Definition
- Example URL:
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."
}- Request Method:
GET - Definition
- Example URL:
localhost:3000/api/delete/1
Contributions are always welcome!
If you’d like to contribute to this project, you can:
- Create an Issue: Report bugs or suggest features by creating an issue.
- Open a Pull Request: Submit code changes or improvements by opening a pull request.
This project is licensed under the MIT License.