Skip to content

Commit

Permalink
Merge branch 'Sahil1786:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Pruthaa17 authored Jun 1, 2024
2 parents 8e46324 + 56b157b commit 3e3852d
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 11 deletions.
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,40 @@ in case you are stuck:

<br>

### 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 <branch-name>" 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.
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
<a name="introduction"></a>
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
<a v="tech-stack"></a>
### Frontend
Expand Down Expand Up @@ -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
<p align="right">(<a href="#top">back to top</a>)</p>
<div align="center">
<h2><font size="6"><img src="https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Smilies/Red%20Heart.png" alt="Red Heart" width="40" height="40" /> Contributors </font></h2>
</div>
<br>
- 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
<br>
<center>
<a href="https://github.com/Sahil1786/Petari/graphs/contributors">
<img src="https://contrib.rocks/image?repo=Sahil1786/Petari" />
</a>
</center>
<br>
<p align="right"><a href="#top">Back to top</a></p>
42 changes: 31 additions & 11 deletions routers/userRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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", {
Expand Down

0 comments on commit 3e3852d

Please sign in to comment.