Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Manty-K/FeelingsHub into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Manty-K committed Oct 24, 2021
2 parents bfac7b8 + adb1ee6 commit aabb062
Show file tree
Hide file tree
Showing 3 changed files with 220 additions and 6 deletions.
37 changes: 31 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
# Feelings Hub
![Banner](https://github.com/Punit-Choudhary/FeelingsHub/blob/main/banner.png)
## 💡 Inspiration
Mental health is a major concern worldwide and India is not far behind in sharing this. About 14% of the global burden of disease is attributed to neuropsychiatric disorders and in India WHO estimates that the burden of mental health problems in India is 2443 disability-adjusted life years (DALYs) per 100 00 population and the suicide rate percentage due to mental health is 21.1 percent in the last few years and it had increased more due to spread of covid 19 virus. Mental health, loneliness, depression, etc are all serious issues in modern times but people are afraid to talk about them. Indian societies consider mental health as taboo due to which people are more afraid to talk about it and instead of getting support and help from society they suffer alone. People who suffer from mental illness needed a medium to talk, to express themselves, they needed support and motivation. By remarking this importance we are creating an app where people who suffer from mental health can talk openly, share their problems and difficulties and get motivated, and be guided properly so that they can enjoy their life to the fullest of its means. That's our sole purpose of making this app to bring happiness back to the life of people.

# What it does
Find the motivation and positive mindset you need to succeed with daily encouragement. This app is designed to inspire you with positive affirmations and self-talk — a proven technique to make your mind work for you. Choose the ones that resonate with your goals and learn how to reduce negative self-talk.
## 📱 What it does
Find the motivation and positive mindset one needs to succeed with daily encouragement. This app is designed to inspire with positive affirmations and self-talk — a proven technique to make one's mind work for himself/herself. Choose the ones that resonate with your goals and learn how to reduce negative self-talk.

Our app is a one on one interacting chatting app where if you are suffering from mental health or you are depressed or just feeling low you can interact with highly motivated and enthusiastic people with whom you can interact and share all your problems and difficulties and get good suggestions, recommendations, and proper guidance
Our app is a one on one interacting chatting app where if you are suffering from mental health or you are depressed or just feeling low you can interact with highly motivated and enthusiastic people with whom you can interact and share all your problems and difficulties and get good suggestions, recommendations, and proper guidance.

This app features handpicked motivational videos, quotes, and blogs from top motivational speakers around the world. It also covers the top asked questions and their answers for the people who are suffering from mental health and the people who wanted to be aware of mental health
This app features handpicked motivational videos, quotes, and blogs from top motivational speakers around the world. It also covers the top asked questions and their answers for the people who are suffering from mental health and the people who wanted to be aware of mental health.

# Inspiration
Mental health is a major concern worldwide and India is not far behind in sharing this. About 14% of the global burden of disease is attributed to neuropsychiatric disorders and in India WHO estimates that the burden of mental health problems in India is 2443 disability-adjusted life years (DALYs) per 100 00 population and the suicide rate percentage due to mental health is 21.1 percent in the last few years and it had increased more due to spread of covid 19 virus. Mental health, loneliness, depression, etc are all serious issues in modern times but people are afraid to talk about them. Indian societies consider mental health as taboo due to which people are more afraid to talk about it and instead of getting support and help from the society they suffer alone. people who suffer from mental illness needed a medium to talk, to express themselves,they needed support and motivation . By remarking this importance we are creating an app where people who suffer from mental health can talk openly, share their problems and difficulties and get motivated and be guided properly so that they can enjoy their life to fullest of it means. That's our sole purpose of making this app to bring happiness back in the life of people.
## 🔨 How we built it
We have utilized Flutter to build this app because it supports all mobile platforms. For the Admin page, we utilized HTML and Firebase as the database for the app.

We created APIs using Python and Flask and hosted them on Linode.

Furthermore to build the presentation slide we used Canva and then to build our initial prototype before hard-coding the app we used Figma & Draw.io

## 💪 Challenges we ran into
We all are students, so we had a hard time managing this project and our lectures. Additionally, this was the first hackathon for the team. Despite all the challenges we faced, in the end, we were successfully able to finish our features and site and record the demo video.

## 🧠 What we learned
Overall, Hackathon had an amazing source of learning for the Team.
We learned to work in a team by distributing tasks. We participated in mini-events and got to connect with other "Hackers" & Mentors. In technical aspects, we learned flutter, API development, Linux (for Linode).

## 🚀 What's next for Feelings Hub
In the future, Feelings Hub hopes to:
- Upload this on PlayStore & AppStore
- Utilize AI moderation over chats
- AI chatbot to chat with and which will flush chat history immediately
- Make a better UI
- Voice & Video call feature
- Add lofi & relaxing music feature
- Add Meditation & Yoga session corner
- Apply changes as per user's feedbacks
Binary file added banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
189 changes: 189 additions & 0 deletions rest_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
import uuid
from flask import Flask
from flask.json import jsonify
from flask_restful import Api, Resource

# Create App
app = Flask(__name__)
app.url_map.strict_slashes = False

api = Api(app)


pairs = []

# Functions

# function to update data
def update_data(sad_data, happy_data):
with open("sad.txt", 'w') as sad:
for data in sad_data:
data += "\n"
sad.write(data)

with open("happy.txt", 'w') as happy:
for data in happy_data:
data += "\n"
happy.write(data)

# function to get uuid
def get_uuid():
return str(uuid.uuid4())

#function to open files
def get_file(which="all"):

if which == "all":
# opening file of sad people
with open("sad.txt") as file:
sad_data = file.readlines()
sad_list = [sad_data[i][:-1] for i in range(len(sad_data))]

# opening file of cheerful
with open("happy.txt") as file:
happy_data = file.readlines()
happy_list = [happy_data[i][:-1] for i in range(len(happy_data))]

return sad_list, happy_list
elif which == "sad":
# opening file of sad people
with open("sad.txt") as file:
sad_data = file.readlines()
sad_list = [sad_data[i][:-1] for i in range(len(sad_data))]

return sad_list
elif which == "happy":
# opening file of cheerful
with open("happy.txt") as file:
happy_data = file.readlines()
happy_list = [happy_data[i][:-1] for i in range(len(happy_data))]

return happy_list

# function to make pairs
def make_pairs() -> None:
sad_list, happy_list = get_file()

while sad_list and happy_list:
convcode = get_uuid()
sad = sad_list.pop(0)
happy = happy_list.pop(0)

pairs.append(
{
sad: convcode,
happy: convcode
}
)
print(pairs) # for debugging purpose
print("\n\n") # for debugging purpose

# Updating the data of sad & happy file
update_data(sad_list, happy_list)

# function to update paired lists
def update_pairs(id):
updated = False

for i in range(len(pairs)):
if id in pairs[i]:
pairs.pop(i)
updated = True

if updated:
break

class Home(Resource):
def get(self):
return """
Get Sad list: https://url/sad
Update Sad list: https://url/sad/<id>
Get Happy list: https://url/happy
Update Happy list: https://url/happy/<id>
Get Pair: https://url/pair/<id>
Remove Pair: https://url/remove/<id>
"""


class Depressed_Put(Resource):
def put(self, id):
with open("sad.txt", 'a') as sad:
id += "\n"
sad.write(id)
return jsonify("Added")


class Depressed_Get(Resource):
def get(self):
sad_list = get_file(which="sad")
return sad_list


class Happy_Put(Resource):
def put(self, id):
with open("happy.txt", 'a') as happy:
id += "\n"
happy.write(id)
return jsonify("Added")


class Happy_Get(Resource):
def get(self):
happy_list = get_file(which="happy")
return happy_list


class Get_Pair(Resource):
def get(self, id):
make_pairs()
sad_list, happy_list = get_file()
if id in sad_list or id in happy_list:
return "Not Paired Yet", 202
elif any([id in d for d in pairs]):
temp = ""
for pair in pairs:
temp = pair.get(id, "")
if temp != "":
break
return temp, 200
else:
return "Not Found!", 404


class Remove_Pair(Resource):
def get(self, id):
update_pairs(id)
return "Updated!", 200


class Remove_sad(Resource):
def get(self, id):
sad_list, happy_list = get_file()
sad_list.remove(id)
update_data(sad_list, happy_list)

return f"Removed {id}", 200


class Remove_happy(Resource):
def get(self, id):
sad_list, happy_list = get_file()
happy_list.remove(id)
update_data(sad_list, happy_list)

return f"Removed {id}", 200


api.add_resource(Home, '/')
api.add_resource(Depressed_Get, '/sad')
api.add_resource(Depressed_Put, '/sad/<id>')
api.add_resource(Happy_Get, '/happy')
api.add_resource(Happy_Put, '/happy/<id>')
api.add_resource(Get_Pair, '/pair/<id>')
api.add_resource(Remove_Pair, '/remove/<id>')
api.add_resource(Remove_sad, '/sad/remove/<id>')
api.add_resource(Remove_happy, '/happy/remove/<id>')

# driver function
if __name__ == '__main__':
app.run(host="0.0.0.0", port=6969)

0 comments on commit aabb062

Please sign in to comment.