# Project export: Letmetalktoahuman AI

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: Our project's voice agent interacts with redundant customer service bots, quickly navigating through automated systems to connect users with real human agents through call forwarding.
- Devpost: https://devpost.com/software/letmetalktohuman-ai
- GitHub: https://github.com/ConnectAI-CalHacks/ConnectAI
- Demo: https://letmeetalktoahuman.netlify.app/
- Result: winner (Vapi: Show us your Voice AI)
- Team: 4 GitHub contributor(s) — Adithya Gundlapalli (17 commits), Rushaan Chawla (15 commits), Anirudh (9 commits), Abby Kaur (6 commits)

## Devpost submission (written by the team)

### Inspiration

We often encountered challenges navigating automated call systems, which left us spending excessive time on hold and feeling frustrated. These experiences made us realize how much valuable time was being wasted when we could have been focusing on more productive tasks and we were left angry and wondering if there was a better way to optimize telecommunication systems. This frustration inspired us to develop a solution that streamlines the process, minimizing wait times and improving the overall customer experience.

### What it does

The system includes a form where clients can enter their name, phone number, and a brief description of their issue, such as requesting a refund or returning an item. Once submitted, the VAPI system automatically places a call to the provided number. A virtual assistant then guides the client through a series of questions to better understand their problem with the VAPI system answering the questions based off the description given. The VAPI setup even handles the wait time on the client's behalf, ensuring they’re connected directly to the appropriate support agent without unnecessary delays.

### How we built it

We implemented the solution using React.js for the front-end interface and VAPI for handling the automated calls. The form submission triggers the VAPI system, which initiates and manages the call flow. For version control and collaboration, we hosted the project on a GitHub repository, utilizing GitHub Actions for continuous integration and automated testing to ensure a smooth deployment process. We used llama within Groq as the LLM as we saw significant difference in response time when using groq vs openai. This setup allowed us to efficiently manage code updates and track changes while leveraging VAPI’s capabilities to handle real-time interactions with clients.

### Challenges we ran into

We encountered challenges managing different branches, as the primary branch frequently stalled during the process.

### Accomplishments we're proud of

We were able to integrate the front end with the VAPI connector after clicking the submit button which took time, but we were persistent in solving the problem.

### What we learned

We explored various functionalities within the React ecosystem, gaining a deeper understanding of tools and techniques available to enhance our applications. For instance, we learned about the @media query, which allows us to create responsive designs by applying different styles based on screen size and device characteristics. Additionally, we became proficient in utilizing VAPI to manage automated calls, including how to implement its features for efficient interaction with clients. This knowledge has equipped us to build more dynamic and user-friendly applications.

### What's next

for Letmetalktohuman AI We aim to implement a feature that recognizes and performs specific dial tones, as these are a common part of phone interactions. This feature will enhance the user experience by allowing the system to respond to different inputs appropriately.

## README (from the GitHub repository)

# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)


## Detected evidence (automated analysis)

Indexed codebase: 22 recognized source files, 39 KB.
- CSS (language) — detected in the code
- HTML (language) — detected in the code
- JavaScript (language) — detected in the code
- React (technology) — detected in the code
- Node.js (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (28 of 28)

```
.babelrc
.eslintrc.json
.gitignore
letmetalktohuman/src/views/application/Application.jsx
package.json
public/index.html
public/manifest.json
public/robots.txt
README.md
src/App.css
src/App.js
src/App.test.js
src/components/edge.js
src/index.css
src/index.js
src/reportWebVitals.js
src/setupTests.js
src/views/application/Application copy.jsx
src/views/application/Application.jsx
src/views/application/AppStyles.css
src/views/application/ErrorAlert.css
src/views/application/ErrorAlert.js
src/views/landing-page/LandingPage.jsx
src/views/landing-page/overview/Overview.jsx
src/views/landing-page/overview/OverviewStyles.css
src/views/landing-page/PageStyles.css
src/views/navbar/Navbar.css
src/views/navbar/NavBar.jsx
```

### Dependencies

- package.json: @babel/plugin-proposal-private-property-in-object@^7.21.11, @emotion/react@^11.13.3, @emotion/styled@^11.13.0, @react-three/drei@^9.114.5, @react-three/fiber@^8.17.10, @testing-library/jest-dom@^5.17.0, @testing-library/react@^13.4.0, @testing-library/user-event@^13.5.0, eslint@^8.57.1, eslint-plugin-import@^2.31.0, eslint-plugin-jsx-a11y@^6.10.0, eslint-plugin-react@^7.37.1, react@^18.3.1, react-dom@^18.3.1, react-router-dom@^6.27.0, react-scripts@5.0.1, react-tsparticles@^2.12.2, react-typed@^2.0.12, tsparticles@^3.5.0, web-vitals@^2.1.4

### Recent commits (newest first)

- Created build environment.
- Changed some styling!
- Random changes.
- Merge pull request #6 from ConnectAI-CalHacks/functionality
- Added improvements to UI and functionality.
- Merge branch 'main' of https://github.com/ConnectAI-CalHacks/ConnectAI
- I added the code needed to connect the learn more button to the app view
- Moving dir
- with build
- with build
- Merge branch 'main' of https://github.com/ConnectAI-CalHacks/ConnectAI
- updated prompt
- Updated Prompt
- Fine tuning prompt
- Small change added.
- Merge pull request #5 from ConnectAI-CalHacks/frontend-fixes
- Added styling and responsiveness.
- Merge branch 'main' into Anirudh'sLandingPage
- added nav bar
- Hello trial:

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

### package.json

```
{
  "name": "letmetalktohuman",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@emotion/react": "^11.13.3",
    "@emotion/styled": "^11.13.0",
    "@react-three/drei": "^9.114.5",
    "@react-three/fiber": "^8.17.10",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-router-dom": "^6.27.0",
    "react-scripts": "5.0.1",
    "react-tsparticles": "^2.12.2",
    "react-typed": "^2.0.12",
    "tsparticles": "^3.5.0",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "proxy": "https://api.vapi.ai",
  "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-proposal-private-property-in-object": "^7.21.11",
    "eslint": "^8.57.1",
    "eslint-plugin-import": "^2.31.0",
    "eslint-plugin-jsx-a11y": "^6.10.0",
    "eslint-plugin-react": "^7.37.1"
  }
}

```

### src/App.js

```javascript
import "./App.css";

import React from "react";
import NavBar from "./views/navbar/NavBar";
import LandingPage from "./views/landing-page/LandingPage";
import "./App.css";

function App() {
  return (
    <div className="app-container">
      <NavBar />
      <LandingPage />
    </div>
  );
}

export default App;

```

### src/index.js

```javascript

import ReactDOM from 'react-dom/client';
import './index.css';
import reportWebVitals from './reportWebVitals';
import React from "react";
import "./index.css";
import App from "./App";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import Application from "./views/application/Application";

const router = createBrowserRouter([
  {
    path: "/",
    element: <App />,
  },
  {
    path: "app",
    element: <Application />,
  },
]);

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
  <React.StrictMode>
    <RouterProvider router={router} />
  </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/setupTests.js

```javascript
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';

```

### src/App.test.js

```javascript
import { render, screen } from '@testing-library/react';
import App from './App';

test('renders learn react link', () => {
  render(<App />);
  const linkElement = screen.getByText(/learn react/i);
  expect(linkElement).toBeInTheDocument();
});

```

### src/reportWebVitals.js

```javascript
const reportWebVitals = onPerfEntry => {
  if (onPerfEntry && onPerfEntry instanceof Function) {
    import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
      getCLS(onPerfEntry);
      getFID(onPerfEntry);
      getFCP(onPerfEntry);
      getLCP(onPerfEntry);
      getTTFB(onPerfEntry);
    });
  }
};

export default reportWebVitals;

```

### public/index.html

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="theme-color" content="#000000" />
    <meta
      name="description"
      content="Web site created using create-react-app"
    />
    <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
    <!--
      manifest.json provides metadata used when your web app is installed on a
      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
    -->
    <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
    <!--
      Notice the use of %PUBLIC_URL% in the tags above.
      It will be replaced with the URL of the `public` folder during the build.
      Only files inside the `public` folder can be referenced from the HTML.

      Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
      work correctly both with client-side routing and a non-root public URL.
      Learn how to configure a non-root public URL by running `npm run build`.
    -->
    <title>React App</title>
  </head>
  <body>
    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root"></div>
    <!--
      This HTML file is a template.
      If you open it directly in the browser, you will see an empty page.

      You can add webfonts, meta tags, or analytics to this file.
      The build step will place the bundled scripts into the <body> tag.

      To begin the development, run `npm start` or `yarn start`.
      To create a production bundle, use `npm run build` or `yarn build`.
    -->
  </body>
</html>

```

### src/views/application/ErrorAlert.js

```javascript
import React from 'react';
import './ErrorAlert.css'; // Create a CSS file for styling

const ErrorAlert = ({ message, onClose }) => {
  return (
    <div className="error-alert">
      <span>{message}</span>
      <button onClick={onClose} className="close-button">X</button>
    </div>
  );
};

export default ErrorAlert;
```

### src/views/application/ErrorAlert.css

```css
/* src/components/ErrorAlert.css */
.error-alert {
    background-color: #f44336; /* Red background */
    color: white; /* White text */
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .close-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
  }
```

### src/views/navbar/NavBar.jsx

```javascript
import React, { useState } from 'react';
import { Link } from "react-router-dom";
import './Navbar.css'; // Import the CSS file

export default function NavBar() {
    const [menuOpen, setMenuOpen] = useState(false);

    const handleMenuClick = () => {
        setMenuOpen(false); // Close the menu when a link is clicked
    };

    const toggleMenu = () => {
        setMenuOpen(!menuOpen); // Toggle menu open state
    };

    return (
        <nav className="navbar">
            <div className="logo">
                Letmetalktoahuman AI
            </div>
            {/* Hamburger menu icon for small screens */}
            <div className="hamburger" onClick={toggleMenu}>
                &#9776;
            </div>
            <ul className={`menu ${menuOpen ? 'open' : ''}`}>
                <li className="menuItem">
                    <Link onClick={handleMenuClick} to="/" className="link">Home</Link>
                </li>
                <li className="menuItem">
                    <Link onClick={handleMenuClick} to="/app" className="link">Application</Link>
                </li>
            </ul>
        </nav>
    );
}

```

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