Skip to content

Repository files navigation

All Contributors

Technologies Used

  • ExpressJs
  • Mongoose
  • Typegoose
  • TypeScript
  • Passport

Features

  • Admin dashboard
  • User settings and or user dashboard
  • Send emails
  • Receive emails
  • Connections through other parties ie discord, twitter, facebook etc..

Run locally

You can setup the application on your local system by 2 methods

  • Docker
  • Manually

⚠️ If you are using unix operating system than prefix all bash commands with sudo

Create new directory and clone the repository

mkdir multi-email
cd multi-email
git clone https://github.com/MultiEmail/backend.git
cd backend

Using Docker

Prerequisite

  • Docker is installed on your local system
  • .env file wih all required variables (check environment variables mentioned below)

Run Server

docker compose --env-file ./.env up

To rebuild the image

docker compose --env-file ./.env up --build

Create admin user

List current running docker containers

docker ps

Output

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d07f06c78445 backend-api "docker-entrypoint.s…" 46 minutes ago Up 46 minutes 0.0.0.0:3001->3001/tcp, :::3001->3001/tcp Server
91826c111b76 mongo:latest "docker-entrypoint.s…" 52 minutes ago Up 46 minutes 0.0.0.0:2717->27017/tcp, :::2717->27017/tcp Database

now copy the CONTAINER ID of image/container backend-api and replace <container_id> in the below mentioned commands and execute them

# build and install the command line tool in docker container
docker exec<container_id> yarn build
docker exec<container_id> npm i -g .
# create new admin user in database in docker container
docker exec<container_id> multi-email-admin -e <email> -u <username> -p <password>

Extra's (Port forwarding for docker containers)

ContainerPORT (host)Port (container)
Server30013001
MongoDB271727017

if you want to access database inside docker container from host than use

mongosh --port 2717

or if you want to use mongodb compass than you can use this connection string

mongodb://localhost:2717/

Manually

Prerequisite

  • Latest Node js version
  • Yarn installed
  • Mongodb installed on local system
  • .env file wih all required variables (check environment variables mentioned below)

Install all the required dependencies

this project use Yarn as package manager

yarn install

Run the server

yarn dev

Create admin user

yarn build
npm i -g .
multi-email-admin -e <email> -u <username> -p <password>

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

NameDescriptionExample
BASE_URLBase URL on which server is runninghttp://localhost:3001/api
DB_URIURI on which database is runningmongodb://localhost:27017/multiemail
FRONTEND_URLURI on which frontend is runninghttp://localhost:3000
GOOGLE_CLIENT_IDClient ID obtained while creating google oauth concent screen758327950938-90jskrnp9b8d2e6ljpqrstd8fdl2k9fljkhchasnnrnj8.apps.googleusercontent.com
GOOGLE_CLIENT_SECRETClient Secret obtained while creating google oauth concent screenGOCSPX-NL52LzLNzF6YGJxlAoeLAnGK-a6
GOOGLE_REDIRECT_URLURL on which user will be redirected after google oauthhttp://localhost:3001/api/auth/oauth/google/redirect
NODE_ENVWhat type of environment are you running this app indevelopment
EMAIL_IDWhich ID will be used for sending emailno-reply@multiemail.com
EMAIL_PASSWORDPassword of your email idmystrongpassword
EMAIL_SMTPEmail SMTP hostsmtp.server.com
ACCESS_TOKEN_PRIVATE_KEYprivate RSA key which will be used to sign access tokencheck .env.example file
ACCESS_TOKEN_PUBLIC_KEYpublic RSA key which will be used to verify access tokencheck .env.example file
REFRESH_TOKEN_PRIVATE_KEYprivate RSA key which will be used to sign refresh tokencheck .env.example file
REFRESH_TOKEN_PUBLIC_KEYpublic RSA key which will be used to verify refresh tokencheck .env.example file

NOTEs

  • Your DB_URI must be mongodb://mongo_db:27017/multiemail if you are using docker
  • If you use gmail account as EMAIL_ID than you must enable 2FA for your google account and generate app password and use it as EMAIL_PASS

Resources for generating .env variables

  • You can get google credentials by following this guide
  • You can use crypto tools for generating RSA keys for access and refresh tokens
  • RSA keys must be 1024

Detailed docs

Wanna join the team?

Contributing

  • Contributions make the open source community such an amazing place to learn, inspire, and create.
  • Any contributions you make are truly appreciated.
  • Check out our contribution guidelines for more information.

License


This project is Licensed under the MIT License. Please go through the License atleast once before making your contribution.


Contributors ✨

Thanks goes to these wonderful people ❤:

Ayush Chugh
Ayush Chugh

🐛🤔🧑‍🏫🛡️💻🚧📆👀
Toby
Toby

💻👀🚧
shivam vishwakarma
shivam vishwakarma

📖💻
Tharun K
Tharun K

📖💻🚇
Ayush
Ayush

🐛🛡️🤔🧑‍🏫💻🚧📆👀
James
James

💵🤔💼
AndrewDev
AndrewDev

🤔
Arpit Chugh
Arpit Chugh

📖
Drishit Mitra
Drishit Mitra

💻
João Mota
João Mota

💻
Shashank Bhat G S
Shashank Bhat G S

📖
Alberto Herrera Vargas
Alberto Herrera Vargas

💻
Vadym Yatsyuk
Vadym Yatsyuk

💻
Toby
Toby

🐛🛡️🤔
yash jain
yash jain

💻
Bongani Gumbo
Bongani Gumbo

📖
Shikhar
Shikhar

💻
Add your contributions

This project follows the all-contributors specification. Contributions of any kind welcome!

About

Project to manage multiple emails at once with lots of customization. You can send and receive emails. Desktop notifications can be modified.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

22 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages