From 8a0e844d826e74488f48bdaa5ab67c705c75a796 Mon Sep 17 00:00:00 2001 From: Prateek579 Date: Mon, 27 May 2024 23:37:47 +0530 Subject: [PATCH 1/3] user sign-up issue solved --- routers/userRoutes.js | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/routers/userRoutes.js b/routers/userRoutes.js index 4a4c3a6..1463311 100644 --- a/routers/userRoutes.js +++ b/routers/userRoutes.js @@ -5,6 +5,7 @@ const path = require("path"); const bcrypt = require("bcrypt"); const saltRounds = 10; const jwt = require("jsonwebtoken"); +const nodemailer = require("nodemailer"); const User = require("../model/user"); const Query = require("../model/query"); // Adjust the path based on your project structure @@ -226,6 +227,7 @@ router.get("/logout", function (req, res) { // user Registration router.post("/User_singUp", async function (req, res) { const { username } = req.body; + const fullName = req.body.fname; try { // Check if the email already exists @@ -252,37 +254,55 @@ router.post("/User_singUp", async function (req, res) { password: hash, }); + // creating a message for USER + const message = `Thank you, ${(fullName).toUpperCase()}, for connecting with the PETARI organization.` + await newUser.save().then((user) => { let mailOptions = { to: user.email, subject: "Welcome To Petari", template: "Email.template", - context: { - user: { - fname: user.fullName, - _id: user._id, - username: user.fullName, - email: user.email, - }, - year: new Date().getFullYear(), - }, + // context: { + // user: { + // fname: user.fullName, + // _id: user._id, + // username: user.fullName, + // email: user.email, + // }, + // year: new Date().getFullYear(), + // }, + text: message, attachments: [ { filename: "logo.png", - path: path.join(__dirname, "public", "img", "logo.png"), + path: path.join(__dirname, "..", "public", "img", "logo.png"), cid: "logo", }, ], }; + + const transporter = nodemailer.createTransport({ + service: "gmail", + host: "smtp.gmail.com", + port: 465, + secure: true, + auth: { + user: process.env.mail_id, + pass: process.env.pass_id, + }, + }); + transporter.sendMail(mailOptions, function (error, info) { if (error) { console.log(error); } else { - console.log("Email sent: " + info.response); + console.log("Email sent successfully: " + info.response); } }); }); + const foundUser = await User.findOne({ email: username }); + const userQuerys = await Query.find({ user_id: foundUser._id }); return res.render("UserDashBoard", { From 03a88d6fa7e826deddd4696586f4abbb92c9a877 Mon Sep 17 00:00:00 2001 From: Pradnya Gaitonde <116059908+PradnyaGaitonde@users.noreply.github.com> Date: Wed, 29 May 2024 20:04:09 +0530 Subject: [PATCH 2/3] Update CONTRIBUTING.md Successfully added instructions to contribute using GitHub Desktop. --- CONTRIBUTING.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cee5c73..6041c6f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,6 +24,40 @@ in case you are stuck:
+### Alternatively, contribute using GitHub Desktop + +1. **Open GitHub Desktop:** + Launch GitHub Desktop and log in to your GitHub account if you haven't already. + +2. **Clone the Repository:** + - If you haven't cloned the Petari repository yet, you can do so by clicking on the "File" menu and selecting "Clone Repository." + - Choose the Petari repository from the list of repositories on GitHub and clone it to your local machine. + +3. **Switch to the Correct Branch:** + - Ensure you are on the branch that you want to submit a pull request for. + - If you need to switch branches, you can do so by clicking on the "Current Branch" dropdown menu and selecting the desired branch. + +4. **Make Changes:** + Make your changes to the code or files in the repository using your preferred code editor. + +5. **Commit Changes:** + - In GitHub Desktop, you'll see a list of the files you've changed. Check the box next to each file you want to include in the commit. + - Enter a summary and description for your changes in the "Summary" and "Description" fields, respectively. Click the "Commit to " button to commit your changes to the local branch. + +6. **Push Changes to GitHub:** + After committing your changes, click the "Push origin" button in the top right corner of GitHub Desktop to push your changes to your forked repository on GitHub. + +7. **Create a Pull Request:** + - Go to the GitHub website and navigate to your fork of the Petari repository. + - You should see a button to "Compare & pull request" between your fork and the original repository. Click on it. + +8. **Review and Submit:** + - On the pull request page, review your changes and add any additional information, such as a title and description, that you want to include with your pull request. + - Once you're satisfied, click the "Create pull request" button to submit your pull request. + +9. **Wait for Review:** + Your pull request will now be available for review by the project maintainers. They may provide feedback or ask for changes before merging your pull request into the main branch of the Petari repository. + ## **Issue Report Process 📌** 1. Go to the project's issues. From e83500dd0d5c9af7eaf93b0a2d1c62c5868631f7 Mon Sep 17 00:00:00 2001 From: Anjaliavv51 <154777864+Anjaliavv51@users.noreply.github.com> Date: Sat, 1 Jun 2024 22:40:54 +0530 Subject: [PATCH 3/3] Addition of Contributor's logo's and No of forks , pr's open closed stars contributor's to Readme.md file issue #155 --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index b3670ae..a23e735 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,12 @@ PETARI, The Food Donate WebApp, is an initiative by an organization aiming to redistribute excess food from various events to those in need. The project aligns with India's Sustainable Development Goals to achieve a hunger-free world and zero food waste. By leveraging technology, PETARI seeks to bridge the gap between surplus food and hunger, thereby benefiting society and the environment. +![GitHub issues](https://img.shields.io/github/issues/Sahil1786/Petari) +![GitHub forks](https://img.shields.io/github/forks/Sahil1786/Petari) +![GitHub pull requests](https://img.shields.io/github/issues-pr/Sahil1786/Petari) +![GitHub Repo stars](https://img.shields.io/github/stars/Sahil1786/Petari?style=social) +![GitHub contributors](https://img.shields.io/github/contributors/Sahil1786/Petari) + ## Tech Stack ### Frontend @@ -252,3 +258,21 @@ Admins have special privileges and access to manage the platform. The admin logi **Please follow me and give a star to my repository

(back to top)

+ +
+

Red Heart Contributors

+
+
+ +- This project thanking all the contributors for having your valuable contribution to our project +- Make sure you show some love by giving ⭐ to our repository + +
+ +
+ + + +
+
+

Back to top

\ No newline at end of file