Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
99d0251
Update README.md
Ashnayak Nov 26, 2021
0966366
Fixes #1: Added login.html
surajdm123 Nov 27, 2021
d5d2f43
Fixes #1: Added login.css
surajdm123 Nov 27, 2021
de46def
Fixes #2: Added signup image
surajdm123 Nov 27, 2021
057c4de
Fixes #1: Added login image
surajdm123 Nov 27, 2021
5f23d8f
Fixes #1: Changed references
surajdm123 Nov 27, 2021
0b65b18
Fixes #3: Changed title bug
surajdm123 Nov 27, 2021
ff0eaf4
Resolved conflicts for backend
surajdm123 Nov 27, 2021
f43dd3d
Fixes: Resolved conflicts for js files
surajdm123 Nov 27, 2021
5358511
fixed add feature issue.
Sneha-at Nov 28, 2021
88ceb4d
Merge pull request #4 from Ashnayak/add_feature_fix
Ashnayak Nov 28, 2021
68ae526
Email feature basic requirements update
Sneha-at Nov 28, 2021
64072d0
Sample email text message
Sneha-at Nov 28, 2021
7687dc2
Email body updates, added the feature table.
Sneha-at Nov 28, 2021
f93cdad
Added export product details to excel file
Sneha-at Nov 28, 2021
eec6327
Merge pull request #6 from Ashnayak/email_trigger
surajdm123 Nov 28, 2021
31e5c25
Fixes #9: Added Addproduct API
surajdm123 Nov 29, 2021
c72dec8
Fixes #9: Added contributors text area in the project
surajdm123 Nov 29, 2021
09121bd
Merge pull request #10 from Ashnayak/9-contributor
Ashnayak Nov 29, 2021
92367a3
added description for features.
Sneha-at Nov 29, 2021
be605fc
contd. added description for features.
Sneha-at Nov 29, 2021
85817ef
Feature description
Sneha-at Nov 29, 2021
7af0f29
Create ImprovementDoc.md
Ashnayak Nov 29, 2021
d07c62c
Update ImprovementDoc.md
Ashnayak Nov 29, 2021
3ad272c
Fixes #8: Description modified
Ashnayak Nov 29, 2021
7d41af5
Merge pull request #11 from Ashnayak/added_description
surajdm123 Nov 29, 2021
d51348e
Merge pull request #13 from Ashnayak/description
surajdm123 Nov 29, 2021
c1c80aa
Update ImprovementDoc.md
Ashnayak Nov 29, 2021
a183c19
Updating DOI badge
Ashnayak Nov 29, 2021
70d75d9
Adding screenshots
Ashnayak Nov 29, 2021
d2e421c
Merge pull request #14 from Ashnayak/documents
Ashnayak Nov 29, 2021
e037bcb
Updated document with Phase 3 screenshots
Ashnayak Nov 29, 2021
4e8eeac
Creating Citation.md file
Himanshuu-Gupta Nov 29, 2021
7882b80
Create Bug_Report.md
Himanshuu-Gupta Nov 29, 2021
9327c72
Create Feature_Request.md
Himanshuu-Gupta Nov 29, 2021
4a6dfee
Update Readme with contributing details
Himanshuu-Gupta Nov 29, 2021
b701164
Updating Phase 3 docs
Himanshuu-Gupta Nov 29, 2021
56671cf
Fixes #15: Resolved redirection issue in login
surajdm123 Nov 29, 2021
6e98654
Deleting folder - shifted to phase3 docs
Himanshuu-Gupta Nov 29, 2021
e11c49d
Fixes #15: Added date field
surajdm123 Nov 29, 2021
8b04abe
Removed Date
surajdm123 Nov 29, 2021
2ca32e6
Fixes #15: Added type to TextField
surajdm123 Nov 29, 2021
e6b78c6
Merge pull request #16 from Ashnayak/issue15
ShreyanshPrajapati Nov 29, 2021
952c142
Update Contributing.md with Bug Report details
Himanshuu-Gupta Nov 29, 2021
1dd18b7
Update Contributing.md with Feature Request
Himanshuu-Gupta Nov 29, 2021
5207c16
Changes in the improvement document
Nov 30, 2021
e9f3185
Added bootstrap in the tech stack
ShreyanshPrajapati Nov 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ __pycache__
.idea
.coverage
.netlify
-idea/
1 change: 1 addition & 0 deletions CITATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[![DOI](https://zenodo.org/badge/432041373.svg)](https://zenodo.org/badge/latestdoi/432041373)
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Explain the problem and include additional details to help maintainers reproduce
* Provide specific examples to demonstrate the steps. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples.
* If you encounter a bug in a specific branch, please note the branch name.

Use the [Bug_Report Template](https://github.com/Ashnayak/feature-hunt/blob/main/issue_templates/Bug_Report.md) while creating the new bug request.

**Do NOT report a bug on a specific file, line of code, or test case if the file, code, or test case in question is not present anywhere in the repository.**

## Suggesting Enhancements
Expand All @@ -44,7 +46,7 @@ Enhancement suggestions are tracked as Github issues. After you have determined
* Explain why this enhancement would be useful to most users and is not something that can or should be implemented as a community package.
* List some other text editors or applications where this enhancement exists.
* Specify the name and version of the OS you're using.

Use the [Feature Request Template](https://github.com/Ashnayak/feature-hunt/blob/main/issue_templates/Feature_Request.md) while creating the new feature request.

Alternatively, you can open a new discussion here: https://github.com/CSC510-Group-25/feature-hunt/discussions/categories/ideas

Expand Down
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bb78c7431a71487595f3031af06dac4c)](https://app.codacy.com/gh/CSC510-Group-25/feature-hunt?utm_source=github.com&utm_medium=referral&utm_content=CSC510-Group-25/feature-hunt&utm_campaign=Badge_Grade_Settings)
[![DOI](https://zenodo.org/badge/413987683.svg)](https://zenodo.org/badge/latestdoi/413987683)
[![DOI](https://zenodo.org/badge/432041373.svg)](https://zenodo.org/badge/latestdoi/432041373)
[![GitHub license](https://img.shields.io/github/license/shahrk/feature-hunt)](https://github.com/shahrk/feature-hunt/blob/main/LICENSE)
[![made-with-javascript](https://img.shields.io/badge/Made%20with-JavaScript-blue)](https://www.javascript.com)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
Expand Down Expand Up @@ -197,6 +197,9 @@ This app has been deployed using Netlify and Heroku. Check it out [here!](https:

You can now run and test the project locally and in deployments. More info about our deplyments and switching between production and devlopment can be found in our [Wiki](https://github.com/CSC510-Group-25/feature-hunt/wiki/Deployment:-Heroku-and-Netlify)

## Contributions to the Project
Please refer to the [Contributing.md](https://github.com/Ashnayak/feature-hunt/blob/main/CONTRIBUTING.md) if you want to contrbute to the Feature Hunt source code. Follow all the guidelines mentioned and raise a pull request for the developers to review before the code goes to the main source code.

## Future Scope
We believe in the ability to add new features in any project (including our own).

Expand All @@ -206,7 +209,7 @@ We believe in the ability to add new features in any project (including our own)

<table>
<tr>
<td>Group 27</td>
<td> Phase 1</td>
<td align="center"><a href="https://github.com/shahrk/"><img src="https://avatars.githubusercontent.com/u/11090612?v=4" width="80px;" alt=""/><br /><sub><b>Raj Shah</b></sub></a></td>
<td align="center"><a href="https://github.com/Nirav1929/"><img src="https://avatars.githubusercontent.com/u/11133468?v=4" width="80px;" alt=""/><br /><sub><b>Nirav Patel</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/Parth59/"><img src="https://avatars.githubusercontent.com/u/22288099?v=4" width="80px;" alt=""/><br /><sub><b>Parth Kanakiya</b></sub></a><br /></td>
Expand All @@ -215,11 +218,20 @@ We believe in the ability to add new features in any project (including our own)
</tr>

<tr>
<td>Group 25</td>
<td> Phase 2</td>
<td align="center"><a href="https://github.com/etracey7/"><img src="https://avatars.githubusercontent.com/u/78971563?v=4" width="80px;" alt=""/><br /><sub><b>Emily Tracey</b></sub></a></td>
<td align="center"><a href="https://github.com/peeyush10234/"><img src="https://avatars.githubusercontent.com/u/10905673?v=4" width="80px;" alt=""/><br /><sub><b>Peeyush Taneja</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/jhnguye4/"><img src="https://avatars.githubusercontent.com/u/42051115?v=4" width="80px;" alt=""/><br /><sub><b>Jonathan Nguyen</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/snapcat/"><img src="https://avatars.githubusercontent.com/u/89357283?v=4" width="80px;" alt=""/><br /><sub><b>Leila Moran</b></sub></a><br /></td>
<td align="center"><a href="https://www.github.com/shraddhamishra7"><img src="https://avatars.githubusercontent.com/u/7471821?v=4" width="80px;" alt=""/><br /><sub><b>Shraddha Mishra</b></sub></a><br /></td>
</tr>
<tr>
<td> Phase 3</td>
<td align="center"><a href="https://github.com/surajdm123/"><img src="https://avatars.githubusercontent.com/u/42767118?v=4" width="100px;" alt=""/><br /><sub><b>Suraj Devatha</b></sub></a></td>
<td align="center"><a href="https://github.com/Sneha-at"><img src="https://avatars.githubusercontent.com/u/81721081?v=4" width="100px;" alt=""/><br /><sub><b>Sneha Aradhey</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/Ashnayak"><img src="https://avatars.githubusercontent.com/u/18304940?v=4" width="100px;" alt=""/><br /><sub><b>Ashwini Nayak</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/Himanshuu-Gupta"><img src="https://avatars.githubusercontent.com/u/15701338?v=4" width="100px;" alt=""/><br /><sub><b>Himanshuu Gupta</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/ShreyanshPrajapati/"><img src="https://avatars.githubusercontent.com/u/13018358?v=4" width="100px;" alt=""/><br /><sub><b>Shreyansh Prajapati</b></sub></a><br /></td>
</tr>

</table>
4 changes: 2 additions & 2 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
app.secret_key = "testing"
CORS(app)

#if __name__ == "__main__":
# app.run(debug=True, port=environ.get("PORT", 5000) , host='0.0.0.0')
if __name__ == "__main__":
app.run(debug=True, port=environ.get("PORT", 5000) , host='0.0.0.0')
3 changes: 2 additions & 1 deletion backend/auth_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def signup():
return message

redirect_url = 'https://damp-citadel-25681.herokuapp.com/'
# redirect_url = 'http://localhost:5000/'

#################################################################################
## Function: logged_in
Expand Down Expand Up @@ -136,4 +137,4 @@ def logout():
session.pop("email", None)
return "Logout Successful"
else:
return "Logout Successful"
return "Logout Successful"
8 changes: 5 additions & 3 deletions backend/product_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ def add_product():
product_description = request.form.get("productDescription")
image_url = request.form.get("imageUrl")
email = request.form.get("email")
last_date = request.form.get("lastDate")
tags = request.form.get("tags").split(' ')

feature_dict = {'id': 2, 'text': 'feature-1', 'votes': 1, 'timestamp': '1234567', 'tags': ['tag1']}

product_input = {'name': product_name, 'description': product_description,
'image_url': image_url, 'users': [email], 'tags': tags, 'features': feature_dict}
'image_url': image_url, 'users': [email], 'tags': tags, 'features': feature_dict,
'last_date': last_date}


product_records.insert_one(product_input)
Expand All @@ -51,9 +53,9 @@ def add_product():
# result = product_records.find_one_and_update(
# {"project_name": productName}, {"$push": {"features": data}}
# )
#

# return jsonify(success=True)
#

# elif request.method == 'GET':
# result = mongo.db.products.find({"name": productname}, {"features": 1})
# return dumps(result)
162 changes: 136 additions & 26 deletions backend/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@
this file. If not, please write to: featurehuntteam@gmail.com
"""

# pylint: disable=wrong-import-position,poiackend-lontless-string-statement,undefined-variable,line-too-long

import os
from sys import stderr
from flask import request, jsonify
import os, io
from flask import request, jsonify, Response
from flask import json
from app import app

import pandas as pd
from bson.json_util import dumps
from bson.objectid import ObjectId
from db_init import product_records
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
from datetime import date
from email import encoders
from email.mime.base import MIMEBase

'''
Function: products
Expand All @@ -40,7 +43,26 @@ def products():
return Response(response=json.dumps({"Error": "Please provide all necessary input"}),
status=400,
mimetype='application/json')
return jsonify({'ok': True, 'message': 'Product added successfully'}), 200
try:
product_name = request.form.get("productName")
product_description = request.form.get("productDescription")
image_url = request.form.get("imageUrl")
email = request.form.get("email")
last_date = request.form.get("lastDate")
tags = request.form.get("tags").split(' ')

feature_dict = {'id': 2, 'text': 'feature-1', 'votes': 1, 'timestamp': '1234567', 'tags': ['tag1']}

product_input = {'name': product_name, 'description': product_description, 'votes': 1,
'image_url': image_url, 'users': [email], 'tags': tags, 'features': feature_dict,
'last_date': last_date}


product_records.insert_one(product_input)

return jsonify({'ok': True, 'message': 'Product added successfully'}), 200
except:
return jsonify(success=False)

if request.method == 'DELETE':
if data is None or data == {}:
Expand All @@ -63,23 +85,26 @@ def products():
else:
return jsonify({'ok': False, 'message': 'Bad request parameters!'}), 400


'''
Function: get_feature
Description: Get the list of all features for given product name
Inputs:
- productName: Name of the product
Outputs:
- results: List of features that are available in that product
'''


@app.route('/<productname>/getFeature', methods=['GET', 'POST'])
def get_feature(product_name):
@app.route('/<productname>', methods=['GET', 'POST'])
def get_feature(productname):
''' see above '''
if request.method == 'GET':
data = product_records.find({"name": product_name})
return dumps(data)

data = product_records.find({"name": productname})
if request.method == 'POST':
data = request.json
data['_id'] = ObjectId()
print(data)
if data is None or data == {}:
return Response(response=json.dumps({"Error":
"Please provide connection information"}),
status=400,
mimetype='application/json')
result = product_records.find_one_and_update(
{"project_name": productname}, {"$push": {"features": data}}
)

return jsonify(success=True)
return dumps(data)

'''
Function: features
Expand All @@ -92,7 +117,7 @@ def get_feature(product_name):


@app.route('/<productname>/features', methods=['GET', 'POST'])
def features(product_name):
def features(productname):
result = ''
if request.method == 'POST':
data = request.form.get('features')
Expand All @@ -102,8 +127,93 @@ def features(product_name):
return Response(response=json.dumps({"Error": "Please provide connection information"}),
status=400,
mimetype='application/json')
result = product_records.find_one_and_update({"name": productname}, {"$set": {"features": data}})
result = product_records.find_one_and_update({"name": productname}, {"$set": {"features": data}},
{'$upsert': 'true'})

elif request.method == 'GET':
result = product_records.find({"name": product_name}, {"features": 1})
result = product_records.find({"name": productname}, {"features": 1})
return dumps(result)


@app.route('/<productname>/email', methods=['GET'])
def email(productname):
today = date.today()
recipients = ['svaradhe@ncsu.edu', 'hgupta6@ncsu.edu', 'ashwininayak1212@gmail.com', 'surajdm123@gmail.com', 'saprajap@ncsu.edu']
today = today.strftime("%d-%b-%Y")
print("Checking for Internet Connection\n")
username = os.getenv('USERNAME')
password = os.getenv('PASSWORD')
server = smtplib.SMTP_SSL("smtp.gmail.com")
server.login(username,password)
emailfrom = username
emailto =", ".join(recipients)

msg = MIMEMultipart('alternative')
msg["From"] = emailfrom
msg["To"] = emailto
msg["Subject"] = "Product analysis "+today

result = product_records.find({"name": productname}, {"features": 1})
result = pd.json_normalize(list(result))
result = result.explode('features').reset_index(drop=True)
features = pd.DataFrame(result['features'].tolist())

excel_file = pd.concat([result.drop(['features'], axis=1), result['features'].apply(pd.Series)], axis=1)
excelfilename="Product_feature_details "+today+".xlsx"
excel_file.to_excel(excelfilename)
part2 = MIMEBase('application', "octet-stream")
part2.set_payload(open("Product_feature_details "+today+".xlsx", "rb").read())
encoders.encode_base64(part2)
part2.add_header('Content-Disposition', "attachment", filename="Product_feature_details "+today+".xlsx")
msg.attach(part2)

features.rename(columns={'text': 'FeatureName', 'votes': 'Votes'}, inplace=True)
result = features[['FeatureName', 'Votes']].sort_values(by='Votes', ascending=False)[:5]
import io
str_io = io.StringIO()
result.to_html(buf=str_io, classes='table table-striped', index=False)
html_str1 = str_io.getvalue()
email_content = """ <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>test</title>
<style type="text/css" media="screen">
table{
background-color: #f7fdff;
empty-cells:hide;
border-collapse: collapse;
border-spacing: 2px;
}
th {background-color:#586266; color:white;text-align: center;}
td {
text-align: center;

}

</style>
</head>
<body>

<p>

>>>>>>>>>>AUTOGENERATED MAIL<<<<<<<<<<>>>>>>>>>><<<<<<<<<<
<br>
<br>

<strong> Hi All,
<br>

<br>

""" + html_str1 + """

<br>
"""
HTML_BODY = MIMEText(email_content, 'html')
msg.attach(HTML_BODY)
server = smtplib.SMTP_SSL("smtp.gmail.com", 465)
server.login(username, password)
print("Sending...")
server.sendmail(emailfrom, recipients, msg.as_string())
server.quit()
print("Sent")
return 'Email Sent!'
39 changes: 39 additions & 0 deletions docs/ImprovementDoc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Phase 3 Improvements
Phase 3 saw many changes in the develpoment of feature-hunt. In this document we provide a detailed overview of all the changes implemented by our team during Phase 3.

## Front End
The team worked meticulously to improve the user interface. While revamping the existing UI, we took the liberty to add a couple more features:
- The Phase 2 version did not have a login page
- The Phase 2 version did not have a signup page.

*Improvements:*
1) Created a SignUp page to enable new users to create an account to use feature-hunt.
2) Designed a login page that acts as the portal to sign in once a user has an account (ONLY when a user has an account).
3) Added Collaborators to the project form. This helps us send email notifications to the collaborators regarding updates related to their project features.
4) Improved existing UI for displaying projects and features.
5) Made the user experience more insightful by creating a description feature for each project and feature. A new user can intuitively understand what each project or feature does.
6) Fixed the Search Bar functionality. Users can now use the search bar to look up Projects easily.

## Back End
With respect to backend, we decided to use the existing tech stack and improve upon it. We went ahead with using Docker and MongoDB as the previous team had done.

*Improvements:*
1) Redesigned the schema for feature-hunt
2) We introduced an email alerting mechanism that notified users with triggered email alerts. The notification is triggered upon the completion of a project close discussion date and informs the user about the five most popular features. There is also an attachment providing more information on all the features discussed as well.

## Comparing Results of Phase 2 and Phase 3


Phase 2 | Phase 3
:-------------------------:|:-------------------------:
No Signup page | New Signup page <br><img src="https://github.com/Ashnayak/feature-hunt/blob/d2e421c58edddf0c3ab9ce9076f8f91f6fb80171/docs/screenshots/WhatsApp%20Image%202021-11-29%20at%2012.12.21%20PM%20(2).jpeg" width="500"/>
No Login page | New Login page <br><img src="https://github.com/Ashnayak/feature-hunt/blob/d2e421c58edddf0c3ab9ce9076f8f91f6fb80171/docs/screenshots/WhatsApp%20Image%202021-11-29%20at%2012.12.21%20PM%20(1).jpeg" width="500" />
No Search Functionality | Implemented Search Functionality <br><img src="https://github.com/Ashnayak/feature-hunt/blob/d2e421c58edddf0c3ab9ce9076f8f91f6fb80171/docs/screenshots/WhatsApp%20Image%202021-11-29%20at%2012.12.20%20PM%20(1).jpeg" width="500" />
Basic Form | Improved Form with Tags and Contributors <br><img src="https://github.com/Ashnayak/feature-hunt/blob/d2e421c58edddf0c3ab9ce9076f8f91f6fb80171/docs/screenshots/WhatsApp%20Image%202021-11-29%20at%2012.12.20%20PM.jpeg" width="500" />
No Project Description | Added Project Description <br><img src="https://github.com/Ashnayak/feature-hunt/blob/d2e421c58edddf0c3ab9ce9076f8f91f6fb80171/docs/screenshots/WhatsApp%20Image%202021-11-29%20at%2012.12.21%20PM.jpeg" width="500" />

## Tools used
The original team used React, JavaScript, Python3, Flask, MongoDB, HTML and CSS. In addition to these, we have used Bootstrap.

## Conclusion of Phase 3
Working on Phase 3 was an eye-opening simulation of how Software Engineering project development occurs in the real world. Countless brainstorming sessions to whip up a myriad of creative ideas which we brought to fruition, in short, the Phase 3 sojourn was a memorable learning experience. We would like to thank Dr. Timothy Menzies for helping us understand the process of building a good Software Engineering project. We would also like to thank the teaching assistants Xiao Ling, Andre Lustosa, Kewen Peng, Weichen Shi for their support throughout the project. We are grateful for the opportunity to work with our friends and colleagues at NCSU - shout out to the developers of Phase 1 and Phase 2 for their contribution to this amazing project!
Loading