# Project export: Aegis

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: TreeHacks 2025
- Tagline: Your body's first responder—military medicine on the edge.
- Devpost: https://devpost.com/software/aegis-kz4qnm
- GitHub: https://github.com/SpotDylan/TreeHacks-2025-Fullstack
- Demo: https://tree-hacks-2025-aegis.vercel.app/
- Video: https://www.youtube.com/embed/0U47LBWzAhU?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 1 GitHub contributor(s) — SpotDylan (27 commits)

## Devpost submission (written by the team)

### Inspiration

In a world where every second counts, especially in modern combat scenarios and emergency response situations, the golden hour—the critical period following a traumatic injury—often determines survival. According to a study of U.S. military casualties in Afghanistan and Iraq, 87.3% of all injury mortality occurred before reaching a Medical Treatment Facility, with 24.3% of these deaths being potentially survivable. Aegis was born from this realization—in high-stakes environments where every second counts, immediate medical intervention can mean the difference between life and death. While medics and combat lifesavers provide invaluable care, they can't be everywhere at once. We envisioned a future where every soldier and first responder carries their own automated guardian—a system smart enough to begin life-saving interventions in those crucial first moments.

### What it does

Aegis is a wearable device that combines biometrics with computer vision to assess trauma and deliver accurate, life-saving medicine. Using an Apple Watch for vital sign monitoring and a camera system for wound analysis, Aegis is able to make informed decisions about medical interventions. Our current prototype features a dual-reservoir system with peristaltic pumps—one that would contain a hemostatic agent for bleeding control and the other with pain medication (such as Morphine). In most cases, users of Aegis would be in areas without an active network connection, which encouraged us to pursue an edge-based solution with the capability to process complex medical data efficiently. What further sets Aegis apart is its centralization through a command and control center, allowing unit leaders to monitor their team's medical status and location in real-time through a detailed UI and natural language queries like "Who is most injured and where are they?"

### How we built it

We’ve deployed a biometric processor using an Apple Watch and Terra API in combination with a Vision Language Model—VILA—directly on the Jetson Orin Nano, leveraging edge computing for real-time wound classification without cloud dependency. To reduce redundancy, we created a flask server to keep both models persistently loaded, enabling efficient, low-latency processing while maintaining accuracy in medical image analysis. Our edge model inputs complex biometric and visual data and outputs a medicinal dosage, which is then passed onto a prototyped delivery system that we've built out using two peristaltic pumps, a motor controller, and an Arduino for precise fluid control. Relevant data, including the dosage amount,

### Challenges we ran into

Running a sophisticated Vision Language Model on edge devices proved particularly challenging—we had to balance model performance with the Jetson's limited RAM. Initially, we faced significant latency issues as we were reloading model weights with each inference, which we eventually figured out and optimized. Hardware integration presented its own set of challenges. As software developers, this was our first time working with circuits, jumper wires, and physical components. We even had a Jetson Nano fry during development, forcing us to get a replacement and swap SSDs. The integration between WatchOS's HealthKit and Terra Streaming API proved more complex than anticipated, limiting our access to certain biometric data. Working with Swift, which was new to our team, had a bit of a learning curve as well, leading us to develop a lightweight iOS app focused solely on data transmission.

### Accomplishments we're proud of

We are incredibly proud to have successfully worked with components we had never touched in the past. To be able to build a hardware prototype and successfully merge biometric sensors, vision technology, and edge AI into one cohesive system was not easy, and we're glad we took on the challenge. We also came up with the idea the day the hackathon started, so we had to order hardware components that would only come in the next day. Being able to successfully build something under such time pressure surpassed any of our expectations!

### What we learned

Throughout this project, we learned that combining hardware, software, and people's lives is a very delicate balance, and one that is both extremely important and also requires a lot of care and thought. Also, learning to balance performance with power and size limitations on platforms like the Jetson Nano was quite important—compute and energy are not unlimited.

### What's next

We envision Aegis revolutionizing care for millions of first responders across the globe, who put their lives on the line for others. Beyond the field of military medicine, Aegis can serve as a personalized shield for firefighters, police officers, and paramedics. For military leaders, our product provides insight into where troops and medics can be most effectively deployed based on congestion of injuries.

## README (from the GitHub repository)

This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## About

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.


## Detected evidence (automated analysis)

Indexed codebase: 79 recognized source files, 363 KB.
- CSS (language) — detected in the code
- JavaScript (language) — detected in the code
- Next.js (technology) — detected in the code
- React (technology) — detected in the code
- Supabase (technology) — detected in the code
- Tailwind CSS (technology) — detected in the code
- TypeScript (language) — detected in the code
- Google Gemini (technology) — claimed on Devpost, not found in the code
- Mistral AI (technology) — claimed on Devpost, not found in the code
- Swift (language) — claimed on Devpost, not found in the code
- Vercel (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (102 of 102)

```
.gitignore
.vscode/settings.json
app/(auth)/layout.tsx
app/(auth)/reset-password/page.tsx
app/(auth)/signin/page.tsx
app/(auth)/signout/page.tsx
app/(auth)/signup/page.tsx
app/(default)/command-center/[slug]/page.tsx
app/(default)/command-center/category-provider.tsx
app/(default)/command-center/event-carousel.tsx
app/(default)/command-center/event-schema.ts
app/(default)/command-center/filters.tsx
app/(default)/command-center/layout.tsx
app/(default)/command-center/map.tsx
app/(default)/command-center/page.tsx
app/(default)/command-center/post-item.tsx
app/(default)/contact/page.tsx
app/(default)/help/[slug]/help-sidebar.tsx
app/(default)/help/[slug]/page.tsx
app/(default)/layout.tsx
app/(default)/page.tsx
app/api/chat/route.ts
app/api/hello/route.ts
app/api/speech/route.ts
app/api/update-location/route.ts
app/css/additional-styles/custom-fonts.css
app/css/additional-styles/theme.css
app/css/additional-styles/utility-patterns.css
app/css/style.css
app/instruments/page.tsx
app/layout.tsx
app/not-found.tsx
CHANGELOG.md
components/career.tsx
components/clients.tsx
components/cta.tsx
components/dropdown.tsx
components/faqs.tsx
components/features.tsx
components/footer-separator.tsx
components/founders.tsx
components/hero-home.tsx
components/mdx/image.tsx
components/mdx/link.tsx
components/mdx/mdx.tsx
components/mdx/utils.ts
components/modal-video.tsx
components/news.tsx
components/page-illustration.tsx
components/pricing-home.tsx
components/pricing-table.tsx
components/providers.tsx
components/PulsingTracker.tsx
components/read-stats.tsx
components/search-modal.tsx
components/search.tsx
components/sidebar.tsx
components/soldier-timeline.tsx
components/split-carousel.tsx
components/spotlight.tsx
components/team.tsx
components/timeline.tsx
components/ui/footer.tsx
components/ui/header.tsx
components/ui/logo.tsx
components/ui/mobile-menu.tsx
components/workflows.tsx
content/blog/b2b-vs-b2c-product-management-how-different-are-they-really.mdx
content/blog/define-your-startup-content-strategy-for-maximum-impact.mdx
content/blog/five-key-takeaways-about-product-management-for-startups.mdx
content/blog/fueling-the-content-machine-with-the-knowledge-it-needs.mdx
content/blog/how-to-design-standout-products-in-the-modern-world.mdx
content/blog/how-to-lead-your-content-service-team-into-the-ai-future.mdx
content/blog/making-the-jump-from-b2c-to-b2b-content-management.mdx
content/blog/new-ai-releases-for-better-faster-more-personalized-support.mdx
content/blog/open-pros-new-and-improved-reporting-features.mdx
content/blog/prepare-your-internal-knowledge-content-for-ai.mdx
content/blog/the-new-era-of-ai-first-content-service-has-arrived.mdx
content/blog/the-ultimate-guide-to-ai-management-in-the-age-of-new-tools.mdx
content/blog/understanding-the-changing-economics-of-content-management.mdx
content/blog/unlocking-customer-strategic-potential-with-ai.mdx
content/blog/your-first-90-days-using-content-for-customer-service.mdx
content/help/frequently-asked-questions.mdx
content/help/get-started.mdx
content/help/open-pro-plans-features.mdx
content/help/payments-faqs.mdx
content/help/what-is-open-pro.mdx
contexts/DemoModeContext.tsx
contexts/SelectedSoldierContext.tsx
middleware.ts
next.config.js
package.json
postcss.config.js
README.md
tailwind.config.js
tsconfig.json
utils/mockSoldierData.ts
utils/supabase/client.ts
utils/supabase/middleware.ts
utils/supabase/server.ts
utils/useMasonry.tsx
utils/useMousePosition.tsx
```

### Dependencies

- package.json: @headlessui/react@^2.2.0, @headlessui/tailwindcss@^0.2.1, @mdx-js/loader@^3.1.0, @mdx-js/react@^3.1.0, @mistralai/mistralai@^1.5.0, @next/mdx@15.1.6, @supabase/ssr@^0.5.2, @supabase/supabase-js@^2.48.1, @tailwindcss/forms@^0.5.10, @tailwindcss/postcss@^4.0.3, @tailwindcss/typography@^0.5.16, @types/aos@^3.0.7, @types/mdx@^2.0.13, @types/node@^22.13.0, @types/react@19.0.8, @types/react-dom@19.0.3, @vercel/analytics@^1.5.0, aos@3.0.0-beta.6, date-fns@^4.1.0, mapbox-gl@^3.10.0, mapbox-gl-style-switcher@^1.0.11, mapbox.minimap@^0.2.0, next@15.1.11, next-mdx-remote@^5.0.0, postcss@^8.5.1, react@19.0.0, react-dom@19.0.0, rehype-pretty-code@^0.14.0, tailwind-scrollbar-hide@^2.0.0, tailwindcss@^4.0.3, typescript@^5.7.3

### Recent commits (newest first)

- Merge pull request #1 from SpotDylan/vercel/react-server-components-cve-vu-8am70l
- Fix React Server Components CVE vulnerabilities
- added Github link, devpost link, new video thumbnail, disabled video until demo
- changed graphics
- elevenlabs integration
- fixed pnpm
- fixed API endpoint url
- added Mistral and contextual understanding
- demo is availiable to public, live location from supabase, and final push
- hopefully fixed api route?
- running pnpm install
- added CORS for POST and analytisc
- new api route
- removed extraneous stuff
- graphical updates
- added api route for apple watch location, added demo feature, animation to read-stats, changed UI
- pulsing dot tracks ISS
- fixed things with packages
- ran pnpm install
- static mock date

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

### CHANGELOG.md

```markdown
# CHANGELOG.md

## [3.0.0] - 2025-02-04

- Upgrade to Tailwind 4
- Update other dependencies

## [2.1.0] - 2024-12-08

- Update dependencies + Upgrade to Next.js 15

## [2.0.0] - 2024-09-11

- Redesign the entire template

## [1.3.0] - 2024-07-05

- Replace Contentlayer with MDX

## [1.2.0] - 2023-12-07

- Update Next.js to 14

## [1.1.2] - 2023-10-04

- Update Twitter icon
- Update dependencies

## [1.1.0] - 2023-05-06

- Update dependencies
- Improve modal video component

## [1.0.0] - 2023-04-11

First release

```

### content/help/get-started.mdx

```
---
title: "Get started"
updatedAt: "2024-01-19"
summary: "In the ever-evolving digital landscape, content remains the cornerstone of any successful strategy. As we step into a new decade, the definition and execution of content have become more critical than ever."
---

- ## How can I use Open PRO without registration?

  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis enim lobortis scelerisque fermentum.

- ## Can I import my sitemap to Open PRO?

  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis enim lobortis scelerisque fermentum.

- ## How can I switch my subscription between essential, and premium plans?

  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis enim lobortis scelerisque fermentum.

- ## Can I cancel my subscription at any time?

  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis enim lobortis scelerisque fermentum.

- ## Is there an additional discount when paid annually?

  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis enim lobortis scelerisque fermentum.

- ## What happens if I don't renew my license after one year?

  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis enim lobortis scelerisque fermentum.

- ## What kind of payment methods do you provide?

  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis enim lobortis scelerisque fermentum.

```

### package.json

```
{
  "name": "open-pro-next",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev --turbopack",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@headlessui/react": "^2.2.0",
    "@headlessui/tailwindcss": "^0.2.1",
    "@mdx-js/loader": "^3.1.0",
    "@mdx-js/react": "^3.1.0",
    "@mistralai/mistralai": "^1.5.0",
    "@next/mdx": "15.1.6",
    "@supabase/ssr": "^0.5.2",
    "@supabase/supabase-js": "^2.48.1",
    "@types/mdx": "^2.0.13",
    "@types/node": "^22.13.0",
    "@types/react": "19.0.8",
    "@types/react-dom": "19.0.3",
    "@vercel/analytics": "^1.5.0",
    "aos": "3.0.0-beta.6",
    "date-fns": "^4.1.0",
    "mapbox-gl": "^3.10.0",
    "mapbox-gl-style-switcher": "^1.0.11",
    "mapbox.minimap": "^0.2.0",
    "next": "15.1.11",
    "next-mdx-remote": "^5.0.0",
    "react": "19.0.0",
    "react-dom": "19.0.0",
    "rehype-pretty-code": "^0.14.0",
    "tailwind-scrollbar-hide": "^2.0.0",
    "typescript": "^5.7.3"
  },
  "devDependencies": {
    "@tailwindcss/forms": "^0.5.10",
    "@tailwindcss/postcss": "^4.0.3",
    "@tailwindcss/typography": "^0.5.16",
    "@types/aos": "^3.0.7",
    "postcss": "^8.5.1",
    "tailwindcss": "^4.0.3"
  }
}

```

### app/layout.tsx

```typescript
import "./css/style.css";
import { Inter } from "next/font/google";
import localFont from "next/font/local";
import Header from "@/components/ui/header";
import { Providers } from "@/components/providers";

export const metadata = {
  title: "Aegis",
  description: "Building biochemical agent delivery systems",
};

const inter = Inter({
  subsets: ["latin"],
  variable: "--font-inter",
  display: "swap",
});

const nacelle = localFont({
  src: [
    {
      path: "../public/fonts/nacelle-regular.woff2",
      weight: "400",
      style: "normal",
    },
    {
      path: "../public/fonts/nacelle-italic.woff2",
      weight: "400",
      style: "italic",
    },
    {
      path: "../public/fonts/nacelle-semibold.woff2",
      weight: "600",
      style: "normal",
    },
    {
      path: "../public/fonts/nacelle-semibolditalic.woff2",
      weight: "600",
      style: "italic",
    },
  ],
  variable: "--font-nacelle",
  display: "swap",
});

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body
        className={`${inter.variable} ${nacelle.variable} bg-gray-950 font-inter text-base text-gray-200 antialiased`}
      >
        <Providers>
          <div className="flex min-h-screen flex-col overflow-hidden supports-[overflow:clip]:overflow-clip">
            <Header />
            {children}
          </div>
        </Providers>
      </body>
    </html>
  );
}

```

### app/instruments/page.tsx

```typescript
import { createClient } from '@/utils/supabase/server';

export default async function Instruments() {
  const supabase = await createClient();
  const { data: instruments } = await supabase.from("instruments").select();

  return <pre>{JSON.stringify(instruments, null, 2)}</pre>
}
```

### app/(auth)/layout.tsx

```typescript
import PageIllustration from "@/components/page-illustration";

export const metadata = {
  title: "Aegis",
  description: "Building biochemical agent delivery systems",
};

export default function AuthLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <main className="relative flex grow flex-col">
      <PageIllustration multiple />

      {children}
    </main>
  );
}

```

### app/(default)/layout.tsx

```typescript
"use client";

import { useEffect } from "react";
import { Analytics } from "@vercel/analytics/react"

import AOS from "aos";
import "aos/dist/aos.css";

import Footer from "@/components/ui/footer";

export default function DefaultLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  useEffect(() => {
    AOS.init({
      once: true,
      disable: "phone",
      duration: 600,
      easing: "ease-out-sine",
    });
  });

  return (
    <>
      <main className="relative flex grow flex-col">{children}</main>
      <Analytics/>
      <Footer />
    </>
  );
}

```

### app/(default)/page.tsx

```typescript
export const metadata = {
  title: "Aegis",
  description: "Building biochemical agent delivery systems",
};

import PageIllustration from "@/components/page-illustration";
import Hero from "@/components/hero-home";
import Workflows from "@/components/workflows";
import Features from "@/components/features";
import Pricing from "@/components/pricing-home";
import SplitCarousel from "@/components/split-carousel";
import Founders from "@/components/founders";
import Cta from "@/components/cta";

export default function Home() {
  return (
    <>
      <PageIllustration />
      <Hero />
      <Workflows />
      <Features />
      <SplitCarousel />
      <Founders />
      {/* <Pricing />
      <Cta /> */}
    </>
  );
}

```

### utils/supabase/server.ts

```typescript
import { createServerClient } from '@supabase/ssr'
import { cookies } from 'next/headers'

export async function createClient() {
  const cookieStore = await cookies()

  return createServerClient(
    process.env.NEXT_PUBLIC_SUPABASE_URL!,
    process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
    {
      cookies: {
        getAll() {
          return cookieStore.getAll()
        },
        setAll(cookiesToSet) {
          try {
            cookiesToSet.forEach(({ name, value, options }) =>
              cookieStore.set(name, value, options)
            )
          } catch {
            // The `setAll` method was called from a Server Component.
            // This can be ignored if you have middleware refreshing
            // user sessions.
          }
        },
      },
    }
  )
}
```

### app/api/hello/route.ts

```typescript
export async function GET(request: Request) {
  return new Response("Hello, Next.js!");
}

```

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