Skip to content

Commit

Permalink
Merge branch 'main' into bug/mobilenavgap
Browse files Browse the repository at this point in the history
  • Loading branch information
ANI2707 authored Jun 6, 2024
2 parents b38f916 + 3c63fc9 commit 3ea1005
Show file tree
Hide file tree
Showing 24 changed files with 964 additions and 287 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/auto-comment-pr-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Auto Comment on PR Merge

on:
pull_request_target:
types: [closed]

permissions:
issues: write
pull-requests: write

jobs:
comment:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: Add Comment to Merged PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
COMMENT=$(cat <<EOF
{
"body": "Congratulations, Your pull request has been successfully merged 🥳🎉 Thank you for your contribution to the project 🚀 Keep Contributing!! ✨"
}
EOF
)
RESPONSE=$(curl -s -o response.json -w "%{http_code}" \
-X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
-d "$COMMENT")
cat response.json
if [ "$RESPONSE" -ne 201 ]; then
echo "Failed to add comment"
exit 1
fi
29 changes: 29 additions & 0 deletions .github/workflows/autocomment-iss-close.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Comment on Issue Close

on:
issues:
types: [closed]

jobs:
greet-on-close:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Greet User
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issue = context.payload.issue;
const issueCreator = issue.user.login;
const issueNumber = issue.number;
const greetingMessage = `Hello @${issueCreator}! Your issue #${issueNumber} has been closed. Thank you for your contribution!`;
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
body: greetingMessage
});
37 changes: 37 additions & 0 deletions .github/workflows/close-old-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Close Old Issues
on:
schedule:
- cron: "0 0 * * *"

jobs:
close-issues:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Close Old Issues
run: |
open_issues=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues?state=open" \
| jq -r '.[] | .number')
for issue in $open_issues; do
# Get the last updated timestamp of the issue
last_updated=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue" \
| jq -r '.updated_at')
days_since_update=$(( ( $(date +%s) - $(date -d "$last_updated" +%s) ) / 86400 ))
if [ $days_since_update -gt 30 ]; then
curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"state":"closed"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue"
# Add a comment explaining when the issue will be closed
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"body":"This issue has been automatically closed because it has been inactive for more than 30 days. If you believe this is still relevant, feel free to reopen it or create a new one. Thank you!"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue/comments"
fi
done
34 changes: 34 additions & 0 deletions .github/workflows/close-old-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Close Stale PRs

on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
pull_request:
types:
- opened
- reopened
- synchronize

permissions:
pull-requests: write
issues: write

jobs:
close_stale_prs:
runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- uses: actions/stale@v7
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'This PR has been automatically closed due to inactivity from the owner for 15 days.'
days-before-pr-stale: 15
days-before-pr-close: 0
exempt-pr-author: false
exempt-pr-labels: ''
only-labels: ''
operations-per-run: 30
remove-stale-when-updated: true
debug-only: false
24 changes: 24 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Greetings'

on:
fork:
push:
branches: [main]
issues:
types: [opened]
pull_request_target:
types: [opened]

jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: EddieHubCommunity/gh-action-community/src/welcome@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: |
Congratulations, @${{ github.actor }}! 🎉 Thank you for creating your issue. Your contribution is greatly appreciated and we look forward to working with you to resolve the issue. Keep up the great work!
pr-message: |
Great job, @${{ github.actor }}! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project.
footer: 'We will promptly review your changes and offer feedback. Keep up the excellent work! Kindly remember to check our [contributing guidelines](https://github.com/VanshKing30/FoodiesWeb/blob/main/CONTRIBUTING.md)'
68 changes: 68 additions & 0 deletions LEARN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# FoodiesWeb
<!-- TABLE OF CONTENTS -->

<details open="open">
<summary><h2 style="display: inline-block">Table of Contents</h2></summary>
<ol>
<li>
<a href="#1 Introduction">Introduction</a>
</li>
<li>
<a href="#2 Features">Features</a>
</li>
<li>
<a href="#3 Tech Stacks">Tech Stacks</a>
</li>
<li>
<a href="#4 Snapshots">Snapshots</a>
</li>
</ol>
</details>

# <a name="1 Introduction">Introduction:</a>

The Project "Foodies" enables the end users to register online, read and select the food from e-menu card and order food online by just selecting the food that the user want to have using android application. It is designed for seamless campus culinary experiences and they can access daily canteen menus, make informed dietary choices with Spoonacular integration, and empower canteen efficiency. This system will minimize the queues in the canteen and make hassle-free payments using the unique id provided to the students and the faculty by the college.

# <a name="2 Features">Features:</a>

- **Menu Exploration**: Easily check out daily menus of all campus canteens from personal devices.
- **Nutritional Insights**: Access nutritional information for dishes, aiding in informed dietary choices.
- **Canteen Optimization**: Assist canteen owners with menu planning and recipe suggestions, enhancing efficiency.
- **User-Friendly Interface**: Effortless sign-up for students and secure login credentials for canteen owners.
- **Health News**: Stay informed with health-related articles, empowering users to make healthier dietary choices.

# <a name="3 Tech Stacks">Tech Stacks:</a>

1. JavaScript: 96.6%

2. HTML: 1.9%

3. CSS: 1.3%

4. Dockerfile: 0.2%

a. React.js: Provides a sleek and efficient frontend.

b. Tailwind CSS: Ensures stylish and user-friendly designs.

c. Express.js: Powers the backend operations.

d. MongoDB Atlas and Mongoose: Store and manage important data.

e. Spoonacular API: Offers nutritional information and recipe ideas.

f. G News API: Fetches health-related articles.

g. Bcrypt and JWT: Ensure data security and protection.

# <a name="4 Snapshots">Snapshots:</a>

<center><img src="https://miro.medium.com/v2/resize:fit:1400/format:webp/1*vn4AvYCeRN9vMVIdXdzVzw.png" /></center>
<center><img src="https://miro.medium.com/v2/resize:fit:1100/format:webp/1*VGix7E14mgXVRmiLUK3N5g.png" /></center>
<center><img src="https://miro.medium.com/v2/resize:fit:750/format:webp/1*b0oBt2sZFrnVshyIh58G2Q.png" /></center>
<center><img src="https://miro.medium.com/v2/resize:fit:1100/format:webp/1*AinzzVn6uc2MpB9nIDEfHA.png" /></center>


## 🙏 Support

This project needs a ⭐️ from you. Don't forget to leave a star ⭐️
65 changes: 51 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
<div align="center">
<img src="https://i.ibb.co/8KGfccV/image.png" alt="image" border="0"/>
<img src="https://github.com/me-shweta/Design-Den/blob/main/FoodiesWeblogo.png" alt="image" border="0"/>
<h1>Connecting You to Your College Canteens</h1>

<table align="center">
<thead align="center">
<tr border: 1px;>
<td><b>🌟 Stars</b></td>
<td><b>🍴 Forks</b></td>
<td><b>🐛 Issues</b></td>
<td><b>🔔 Open PRs</b></td>
<td><b>🔕 Close PRs</b></td>
<td><b> last commit</b></td>
</tr>
</thead>
<tbody>
<tr>
<td><img alt="Stars" src="https://img.shields.io/github/stars/VanshKing30/FoodiesWeb?style=flat&logo=github"/></td>
<td><img alt="Forks" src="https://img.shields.io/github/forks/VanshKing30/FoodiesWeb?style=flat&logo=github"/></td>
<td><img alt="Issues" src="https://img.shields.io/github/issues/VanshKing30/FoodiesWeb?style=flat&logo=github"/></td>
<td><img alt="Open Pull Requests" src="https://img.shields.io/github/issues-pr/VanshKing30/FoodiesWeb?style=flat&logo=github"/></td>
<td><img alt="Close Pull Requests" src="https://img.shields.io/github/issues-pr-closed/VanshKing30/FoodiesWeb?style=flat&color=critical&logo=github"/></td>
<td><img alt="Close Pull Requests" src="https://img.shields.io/github/last-commit/VanshKing30/FoodiesWeb?style=flat&color=critical&logo=github"/></td>
</tr>
</tbody>
</table>
</div>

# Tech Stacks

![](https://img.shields.io/badge/React-61DAFB?style=for-the-badge&logo=react&color=blue)
Expand Down Expand Up @@ -62,30 +86,35 @@ Welcome to Foodies, your go-to college dining companion! Designed for seamless c

## To get started with contributing to the FoodiesWeb project, follow these steps:

1. **Navigate to the Project Directory:**
1. **Fork and clone the repository**
2. **Navigate to the Project Directory:**
```bash
cd path/to/FoodiesWeb
cd FoodiesWeb
```
2. **Split Terminal for Backend Setup**
3. **Split Terminal for Backend Setup**

3. **Navigate to the Server Directory:**
4. **Navigate to the Server Directory:**
```bash
cd path/to/FoodiesWeb/server
cd server
```
4. **Install Dependencies (in both terminals):**
5. **Install Dependencies (in both terminals):**
```bash
npm install
```
5. **Start the Backend Server (in the terminal within the /server directory):** <br>

### **ENV Variables**
Setup MongoDB local host instance and port in env file in your local device. Default port is 4000
Sample uri is given below.
```
PORT=3000
DATABASE_URL="http://localhost:21713/foods"
```

6. **Start the Backend Server (in the terminal within the /server directory):** <br>
In the terminal where you navigated to the /server directory, run the following command to start the backend server:
```bash
nodemon server.js
```
6. **Navigate to the src (with Backend Running):**<br>
In the other terminal, run the following command to navigate to the src folder (frontend):
```bash
cd src
```
7. **Start the React App (with Backend Running):**<br>
After navigating run the following command to start the React app with the backend server running successfully:
```bash
Expand Down Expand Up @@ -158,5 +187,13 @@ To learn React, check out the [React documentation](https://reactjs.org/).

<img src="https://imgur.com/wuiJXqr.png"/>

<p>Thank you for being a part of this project!
<h2 align = "center">Our Contributors ❤️</h2>
<div align = "center">
<h3>Thank you for being a part of this project!</h3>

![Contributors](https://contrib.rocks/image?repo=VanshKing30/FoodiesWeb)<br>


</div>

<p align="right">(<a href="#top">Back to top</a>)</p>
1 change: 1 addition & 0 deletions server/config/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ require("dotenv").config();

const dbConnect = () =>{
mongoose.connect(process.env.DATABASE_URL,{

useNewUrlParser : true,
useUnifiedTopology : true,
})
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"datauri": "^4.1.0",
"dotenv": "^16.3.1",
"dotenv": "^16.4.5",
"express": "^4.18.2",
"express-async-handler": "^1.2.0",
"faker": "^5.5.3",
Expand Down
3 changes: 3 additions & 0 deletions server/server.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const express = require("express");
const app = express();
const dotenv = require('dotenv')
dotenv.config({path : ".env"});
const cors = require("cors");
var cookieParser = require("cookie-parser");
const PORT = process.env.PORT || 4000;
const cloudinaryConfig = require("./config/cloudinaryConfig");


app.use(
cors({
origin: "*",
Expand Down
Loading

0 comments on commit 3ea1005

Please sign in to comment.