# Project export: EmergenSync

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 10.0
- Tagline: Modernizing the emergency room by optimizing triage times and patient intake time
- Devpost: https://devpost.com/software/emergensync
- GitHub: https://github.com/shivstaa/EmergenSync
- Team: 4 GitHub contributor(s) — Shubh Khandelwal (16 commits), shivstaa (16 commits), oviozz (11 commits), James Bohan (4 commits)

## Devpost submission (written by the team)

### Inspiration

The emergency room is currently a chaotic and messy process where people are put into the emergency room in what almost seems like random order. We want to streamline the emergency room experience by making a system for both paramedics and hospitals.

### What it does

This system currently has 2 key components: A system and platform for ambulance drivers where they optimize picking up patients and choosing the best hospital depending on availability A system and platform for ambulance drivers where they optimize picking up patients and choosing the best hospital depending on availability A system and platform for hospitals where they can visually see and modify patient rooms and optimize which patients go in. They can access their patients data easily. A system and platform for hospitals where they can visually see and modify patient rooms and optimize which patients go in. They can access their patients data easily.

### How we built it

Using React.js we bulit a web application which allows users to sign up and login to their appropriate platform. Only paramedics and hospitals are the supported types of users. We addiontally used Node.js and AWS lambda as supports for our backend to create server queries. We used Firebase as our database for its realtime read and writing so hospitals don't waste any time because of server queries.

### Challenges we ran into

Due to limitations using local machines, we decided to use parts of AWS for our backend. Designing an optimal system was also difficult because there are many parts to the emergency room.

### Accomplishments we're proud of

Within the time of this hackathon we created a full stack application that we felt was almost impossible to make in that time. We are also proud to start a project which involved a large amount of research and one that is largely scalable.

### What we learned

It was a first time for all of us using real time data (such as rapid queries to patient rooms). It was also a learning experience designing a scalable system and platform.

### What's next

EmergenSync has many plans to expanding its platform including: Mobile Support Implementing advanced optimization algorithms More options for paramedics

## 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: 44 recognized source files, 85 KB.
- CSS (language) — detected in the code
- Firebase (technology) — detected in the code
- HTML (language) — detected in the code
- JavaScript (language) — detected in the code
- React (technology) — detected in the code
- Tailwind CSS (technology) — detected in the code
- AWS (technology) — claimed on Devpost, not found in the code
- Node.js (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (52 of 52)

```
.eslintrc.cjs
.gitignore
.idea/.gitignore
.idea/EmergenSync.iml
.idea/modules.xml
.idea/vcs.xml
package.json
postcss.config.js
public/index.html
public/manifest.json
public/robots.txt
README.md
src/App.css
src/App.jsx
src/App.test.js
src/Components/AuthComp/LoginComp.jsx
src/Components/AuthComp/SignUpComp.jsx
src/Components/AuthComp/UserManager.jsx
src/Components/FireBase/Config.jsx
src/Components/FireBase/SaveToken.jsx
src/Components/HomePage/Home.jsx
src/Components/NavBarComp/AuthNav.jsx
src/Components/NavBarComp/NavBar.jsx
src/Components/NavBarComp/NavBarLayout.jsx
src/Components/ProtectedLayout/ProtectLayout.jsx
src/Components/ProtectedPage/Protected.jsx
src/Components/SideTools/SlidingAlert.css
src/Components/SideTools/SlidingAlert.jsx
src/Components/Tests/TestHospitalManager.jsx
src/Components/UserProfile/HospitalProfile.jsx
src/Components/UserProfile/ParamedicProfile.jsx
src/Components/UserProfile/states_hash.json
src/Components/UserProfile/UserProfile.jsx
src/index.css
src/index.jsx
src/main.jsx
src/Managers/emergencyquestManager.js
src/Managers/getHospitals.js
src/Managers/hospitalComparator.js
src/Managers/hospitalManager.js
src/Managers/paramedicManager.js
src/Managers/patientManager.js
src/Managers/userManager.js
src/Pages/HospitalPage/DashBoard.jsx
src/Pages/HospitalPage/ERDetail.css
src/Pages/HospitalPage/ERDetail.jsx
src/Pages/HospitalPage/RoomDetails.jsx
src/Pages/HospitalPage/Rooms.jsx
src/Pages/ParamedicPage/FindRooms.jsx
src/reportWebVitals.js
src/setupTests.js
tailwind.config.js
```

### Dependencies

- package.json: @emotion/react@^11.11.1, @emotion/styled@^11.11.0, @mui/icons-material@^5.14.15, @mui/joy@^5.0.0-beta.12, @mui/material@^5.14.15, @react-google-maps/api@^2.19.2, @testing-library/jest-dom@^5.17.0, @testing-library/react@^13.4.0, @testing-library/user-event@^13.5.0, @turf/turf@^6.5.0, autoprefixer@^10.4.16, axios@^1.6.0, downshift@^8.2.2, eslint@^8.52.0, eslint-plugin-react@^7.33.2, eslint-plugin-react-hooks@^4.6.0, eslint-plugin-react-refresh@^0.4.3, firebase@^10.5.2, geofire-common@^6.0.0, geofirestore@^5.2.0, net@^1.0.2, ngeohash@^0.6.3, postcss@^8.4.31, prettier@^3.0.3, react@^18.2.0, react-dom@^18.2.0, react-icons@^4.11.0, react-input-mask@^2.0.4, react-places-autocomplete@^7.3.0, react-refresh@^0.11.0, react-router-dom@^6.17.0, react-scripts@5.0.1, react-scroll-trigger@^0.6.14, react-select@^5.7.7, tailwindcss@^3.3.5, turf@^3.0.14, us-state-codes@^1.1.2, web-vitals@^2.1.4, why-is-node-running@^2.2.2

### Recent commits (newest first)

- updated room search
- find rooms changes
- Merge branch 'main' of https://github.com/shivstaa/EmergenSync
- updated find rooms
- removed useless method
- Response object in hospitalComparator contains image
- final commit
- testing
- bugfixes
- added geolocation
- Merge branch 'main' of https://github.com/shivstaa/EmergenSync
- help needed for comparator
- Merge branch 'main' of https://github.com/shivstaa/EmergenSync
- updated changes
- changed type to keyword
- update hospital profile
- Merge branch 'main' of https://github.com/shivstaa/EmergenSync
- added gethospital script
- Paramedic Manager
- new data

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

### package.json

```
{
  "name": "emergensync",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@emotion/react": "^11.11.1",
    "@emotion/styled": "^11.11.0",
    "@mui/icons-material": "^5.14.15",
    "@mui/joy": "^5.0.0-beta.12",
    "@mui/material": "^5.14.15",
    "@react-google-maps/api": "^2.19.2",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "@turf/turf": "^6.5.0",
    "autoprefixer": "^10.4.16",
    "axios": "^1.6.0",
    "downshift": "^8.2.2",
    "eslint-plugin-react-refresh": "^0.4.3",
    "firebase": "^10.5.2",
    "geofire-common": "^6.0.0",
    "geofirestore": "^5.2.0",
    "net": "^1.0.2",
    "ngeohash": "^0.6.3",
    "postcss": "^8.4.31",
    "prettier": "^3.0.3",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-icons": "^4.11.0",
    "react-input-mask": "^2.0.4",
    "react-places-autocomplete": "^7.3.0",
    "react-refresh": "^0.11.0",
    "react-router-dom": "^6.17.0",
    "react-scripts": "5.0.1",
    "react-scroll-trigger": "^0.6.14",
    "react-select": "^5.7.7",
    "tailwindcss": "^3.3.5",
    "turf": "^3.0.14",
    "us-state-codes": "^1.1.2",
    "web-vitals": "^2.1.4",
    "why-is-node-running": "^2.2.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts 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": {
    "eslint": "^8.52.0",
    "eslint-plugin-react": "^7.33.2",
    "eslint-plugin-react-hooks": "^4.6.0"
  }
}

```

### src/main.jsx

```javascript
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.jsx";
import "./index.css";
import { BrowserRouter } from "react-router-dom";

ReactDOM.createRoot(document.getElementById("root")).render(
  <BrowserRouter>
    <App />
  </BrowserRouter>,
);

```

### src/index.jsx

```javascript
import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
import { BrowserRouter } from "react-router-dom";

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
  <BrowserRouter>
    <App />
  </BrowserRouter>,
);

// 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.jsx

```javascript
import "./App.css";
import SignUpComp from "./Components/AuthComp/SignUpComp.jsx";
import {
  createBrowserRouter,
  createRoutesFromElements,
  Route,
  RouterProvider,
  Routes,
} from "react-router-dom";
import LoginComp from "./Components/AuthComp/LoginComp.jsx";
import ProtectLayout from "./Components/ProtectedLayout/ProtectLayout.jsx";
import Home from "./Components/HomePage/Home.jsx";
import Protected from "./Components/ProtectedPage/Protected.jsx";
import NavBarLayout from "./Components/NavBarComp/NavBarLayout.jsx";
import DashBoard from "./Pages/HospitalPage/DashBoard";
import UserProfile from "./Components/UserProfile/UserProfile";
import TestHospitalManager from './Components/Tests/TestHospitalManager';
import FindRoom from "./Pages/ParamedicPage/FindRooms";
function App() {
  return (
    <NavBarLayout>
      <Routes>
        <Route path={"/"} element={<Home />}></Route>
        <Route path={"/test"} element={<TestHospitalManager />}></Route>
        <Route path={"/login"} element={<LoginComp />}></Route>
        <Route path={"/signup"} element={<SignUpComp />}></Route>
        <Route element={<ProtectLayout />}>
          <Route path={"/profile"} element={<UserProfile />} />
          <Route path={"/hospital"} element={<DashBoard />} />
          <Route path={"/find"} element={<FindRoom/>}/>
        </Route>
      </Routes>
    </NavBarLayout>
  );
}

export default App;

```

### postcss.config.js

```javascript
export default {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
};

```

### tailwind.config.js

```javascript
/** @type {import('tailwindcss').Config} */
export default {
  content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
  theme: {
    extend: {
      backgroundColor: {
        night: "#151515",
      },
    },
  },
  plugins: [
    function ({ addUtilities }) {
      const newUtilities = {
        '.caret-transparent': {
          caretColor: 'transparent',
        },
      }
      addUtilities(newUtilities, ['responsive', 'hover', 'focus', 'active']);
    }
  ],
};

```

### src/index.css

```css
@tailwind base;
@tailwind components;
@tailwind utilities;

body {
  font-family: "Plus Jakarta Sans", sans-serif;
}

```

### .idea/vcs.xml

```xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="VcsDirectoryMappings">
    <mapping directory="" vcs="Git" />
  </component>
</project>
```

### 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();
});

```

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