Quran Mailer is a website that allows users to subscribe to a daily email and receive a random Quranic verse every day.
Welcome to Quran Mailer! This project aims to provide users with a daily dose of inspiration and reflection through randomly selected verses from the Quran. Users can subscribe to receive these verses via email on a daily basis.
The project is deployed on Vercel and uses Vercel Cron Jobs for website activation and email automation, along with the Atlas Cloud MongoDB database for subscriber management.
- Daily email subscription service
- Random selection of Quranic verses
- Simple and user-friendly interface
- Ability to read Quran through website
To run Quran Mailer locally or deploy it on your server, follow these steps:
- Clone the repository:
git clone https://github.com/ahmed0saber/quran_mailer.git
-
Make sure you have Node.js installed on your device.
-
Install dependencies:
cd quran_mailer
npm install
- Configure environment variables:
Create a .env.local
file in the root directory and set the required variables as mentioned in .env.local.example
file, where:
-
GMAIL_USER
: Set this to your Gmail address, for instance,[email protected]
. -
GMAIL_PASSWORD
: Obtain your Gmail app password by following these steps: How to Get Gmail App Password. -
MONGOOSE_DATABASE_URL
:- Visit MongoDB Atlas and create your database.
- Watch this video tutorial: Setting Up MongoDB Atlas (Minute 8:37) to create a collection for subscribers.
- Extract the
MONGOOSE_DATABASE_URL
by following the tutorial and using VS Code: - Update the URL with your username, password, and database name as shown in
.env.example
. - Refer to this guide for further assistance: How to Fix the "MongoServerError: Bad Authentication" Error.
-
SUBSCRIBERS_MODEL
: Set this to the desired subscribers collection name, such assubscribers
. -
DATABASE_NAME
: Set this to the database name, such asQuranMailer
. -
LOGGING_MODEL
: Set this to the desired logs collection name, such aslogs
. -
CRON_SECRET
: Specify any secret key for the cron job (Vercel uses it for authorization), e.g.,123456789
. -
ADMIN_USERNAME
: Set to any username, so you can use it to enter the dashboard, e.g.,admin
. -
ADMIN_PASSWORD
: Set to any password, so you can use it to enter the dashboard, e.g.,admin
.
- Start the server:
npm run dev
-
Visit http://localhost:3000 in your web browser to access Quran Mailer.
-
Run test suites when needed:
npm run test
- Get surahs data when needed:
npm run get:surahs
To subscribe to the daily email service and receive Quranic verses, simply submit your email address on subscription page.
Contributions are welcome! If you would like to contribute to Quran Mailer, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes.
- Run the test suites and modify your code if anyone failed till all test suites succeed.
- Commit your changes
- Push your changes to your fork.
- Submit a pull request to the main repository.
If you don't have any idea about what to contribute with, here are some ideas:
- Adding Quranic Verses: Contribute by adding new Quranic verses to the verses.js file. Ensure verses are not duplicated.
- Feature Requests: Suggest new features on the
issues
page. - Bug Reports: Report errors or bugs on the
issues
page. - Issue Resolution: Address validated issues from the
issues
page. - Code Updates and Refactoring: Refactor code or make updates to enhance the project.
- Documentation: Help improve the project's documentation, including the
README.md
file. - Add Test Cases: Add more test cases that can help keep the code quality high over time.
For more detailed guidance on contributing to open source projects, check out this YouTube playlist: Contributing to Open Source Projects (in Arabic).
This project is licensed under the MIT License. See the LICENSE.md file for more details.
If you have any questions, suggestions, or feedback, feel free to reach out to us at [email protected] or [email protected].