# Project export: DayTalks

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: Cal Hacks 11.0
- Tagline: Wellness: Anytime, Anywhere
- Devpost: https://devpost.com/software/daytalks
- GitHub: https://github.com/lizatinku/calhacks-24.git
- Team: 4 GitHub contributor(s) — Tian Hong Zhu Zhou (26 commits), Liza Tinku Jose (10 commits), Suhani Shokeen (7 commits), HawkingRadiation42 (4 commits)

## Devpost submission (written by the team)

### Inspiration

Our inspiration comes from the challenges faced by international students, who often struggle with poor mental health while being far from home. The emotional toll of adapting to a new environment, compounded by time zone differences and lack of real-time support, can leave students feeling isolated. DayTalks aims to bridge that gap by providing a supportive, AI-driven platform where users can express their emotions, track their mental health, and feel connected no matter the distance.

### What it does

DayTalks is an AI-powered mental health app that allows users to log their emotions through voice recordings, track their moods over time, and receive personalized emotional insights, helping them stay connected and supported wherever they are.

### How we built it

We developed the frontend using React.js and Tailwind CSS to create a dynamic, responsive, and user-friendly interface. The backend is powered by FastAPI, ensuring efficient and scalable communication. For emotional analysis, we integrated HumeAI to deliver real-time emotional intelligence. MongoDB manages user authentication and secure data storage. We incorporated Groq and Llama 3.1 to provide personalized feedback and insights, further enhancing user engagement. Additionally, Deepgram was used for accurate and seamless speech recognition, allowing users to easily log their emotions through voice.

### Challenges we ran into

Creating a welcoming UI: Designing a mental health app that feels personalized and comforting while maintaining simplicity and usability. Implementing JWT tokens: Learning how to securely manage user authentication using JWT for a scalable, secure login system. Fetching user history: Ensuring efficient retrieval and display of personalized data was key to user experience. Optimizing backend efficiency: Ensuring smooth communication between the frontend and backend, especially with real-time interactions.

### Accomplishments we're proud of

Building a full stack + AI-powered application in just 36 hours. Seamless teamwork and communication, even when faced with technical challenges. Creating a personalized and welcoming user interface, thoughtfully designed for mental health support.

### What we learned

Early ideation is key: By brainstorming and planning before the hackathon, we were able to hit the ground running and start building immediately. The importance of UI prototyping: We realized the value of laying out the UI in tools like Figma, as it allows frontend developers to begin implementation faster and stay aligned with the design vision. Setting clear checkpoints: Establishing checkpoints throughout the hackathon helped us stay on track and ensure progress, making sure that we delivered a solid MVP on time.

### What's next

Premium Subscription: Mood tracking synced with iCal. VeronicaAI talks back in conversations. Customizable AI voice for a personal touch. Collaboration: Smartwatch integration for on-the-go tracking. Partnerships with fitness centers and wellness industries. Corporate investment for employee wellness programs.

## README (from the GitHub repository)

# CalHacks 2024 Project: DayTalks
DayTalks is a mental health-focused web application designed to help users track and reflect on their emotional well-being. At the heart of DayTalks is its AI-powered friend, Veronica, who listens to users through voice recordings, analyzes the emotions conveyed, and provides personalized emotional insights. By leveraging cutting-edge AI and emotional analysis tools like HumeAI, the app creates a supportive environment where users can express themselves freely and receive meaningful feedback. By offering real-time feedback, DayTalks empowers users to understand their emotions better and take proactive steps to enhance their well-being.

## Tech Stack:
- Frontend: React.js, Tailwind CSS
- Backend: FastAPI
- Database & Authentication: MongoDB, JWT
- Speech Recognition: Deepgram
- Emotional Analysis: HumeAI
- AI Feedback: Groq

## Installation
To get a local copy up and running, follow these steps:
1. Install Node.js and npm on your computer.
2. Clone the Repository:
```bash
git clone https://github.com/your-username/calhacks-24.git
```
3. Navigate into the project directory and then the frontend folder:
```bash
cd calhacks-24
cd frontend
```
4. Install Frontend Dependencies
```bash
npm install
```
5. Navigate back to the root project folder and into the backend folder:
```bash
cd ../backend
```
6. If using FastAPI with Python, install backend dependencies (e.g., using pip)
```bash
pip install -r requirements.txt
```
7. Install backend dependencies
```bash
npm start
```

## Usage
- Open the app in your browser at http://localhost:3000.
- Sign in or create an account.
- Use the mood calendar to log your emotions or interact with the AI friend to receive personalized insights.

## Features
- **AI Friend Veronica**: Interact with an AI-powered friend for personalized emotional insights.
- **Mood Calendar**: Log and visualize your moods on a calendar interface.
- **Emotional Insights**: Receive real-time emotional analysis and feedback using HumeAI.
- **User Login**: Secure authentication with JWT ensures users' mood logs and emotional insights are saved and accessible across sessions.

## Contributors
- **Alex Zhu Zhou** [GitHub](https://github.com/alexzhuzhou)
- **Shrey Khandelwal** [GitHub](https://github.com/HawkingRadiation42)
- **Suhani Shokeen** [GitHub](https://github.com/suhanishokeen)
- **Liza Tinku Jose** [GitHub](https://github.com/lizatinku)

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.


## Detected evidence (automated analysis)

Indexed codebase: 75 recognized source files, 200 KB.
- CSS (language) — detected in the code
- FastAPI (technology) — detected in the code
- Flask (technology) — detected in the code
- HTML (language) — detected in the code
- JavaScript (language) — detected in the code
- Python (language) — detected in the code
- React (technology) — detected in the code
- Tailwind CSS (technology) — detected in the code
- MongoDB (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (94 of 94)

```
.DS_Store
.gitignore
.idea/workspace.xml
backend/.gitignore
backend/deepGramOutput/app.py
backend/deepGramOutput/ReproduceWav.py
backend/deepGramOutput/SpeechToText.py
backend/deepGramOutput/SpeechToTextLive.py
backend/deepGramOutput/TextToSpeech.py
backend/requirements.txt
emotionTrack_server/.DS_Store
emotionTrack_server/.env
emotionTrack_server/.gitignore
emotionTrack_server/deepgram-server.py
emotionTrack_server/groq-server.py
emotionTrack_server/groq-test.py
emotionTrack_server/hume-audio.py
emotionTrack_server/hume-github.py
emotionTrack_server/hume-server-websocket.py
emotionTrack_server/hume-server.py
emotionTrack_server/hume-text.py
emotionTrack_server/main copy.py
emotionTrack_server/main.py
emotionTrack_server/requirements.txt
emotionTrack_server/schema.py
emotionTrack_server/tokens.py
frontend/.gitignore
frontend/package.json
frontend/public/index.html
frontend/public/manifest.json
frontend/public/robots.txt
frontend/src/App.css
frontend/src/App.js
frontend/src/App.test.js
frontend/src/components/Calendar.js
frontend/src/components/Dashboard.js
frontend/src/components/Header.js
frontend/src/components/Logout.js
frontend/src/components/MoodCalendar.js
frontend/src/components/MoodOverview.js
frontend/src/components/ProtectedRoute.js
frontend/src/components/ReferralTrackingCard.js
frontend/src/components/WelcomeRecordCard.js
frontend/src/index.css
frontend/src/index.js
frontend/src/pages/about.js
frontend/src/pages/AIFriend.js
frontend/src/pages/HomePage.js
frontend/src/pages/LoginForm.js
frontend/src/pages/LoginRegistrationPage.js
frontend/src/pages/MoodCalendarPage.js
frontend/src/pages/Profile.js
frontend/src/pages/RegistrationForm.js
frontend/src/pages/Tables.js
frontend/src/reportWebVitals.js
frontend/src/setupTests.js
frontend/src/styles/Referrals.css
frontend/src/styles/styles.css
frontend/tailwind.config.js
LICENSE
package.json
public/index.html
public/manifest.json
public/robots.txt
README.md
src/.DS_Store
src/.gitignore
src/App.css
src/App.js
src/App.test.js
src/components/Dashboard.js
src/components/Header.js
src/components/MoodCalendar.js
src/components/MoodOverview.js
src/components/ReferralTrackingCard.js
src/components/WelcomeRecordCard.js
src/deepGrammIntegration.py
src/index.css
src/index.js
src/pages/about.js
src/pages/AIFriend.js
src/pages/HomePage.js
src/pages/LoginForm.js
src/pages/LoginRegistrationPage.js
src/pages/Logout.js
src/pages/MoodCalendarPage.js
src/pages/Profile.js
src/pages/RegistrationForm.js
src/pages/Tables.js
src/reportWebVitals.js
src/requirements.txt
src/setupTests.js
src/styles/styles.css
tailwind.config.js
```

### Dependencies

- backend/requirements.txt: deepgram-sdk@==v3.7.3, Flask@~=2.2.5, Flask-SocketIO@==5.3.6, httpx@~=0.25.2, python-dotenv@==1.0.0
- emotionTrack_server/requirements.txt: aiofiles@==24.1.0, annotated-types@==0.7.0, anyio@==4.6.2.post1, bcrypt@==4.2.0, certifi@==2024.8.30, cffi@==1.17.1, charset-normalizer@==3.4.0, click@==8.1.7, cryptography@==43.0.3, dnspython@==2.7.0, ecdsa@==0.19.0, eval_type_backport@==0.2.0, fastapi@==0.115.2, h11@==0.14.0, httpcore@==1.0.6, httpx@==0.27.2, hume@==0.7.2, idna@==3.10, motor@==3.6.0, passlib@==1.7.4, pyasn1@==0.6.1, pycparser@==2.22, pydantic@==2.9.2, pydantic_core@==2.23.4, pydub@==0.25.1, pymongo@==4.9.2, python-dotenv@==1.0.1, python-jose@==3.3.0, python-multipart@==0.0.12, requests@==2.32.3, rsa@==4.9, simpleaudio@==1.0.4, six@==1.16.0, sniffio@==1.3.1, sounddevice@==0.4.7, starlette@==0.40.0, typing_extensions@==4.12.2, urllib3@==2.2.3, uvicorn@==0.32.0, websockets@==12.0
- frontend/package.json: @babel/plugin-transform-class-properties@^7.25.7, @babel/plugin-transform-nullish-coalescing-operator@^7.25.8, @babel/plugin-transform-numeric-separator@^7.25.8, @babel/plugin-transform-optional-chaining@^7.25.8, @babel/plugin-transform-private-methods@^7.25.7, @ffmpeg/ffmpeg@^0.12.10, @svgr/webpack@^8.1.0, @testing-library/jest-dom@^5.17.0, @testing-library/react@^13.4.0, @testing-library/user-event@^13.5.0, axios@^1.7.7, chart.js@^4.4.5, d3-scale@^4.0.2, frontend@file:, glob@^11.0.0, react@^18.3.1, react-calendar@^5.0.0, react-circular-progressbar@^2.1.0, react-dom@^18.3.1, react-icons@^5.3.0, react-router-dom@^6.27.0, react-scripts@^5.0.1, record@^0.2.0, recorder-js@^1.0.7, rimraf@^6.0.1, svgo@^3.3.2, tailwindcss@^3.4.14, web-vitals@^2.1.4
- package.json: @babel/plugin-transform-class-properties@^7.25.7, @babel/plugin-transform-nullish-coalescing-operator@^7.25.8, @babel/plugin-transform-numeric-separator@^7.25.8, @babel/plugin-transform-optional-chaining@^7.25.8, @babel/plugin-transform-private-methods@^7.25.7, @ffmpeg/ffmpeg@^0.12.10, @svgr/webpack@^8.1.0, @testing-library/jest-dom@^5.17.0, @testing-library/react@^13.4.0, @testing-library/user-event@^13.5.0, axios@^1.7.7, chart.js@^4.4.5, d3-scale@^4.0.2, frontend@file:, glob@^11.0.0, react@^18.3.1, react-calendar@^5.0.0, react-circular-progressbar@^2.1.0, react-dom@^18.3.1, react-icons@^5.3.0, react-router-dom@^6.27.0, react-scripts@^5.0.1, recorder-js@^1.0.7, rimraf@^6.0.1, svgo@^3.3.2, tailwindcss@^3.4.14, web-vitals@^2.1.4
- src/requirements.txt: deepgram-sdk@==3.7.4, janus@==1.0.0, PyAudio@==0.2.11, python-dotenv@==0.21.0, websockets@==12.0

### Recent commits (newest first)

- Delete frontend/README.md
- Update README.md
- Update README.md
- final changes implementing frontend
- Merge remote-tracking branch 'origin/aichatbot' into alex_authentication
- Finished Log
- updated working code with ai talking
- implemented auth but not fully work
- suhani updated try 101
- Merge remote-tracking branch 'origin/backend_hume' into alex_authentication
- Registration Form
- updated code
- Merge branch 'suhani_Frontend2'
- frontend implementations
- AIFriend
- login pt1
- changes
- Merge branch 'liza_new' into alex_frontend
- improved UI/UX
- Final features

## Key source files (fetched from GitHub, selected and truncated for size)

### package.json

```
{
  "name": "frontend",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@ffmpeg/ffmpeg": "^0.12.10",
    "@svgr/webpack": "^8.1.0",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "axios": "^1.7.7",
    "chart.js": "^4.4.5",
    "d3-scale": "^4.0.2",
    "frontend": "file:",
    "react": "^18.3.1",
    "react-calendar": "^5.0.0",
    "react-circular-progressbar": "^2.1.0",
    "react-dom": "^18.3.1",
    "react-icons": "^5.3.0",
    "react-scripts": "^5.0.1",
    "recorder-js": "^1.0.7",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts --openssl-legacy-provider start",
    "build": "react-scripts --openssl-legacy-provider build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@babel/plugin-transform-class-properties": "^7.25.7",
    "@babel/plugin-transform-nullish-coalescing-operator": "^7.25.8",
    "@babel/plugin-transform-numeric-separator": "^7.25.8",
    "@babel/plugin-transform-optional-chaining": "^7.25.8",
    "@babel/plugin-transform-private-methods": "^7.25.7",
    "glob": "^11.0.0",
    "react-router-dom": "^6.27.0",
    "rimraf": "^6.0.1",
    "svgo": "^3.3.2",
    "tailwindcss": "^3.4.14"
  }
}

```

### src/requirements.txt

```
PyAudio==0.2.11
websockets==12.0
janus==1.0.0
deepgram-sdk==3.7.4
python-dotenv==0.21.0
```

### backend/requirements.txt

```
deepgram-sdk==v3.7.3
Flask~=2.2.5
Flask-SocketIO==5.3.6
python-dotenv==1.0.0

httpx~=0.25.2
```

### emotionTrack_server/requirements.txt

```
aiofiles==24.1.0
annotated-types==0.7.0
anyio==4.6.2.post1
bcrypt==4.2.0
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.4.0
click==8.1.7
cryptography==43.0.3
dnspython==2.7.0
ecdsa==0.19.0
eval_type_backport==0.2.0
fastapi==0.115.2
h11==0.14.0
httpcore==1.0.6
httpx==0.27.2
hume==0.7.2
idna==3.10
motor==3.6.0
passlib==1.7.4
pyasn1==0.6.1
pycparser==2.22
pydantic==2.9.2
pydantic_core==2.23.4
pydub==0.25.1
pymongo==4.9.2
python-dotenv==1.0.1
python-jose==3.3.0
python-multipart==0.0.12
requests==2.32.3
rsa==4.9
simpleaudio==1.0.4
six==1.16.0
sniffio==1.3.1
sounddevice==0.4.7
starlette==0.40.0
typing_extensions==4.12.2
urllib3==2.2.3
uvicorn==0.32.0
websockets==12.0

```

### frontend/package.json

```
{
  "name": "frontend",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@ffmpeg/ffmpeg": "^0.12.10",
    "@svgr/webpack": "^8.1.0",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "axios": "^1.7.7",
    "chart.js": "^4.4.5",
    "d3-scale": "^4.0.2",
    "frontend": "file:",
    "react": "^18.3.1",
    "react-calendar": "^5.0.0",
    "react-circular-progressbar": "^2.1.0",
    "react-dom": "^18.3.1",
    "react-icons": "^5.3.0",
    "react-scripts": "^5.0.1",
    "record": "^0.2.0",
    "recorder-js": "^1.0.7",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts --openssl-legacy-provider start",
    "build": "react-scripts --openssl-legacy-provider build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@babel/plugin-transform-class-properties": "^7.25.7",
    "@babel/plugin-transform-nullish-coalescing-operator": "^7.25.8",
    "@babel/plugin-transform-numeric-separator": "^7.25.8",
    "@babel/plugin-transform-optional-chaining": "^7.25.8",
    "@babel/plugin-transform-private-methods": "^7.25.7",
    "glob": "^11.0.0",
    "react-router-dom": "^6.27.0",
    "rimraf": "^6.0.1",
    "svgo": "^3.3.2",
    "tailwindcss": "^3.4.14"
  }
}

```

### src/index.js

```javascript
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();


```

### src/App.js

```javascript
import React from 'react';
import './styles/styles.css'; 
import { BrowserRouter, Routes, Route } from "react-router-dom";
import MoodCalendarPage from './pages/MoodCalendarPage';
import HomePage from './pages/HomePage';
import AIFriendPage from './pages/AIFriend';
import Tables from './pages/Tables';
import Profile from './pages/Profile';
import Logout from './pages/Logout';
import LoginRegistrationPage from './pages/LoginRegistrationPage';

const App = () => {
  return (
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<LoginRegistrationPage />} />
        <Route path="/home" element={<HomePage />} />
        <Route path="/MoodCalendarPage" element={<MoodCalendarPage />} />
        <Route path="/AIFriend" element={<AIFriendPage />} />
        <Route path="/Tables" element={<Tables />} />
        <Route path="/Profile" element={<Profile />} />
        <Route path="/Logout" element={<Logout />} />
      </Routes>
    </BrowserRouter>
  );
};

export default App;

```

### backend/deepGramOutput/app.py

```python
import logging

from dotenv import load_dotenv
from flask import Flask, render_template

load_dotenv()

app = Flask("app_http")


@app.route('/')
def index():
    return render_template('index.html')


if __name__ == '__main__':
    logging.info("Starting Flask server.")
    # Run flask app
    app.run(debug=True, port=8000)

```

### frontend/src/index.js

```javascript
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();


```

### frontend/src/App.js

```javascript
import React from 'react';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import HomePage from './pages/HomePage';
import MoodCalendarPage from './pages/MoodCalendarPage';
import AIFriendPage from './pages/AIFriend';
import Tables from './pages/Tables';
import Profile from './pages/Profile';
import Logout from './components/Logout';
import LoginRegistrationPage from './pages/LoginRegistrationPage';
import RegistrationForm from './pages/RegistrationForm';
import ProtectedRoute from './components/ProtectedRoute'; // Import ProtectedRoute

const App = () => {
  return (
    <BrowserRouter>
      <Routes>
        {/* Public Routes */}
        <Route path="/" element={<LoginRegistrationPage />} />
        <Route path="/register" element={<RegistrationForm />} />

        {/* Protected Routes */}
        <Route 
          path="/home" 
          element={
            <ProtectedRoute>
              <HomePage />
            </ProtectedRoute>
          } 
        />
        <Route 
          path="/moodcalendar" 
          element={
            <ProtectedRoute>
              <MoodCalendarPage />
            </ProtectedRoute>
          } 
        />
        <Route 
          path="/aifriend" 
          element={
            <ProtectedRoute>
              <AIFriendPage />
            </ProtectedRoute>
          } 
        />
        <Route 
          path="/tables" 
          element={
            <ProtectedRoute>
              <Tables />
            </ProtectedRoute>
          } 
        />
        <Route 
          path="/profile" 
          element={
            <ProtectedRoute>
              <Profile />
            </ProtectedRoute>
          } 
        />
        <Route path="/logout" element={<Logout />} />
        

      </Routes>
    </BrowserRouter>
  );
};

export default App;

```

[67 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]