Inspiration

The theme we chose for this hackathon is social impact. The inspiration for this project comes from awareness of one's mental health and how very crucial it is to deal with our stress factors arising in daily life. Nowadays, hardly anyone manages to work, study, exercise, and rest, and because of that, most people have problems with burnout, among others. This project gives users a simple and interactive tool for reflecting on daily habits and understanding how those daily activities affect levels of stress.

This project asks users to input key metrics such as sleep, exercise, study, and work hours in order to provide personalized feedback and actionable advice. The premise is to encourage healthier routines and promote mindfulness about how lifestyle choices affect mental and physical well-being. Including motivational messages, such as "Take things one day at a time," reinforces the idea of self-care and gradual improvement.

What it does

The project asks users to input key metrics, such as sleep, exercise, study, and work hours, in order to offer them personalized feedback and actionable advice. The belief is that it will foster better daily routines and a sense of mindfulness about life choices that impact mental and physical health. Adding motivational messages, such as "Give yourself some lenience and take rest," underscores the principle of self-care and gradual improvement.

How we built it

Frontend (HTML & CSS): The user interface was designed using HTML to create a simple and intuitive form for collecting user input. The form includes fields for users to input their daily hours for sleep, exercise, study, and work, with placeholders and labels to guide them. CSS was used to style the form, ensuring a clean and visually appealing design.

Backend (python): The backend is built using a flask framework to make a simple Flask Application using python. Python code is used to make the backend work, and the python code consists of a series of routes for each functionality and webpage of the website. For example the /predict route consists of code that uses the Linear Regressive AI model to predict the stress level of the user and pass that into the webpage. The /register and /login routes will properly ensure the login and register system of the account works.

Challenges we ran into

  • Login and Registration System: Implementing a secure and user-friendly login and registration system was a significant challenge. Ensuring proper validation of user inputs, securely storing passwords using hashing, and managing user sessions required careful attention to detail.

  • Dashboard Design and Functionality: Creating an interactive and informative dashboard to display personalized feedback was another challenge. We needed to ensure that the feedback was clear, actionable, and visually appealing. Integrating dynamic data from the backend into the dashboard required efficient use of Flask's templating engine (Jinja2) and proper data handling.

  • Optimal Bar Calculation: Designing the logic for the "optimal bar" (which evaluates the balance of sleep, exercise, study, and work hours) was complex. We had to define what constitutes "optimal" for each activity and create formulas to calculate percentages or scores. Balancing the feedback to ensure it was neither too lenient nor too strict was a challenge, as we wanted the advice to be realistic and encouraging.

Accomplishments that we're proud of

  • Accurate Stress Level Calculator: We successfully implemented a linear regression model to calculate stress levels based on user inputs (sleep, exercise, study, and work hours). The model was trained to analyze the relationship between these activities and their impact on stress, providing users with accurate and meaningful feedback.

  • Optimal Bar: We designed a visually appealing optimal bar that dynamically displays how balanced the user's daily habits are. The bar helps users quickly understand whether their activities are within the recommended ranges, encouraging them to make adjustments for better stress management.

  • Helpful Dashboard: We created a dashboard that provides users with insights into their stress levels over time. The dashboard displays the last 7 stress calculations, allowing users to track their progress and identify patterns in their habits. This feature helps users stay motivated and make informed decisions about their routines.

  • User Account System: We implemented a secure user account system that allows users to register and log in. This system ensures that each user's data is private and accessible only to them, enhancing the overall user experience and security of the application.

These accomplishments make the "Stress Scale" project a comprehensive and user-friendly tool for stress management. By combining machine learning, data visualization, and user account functionality, we created an application that is both practical and engaging for users.

What we learned

  • Frontend Development: We gained experience in designing user-friendly interfaces using HTML and CSS. We learned how to structure forms effectively to collect user input and ensure clarity with proper labels, placeholders, and styling.

  • Backend Development: We deepened our understanding of Flask, including routing, handling form submissions, and processing user data. We learned how to integrate backend logic with frontend templates using Jinja2 to create dynamic and interactive web pages.

  • Machine Learning Integration: We learned how to use a linear regression model to analyze user data and provide meaningful predictions, such as stress levels based on daily habits. We explored how to integrate machine learning models into a web application, ensuring smooth communication between the model and the user interface.

  • Data Validation: We learned the importance of validating user input both on the frontend and backend to ensure data accuracy and prevent errors (e.g., ensuring hours are within a valid range).

  • Dashboard Design: We gained experience in creating a dashboard to display historical data (e.g., the last 7 stress calculations). This taught us how to present data in a way that is both informative and visually appealing.

  • User Authentication: We learned how to implement a user account system, including registration, login, and session management, to ensure secure and personalized user experiences.

  • Balancing Feedback: We learned how to design feedback that is both actionable and encouraging, ensuring users feel motivated to improve their habits without feeling overwhelmed.

  • Collaboration and Problem-Solving: Throughout the project, we faced challenges like implementing the optimal bar, designing the dashboard, and ensuring accurate calculations. These challenges taught us how to collaborate effectively, debug issues, and find creative solutions.

  • Deployment and Testing: We learned how to deploy a web application on platforms like Heroku or Render and ensure compatibility across different devices and browsers. Testing the application thoroughly helped us understand the importance of user experience and reliability

What's next for Stress Scale

Looking ahead, we see opportunities to expand Stress Meter into a more powerful mental wellness companion. Future improvements could include AI-generated personalized advice, weekly summaries, interactive graphs, mood tracking, notifications, and a dedicated mobile app. Our long-term vision is a tool that not only tracks stress but also supports users in building healthier habits over time.

Share this project:

Updates