# Project export: Med2Meals

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 2024
- Tagline: Replace medicine with alternative natural food 🥘
- Devpost: https://devpost.com/software/nourish-connect
- GitHub: https://github.com/ShaneYokota72/Med2Meals
- Result: winner (Crossmint: Best Identity Credential Application Hack (2x rabbit r1 + $1k credit [1st] & 4x Ledger Nano S Plus + $400 credit [2nd]))
- Team: 2 GitHub contributor(s) — Shane Yokota (18 commits), Darshan (10 commits)

## Devpost submission (written by the team)

### Inspiration

The inspiration for Med2Meals sprang from the universal truth that food is more than just sustenance; it's medicine, comfort, and a catalyst for connection. In today's fast-paced world, we've seen an increasing reliance on pharmaceutical solutions to health issues, often overlooking the holistic benefits of natural remedies and the healing power of human connection. This realization was compounded by the global pandemic, which highlighted the detrimental effects of isolation on mental and physical health. Med2Meals was born out of a desire to revive the ancient wisdom that food can heal and to harness the digital age's potential to bring people together over the healing power of meals. We envisioned a platform that not only encourages a natural approach to healing through diet but also fosters a sense of community and support among individuals facing health challenges.

### What it does

Med2Meals connects individuals seeking natural dietary remedies for their health conditions with local chefs and home cooks who prepare and deliver home-cooked, healing meals. Users can input their specific health concerns or the type of medication they're aiming to supplement or avoid. The platform then suggests a variety of home-cooked recipes, each tailored to address those health issues with natural ingredients known for their healing properties. Beyond just providing recipes, Med2Meals offers a service where users can request these meals to be cooked and delivered by someone in their community. This feature aims to provide comfort through nourishing food while also opening the door to new friendships and a support network. The platform caters to a range of dietary preferences and health needs, ensuring that each user receives personalized care and nutrition. In essence, Med2Meals is more than a meal delivery service; it's a community-building tool that leverages the nurturing power of food to heal bodies and connect souls.

### How we built it

Frontend Development: We utilized Next.js for the frontend to leverage its server-side rendering capabilities, ensuring a fast, and responsive user interface. Frontend Development: We utilized Next.js for the frontend to leverage its server-side rendering capabilities, ensuring a fast, and responsive user interface. Backend Infrastructure: Our backend is powered by Node.js and Express.js, forming a robust and scalable foundation. Backend Infrastructure: Our backend is powered by Node.js and Express.js, forming a robust and scalable foundation. Integration of AI Technologies: We partnered with Together.ai to fine-tune and deploy Large Language Models (LLM) and Diffusion models tailored to our specific needs. These models are crucial for generating personalized meal recommendations and understanding user queries in natural language. Integration of AI Technologies: We partnered with Together.ai to fine-tune and deploy Large Language Models (LLM) and Diffusion models tailored to our specific needs. These models are crucial for generating personalized meal recommendations and understanding user queries in natural language. AI Agents for Data Exchange: The seamless execution of LLM and diffusion models, along with data exchange between them, is facilitated by AI agents using fetch.ai. This innovative approach allows for real-time, intelligent processing and a highly personalized user experience. AI Agents for Data Exchange: The seamless execution of LLM and diffusion models, along with data exchange between them, is facilitated by AI agents using fetch.ai. This innovative approach allows for real-time, intelligent processing and a highly personalized user experience. Blockchain Technology for Transactions: We employed Crossmint for blockchain ledger transactions between the user and chef. This ensures that every cooking opportunity a chef receives is cryptographically signed, providing a transparent and secure method to verify a chef's credibility through the NFTs they have minted. Blockchain Technology for Transactions: We employed Crossmint for blockchain ledger transactions between the user and chef. This ensures that every cooking opportunity a chef receives is cryptographically signed, providing a transparent and secure method to verify a chef's credibility through the NFTs they have minted. Database Management: MongoDB serves as our database management system, offering a flexible, scalable solution for storing and managing our data. Database Management: MongoDB serves as our database management system, offering a flexible, scalable solution for storing and managing our data. API Documentation: The entire API documentation was meticulously maintained in a Postman Workspace. API Documentation: The entire API documentation was meticulously maintained in a Postman Workspace. Development Tools: We adopted Bun as our package manager and JavaScript runtime. Bun's high performance and efficiency in package management and execution of JavaScript code significantly enhanced our development workflow, allowing us to build and deploy features rapidly. Development Tools: We adopted Bun as our package manager and JavaScript runtime. Bun's high performance and efficiency in package management and execution of JavaScript code significantly enhanced our development workflow, allowing us to build and deploy features rapidly.

### Challenges we ran into

Customized Recipe Generation: We encountered difficulties in crafting the ideal few-shot prompts for Large Language Models (LLMs) to generate customized recipes, which was crucial for tailoring dietary solutions. Building AI Agents with Fetch.ai: The challenge of navigating Fetch.ai's occasionally misleading documentation was significant. However, the assistance from the Fetch.ai team was instrumental in overcoming these hurdles. Idea Pivot: Initially, we faced a setback with our original concept, which seemed too cliché after our initial pitch to judges. This led us to pivot to a more unique and impactful problem statement, which ultimately defined our project's direction.

### Accomplishments we're proud of

Successful Pivot: The decision to pivot our idea proved to be valuable. Moving away from a generic concept to tackle a unique problem statement has positioned us distinctively in the space. Diverse Technological Learning: Each team member embraced the challenge of learning new technologies, from AI agents and prompt engineering for LLMs to crypto signing. This diversity in learning has been one of our project's most enriching experiences.

### What we learned

AI Agents: The project deepened our understanding of AI agents, enhancing our ability to deploy intelligent solutions. Fine-tuning LLMs: We gained valuable insights into the process of fine-tuning Large Language Models to meet specific project needs. Crypto Signing: The importance and application of crypto signing were key learnings, opening new avenues for secure data handling. Teamwork: The project underscored the indispensable value of teamwork in overcoming challenges and achieving collective goals.

### What's next

Speed Optimization: Currently, the process of fetching custom recipes using LLMs is slower than desired. Our immediate focus will be on improving the speed of this feature to enhance user experience. User Interface Improvements: We plan to refine the user interface to make it more intuitive and user-friendly, ensuring that our platform is accessible to everyone, regardless of their tech-savviness. Integration with Health Platforms: We are looking into integrating Med2Meals with existing health platforms and medical databases, to provide users with a seamless experience that bridges the gap between medical advice and dietary solutions.

## README (from the GitHub repository)

No README available.

## Detected evidence (automated analysis)

Indexed codebase: 51 recognized source files, 101 KB.
- CSS (language) — detected in the code
- Express (technology) — detected in the code
- FastAPI (technology) — detected in the code
- Flask (technology) — detected in the code
- JavaScript (language) — detected in the code
- MongoDB (technology) — detected in the code
- Next.js (technology) — detected in the code
- Python (language) — detected in the code
- React (technology) — detected in the code
- SQL (language) — detected in the code
- Tailwind CSS (technology) — detected in the code
- TypeScript (language) — detected in the code
- Node.js (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (64 of 64)

```
.gitignore
LLM_agents/generate_recipe_agent.py
LLM_agents/generate_recipe_image_agent.py
LLM_agents/generate_recipe_proxy.py
LLM_agents/requirements.txt
P2F backend/.DS_Store
P2F backend/.gitignore
P2F backend/index.js
P2F backend/model/order.js
P2F backend/model/user.js
P2F backend/package.json
treehacks_frontend/.eslintrc.json
treehacks_frontend/.gitignore
treehacks_frontend/bun.lockb
treehacks_frontend/next.config.mjs
treehacks_frontend/package.json
treehacks_frontend/postcss.config.js
treehacks_frontend/prisma/migrations/20240217104247_init/migration.sql
treehacks_frontend/prisma/migrations/20240217113025_migration_1/migration.sql
treehacks_frontend/prisma/migrations/20240217141721_migration_3/migration.sql
treehacks_frontend/prisma/migrations/20240217142007_migration_4/migration.sql
treehacks_frontend/prisma/migrations/20240217171357_migration_4/migration.sql
treehacks_frontend/prisma/migrations/20240217172953_migration_5/migration.sql
treehacks_frontend/prisma/migrations/20240217204256_migration_6/migration.sql
treehacks_frontend/prisma/migrations/20240217204755_migration_7/migration.sql
treehacks_frontend/prisma/migrations/20240217205109_migration_8/migration.sql
treehacks_frontend/prisma/migrations/20240217212822_migration_9/migration.sql
treehacks_frontend/prisma/migrations/20240218040807_migration_9/migration.sql
treehacks_frontend/prisma/migrations/20240218043328_migration_10/migration.sql
treehacks_frontend/prisma/migrations/20240218045442_migration_10/migration.sql
treehacks_frontend/prisma/migrations/20240218052256_migration_11/migration.sql
treehacks_frontend/prisma/migrations/20240218052532_migration_12/migration.sql
treehacks_frontend/prisma/migrations/20240218064054_migration_13/migration.sql
treehacks_frontend/prisma/migrations/20240218064829_migration_14/migration.sql
treehacks_frontend/prisma/migrations/migration_lock.toml
treehacks_frontend/prisma/schema.prisma
treehacks_frontend/README.md
treehacks_frontend/src/app/dashboard/page.tsx
treehacks_frontend/src/app/globals.css
treehacks_frontend/src/app/layout.tsx
treehacks_frontend/src/app/login/page.tsx
treehacks_frontend/src/app/page.tsx
treehacks_frontend/src/app/signup/page.tsx
treehacks_frontend/src/components/Orders.tsx
treehacks_frontend/src/components/Recommendation.tsx
treehacks_frontend/src/pages/api/crossmint/createWallet.ts
treehacks_frontend/src/pages/api/crossmint/signMessage.ts
treehacks_frontend/src/pages/api/cusine.ts
treehacks_frontend/src/pages/api/diet.ts
treehacks_frontend/src/pages/api/goal.ts
treehacks_frontend/src/pages/api/login.ts
treehacks_frontend/src/pages/api/order.ts
treehacks_frontend/src/pages/api/party.ts
treehacks_frontend/src/pages/api/register.ts
treehacks_frontend/src/pages/api/reservation.ts
treehacks_frontend/src/pages/api/restaurant.ts
treehacks_frontend/src/pages/api/terra.ts
treehacks_frontend/src/pages/api/test.ts
treehacks_frontend/src/pages/api/user_party.ts
treehacks_frontend/src/pages/api/user.ts
treehacks_frontend/src/util/RecipeType.ts
treehacks_frontend/tailwind.config.ts
treehacks_frontend/tmp.tsx
treehacks_frontend/tsconfig.json
```

### Dependencies

- LLM_agents/requirements.txt: aiohttp@==3.9.3, aiosignal@==1.3.1, annotated-types@==0.6.0, anyio@==4.2.0, apispec@==6.4.0, attrs@==23.2.0, bech32@==1.2.0, blinker@==1.7.0, certifi@==2024.2.2, charset-normalizer@==3.3.2, click@==8.1.7, contourpy@==1.2.0, cosmpy@==0.9.2, cycler@==0.12.1, ecdsa@==0.18.0, fastapi@==0.109.2, Flask@==3.0.2, fonttools@==4.49.0, frozenlist@==1.4.1, googleapis-common-protos@==1.62.0, grpcio@==1.60.1, h11@==0.14.0, idna@==3.6, itsdangerous@==2.1.2, Jinja2@==3.1.3, joblib@==1.3.2, jsonschema@==4.21.1, jsonschema-specifications@==2023.12.1, kiwisolver@==1.4.5, MarkupSafe@==2.1.5, matplotlib@==3.8.3, msgpack@==1.0.7, multidict@==6.0.5, nltk@==3.8.1, numpy@==1.26.4, outcome@==1.3.0.post0, packaging@==23.2, pandas@==2.2.0, pillow@==10.2.0, protobuf@==4.25.3, PyAudio@==0.2.14, pycryptodome@==3.20.0, pydantic@==1.10.14, pydantic_core@==2.16.1, pyngrok@==7.1.2, pyobjc@==10.1, pyobjc-core@==10.1, pyobjc-framework-Accessibility@==10.1, pyobjc-framework-Accounts@==10.1, pyobjc-framework-AddressBook@==10.1, pyobjc-framework-AdServices@==10.1, pyobjc-framework-AdSupport@==10.1, pyobjc-framework-AppleScriptKit@==10.1, pyobjc-framework-AppleScriptObjC@==10.1, pyobjc-framework-ApplicationServices@==10.1, pyobjc-framework-AppTrackingTransparency@==10.1, pyobjc-framework-AudioVideoBridging@==10.1, pyobjc-framework-AuthenticationServices@==10.1, pyobjc-framework-AutomaticAssessmentConfiguration@==10.1, pyobjc-framework-Automator@==10.1, pyobjc-framework-AVFoundation@==10.1, pyobjc-framework-AVKit@==10.1, pyobjc-framework-AVRouting@==10.1, pyobjc-framework-BackgroundAssets@==10.1, pyobjc-framework-BusinessChat@==10.1, pyobjc-framework-CalendarStore@==10.1, pyobjc-framework-CallKit@==10.1, pyobjc-framework-CFNetwork@==10.1, pyobjc-framework-Cinematic@==10.1, pyobjc-framework-ClassKit@==10.1, pyobjc-framework-CloudKit@==10.1, pyobjc-framework-Cocoa@==10.1, pyobjc-framework-Collaboration@==10.1, pyobjc-framework-ColorSync@==10.1, pyobjc-framework-Contacts@==10.1, pyobjc-framework-ContactsUI@==10.1, pyobjc-framework-CoreAudio@==10.1, pyobjc-framework-CoreAudioKit@==10.1, pyobjc-framework-CoreBluetooth@==10.1, pyobjc-framework-CoreData@==10.1, pyobjc-framework-CoreHaptics@==10.1, pyobjc-framework-CoreLocation@==10.1, pyobjc-framework-CoreMedia@==10.1, pyobjc-framework-CoreMediaIO@==10.1, pyobjc-framework-CoreMIDI@==10.1, pyobjc-framework-CoreML@==10.1, pyobjc-framework-CoreMotion@==10.1, pyobjc-framework-CoreServices@==10.1, pyobjc-framework-CoreSpotlight@==10.1, pyobjc-framework-CoreText@==10.1, pyobjc-framework-CoreWLAN@==10.1, pyobjc-framework-CryptoTokenKit@==10.1, pyobjc-framework-DataDetection@==10.1, pyobjc-framework-DeviceCheck@==10.1, pyobjc-framework-DictionaryServices@==10.1, pyobjc-framework-DiscRecording@==10.1, pyobjc-framework-DiscRecordingUI@==10.1, pyobjc-framework-DiskArbitration@==10.1, pyobjc-framework-DVDPlayback@==10.1, pyobjc-framework-EventKit@==10.1, pyobjc-framework-ExceptionHandling@==10.1, pyobjc-framework-ExecutionPolicy@==10.1, pyobjc-framework-ExtensionKit@==10.1, pyobjc-framework-ExternalAccessory@==10.1, pyobjc-framework-FileProvider@==10.1, pyobjc-framework-FileProviderUI@==10.1, pyobjc-framework-FinderSync@==10.1, pyobjc-framework-FSEvents@==10.1, pyobjc-framework-GameCenter@==10.1, pyobjc-framework-GameController@==10.1, pyobjc-framework-GameKit@==10.1, pyobjc-framework-GameplayKit@==10.1, pyobjc-framework-HealthKit@==10.1, pyobjc-framework-ImageCaptureCore@==10.1, pyobjc-framework-InputMethodKit@==10.1, pyobjc-framework-InstallerPlugins@==10.1, pyobjc-framework-InstantMessage@==10.1, pyobjc-framework-Intents@==10.1, pyobjc-framework-IntentsUI@==10.1, pyobjc-framework-IOBluetooth@==10.1, pyobjc-framework-IOBluetoothUI@==10.1, pyobjc-framework-IOSurface@==10.1, pyobjc-framework-iTunesLibrary@==10.1, pyobjc-framework-KernelManagement@==10.1, pyobjc-framework-LatentSemanticMapping@==10.1, pyobjc-framework-LaunchServices@==10.1, pyobjc-framework-libdispatch@==10.1, pyobjc-framework-libxpc@==10.1, pyobjc-framework-LinkPresentation@==10.1, pyobjc-framework-LocalAuthentication@==10.1, pyobjc-framework-LocalAuthenticationEmbeddedUI@==10.1, pyobjc-framework-MailKit@==10.1, pyobjc-framework-MapKit@==10.1, pyobjc-framework-MediaAccessibility@==10.1, pyobjc-framework-MediaLibrary@==10.1, pyobjc-framework-MediaPlayer@==10.1, pyobjc-framework-MediaToolbox@==10.1, pyobjc-framework-Metal@==10.1, pyobjc-framework-MetalFX@==10.1, pyobjc-framework-MetalKit@==10.1, pyobjc-framework-MetalPerformanceShaders@==10.1, pyobjc-framework-MetalPerformanceShadersGraph@==10.1, pyobjc-framework-MetricKit@==10.1, pyobjc-framework-MLCompute@==10.1, pyobjc-framework-ModelIO@==10.1, pyobjc-framework-MultipeerConnectivity@==10.1, pyobjc-framework-NaturalLanguage@==10.1, pyobjc-framework-NetFS@==10.1, pyobjc-framework-Network@==10.1, pyobjc-framework-NetworkExtension@==10.1, pyobjc-framework-NotificationCenter@==10.1, pyobjc-framework-OpenDirectory@==10.1, pyobjc-framework-OSAKit@==10.1, pyobjc-framework-OSLog@==10.1, pyobjc-framework-PassKit@==10.1, pyobjc-framework-PencilKit@==10.1, pyobjc-framework-PHASE@==10.1, pyobjc-framework-Photos@==10.1, pyobjc-framework-PhotosUI@==10.1, pyobjc-framework-PreferencePanes@==10.1, pyobjc-framework-PushKit@==10.1, pyobjc-framework-Quartz@==10.1, pyobjc-framework-QuickLookThumbnailing@==10.1, pyobjc-framework-ReplayKit@==10.1, pyobjc-framework-SafariServices@==10.1, pyobjc-framework-SafetyKit@==10.1, pyobjc-framework-SceneKit@==10.1, pyobjc-framework-ScreenCaptureKit@==10.1, pyobjc-framework-ScreenSaver@==10.1, pyobjc-framework-ScreenTime@==10.1, pyobjc-framework-ScriptingBridge@==10.1, pyobjc-framework-SearchKit@==10.1, pyobjc-framework-Security@==10.1, pyobjc-framework-SecurityFoundation@==10.1, pyobjc-framework-SecurityInterface@==10.1, pyobjc-framework-SensitiveContentAnalysis@==10.1, pyobjc-framework-ServiceManagement@==10.1, pyobjc-framework-SharedWithYou@==10.1, pyobjc-framework-SharedWithYouCore@==10.1, pyobjc-framework-ShazamKit@==10.1, pyobjc-framework-Social@==10.1, pyobjc-framework-SoundAnalysis@==10.1, pyobjc-framework-Speech@==10.1, pyobjc-framework-SpriteKit@==10.1, pyobjc-framework-StoreKit@==10.1, pyobjc-framework-Symbols@==10.1, pyobjc-framework-SyncServices@==10.1, pyobjc-framework-SystemConfiguration@==10.1, pyobjc-framework-SystemExtensions@==10.1, pyobjc-framework-ThreadNetwork@==10.1, pyobjc-framework-UniformTypeIdentifiers@==10.1, pyobjc-framework-UserNotifications@==10.1, pyobjc-framework-UserNotificationsUI@==10.1, pyobjc-framework-VideoSubscriberAccount@==10.1, pyobjc-framework-VideoToolbox@==10.1, pyobjc-framework-Virtualization@==10.1, pyobjc-framework-Vision@==10.1, pyobjc-framework-WebKit@==10.1, pyparsing@==3.1.1, PySocks@==1.7.1, python-dateutil@==2.8.2, pyttsx3@==2.90, pytz@==2024.1, PyYAML@==6.0.1, referencing@==0.33.0, regex@==2023.12.25, requests@==2.31.0, rpds-py@==0.18.0, scikit-learn@==1.4.1.post1, scipy@==1.12.0, selenium@==4.17.2, six@==1.16.0, sniffio@==1.3.0, sortedcontainers@==2.4.0, SpeechRecognition@==3.10.1, sseclient-py@==1.8.0, starlette@==0.36.3, tabulate@==0.9.0, threadpoolctl@==3.3.0, together@==0.2.11, tqdm@==4.66.2, trio@==0.24.0, trio-websocket@==0.11.1, typer@==0.9.0, typing_extensions@==4.9.0, tzdata@==2024.1, uagents@==0.10.0, urllib3@==2.2.0, uvicorn@==0.20.0, websockets@==10.4, Werkzeug@==3.0.1, wsproto@==1.2.0, yarl@==1.9.4
- P2F backend/package.json: cors@^2.8.5, dotenv@^16.4.4, express@^4.18.2, mongoose@^8.1.3, nodemon@^3.0.3
- treehacks_frontend/package.json: @million/lint@latest, @prisma/client@^5.9.1, @types/node@^20, @types/react@^18, @types/react-dom@^18, autoprefixer@^10.0.1, bcryptjs@^2.4.3, bun@^1.0.27, clsx@^2.1.0, cookie@^0.6.0, eslint@^8, eslint-config-next@14.1.0, js-cookie@^3.0.5, next@14.1.0, postcss@^8, prisma@^5.9.1, react@^18, react-dom@^18, tailwindcss@^3.3.0, typescript@^5

### Recent commits (newest first)

- get medicine from query param
- uncommenting few lines
- Merge pull request #10 from ShaneYokota72/backend-overhaul
- blockchain integration completed
- updating llm agent response
- llm agents added
- fix
- Merge pull request #9 from ShaneYokota72/p2mflow
- Merge branch 'main' into p2mflow
- api rework
- integration
- Merge pull request #8 from ShaneYokota72/darshan
- add cookies during login
- Merge pull request #7 from ShaneYokota72/p2mflow
- Merge branch 'main' into p2mflow
- p2f comp
- Merge pull request #6 from ShaneYokota72/darshan
- order, restaurant apis
- order, restaurant apis
- Merge pull request #5 from ShaneYokota72/useronboard

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

### P2F backend/package.json

```
{
  "dependencies": {
    "cors": "^2.8.5",
    "dotenv": "^16.4.4",
    "express": "^4.18.2",
    "mongoose": "^8.1.3",
    "nodemon": "^3.0.3"
  }
}

```

### treehacks_frontend/package.json

```
{
  "name": "treehacks",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@million/lint": "latest",
    "@prisma/client": "^5.9.1",
    "bcryptjs": "^2.4.3",
    "bun": "^1.0.27",
    "clsx": "^2.1.0",
    "cookie": "^0.6.0",
    "js-cookie": "^3.0.5",
    "next": "14.1.0",
    "prisma": "^5.9.1",
    "react": "^18",
    "react-dom": "^18"
  },
  "devDependencies": {
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "autoprefixer": "^10.0.1",
    "eslint": "^8",
    "eslint-config-next": "14.1.0",
    "postcss": "^8",
    "tailwindcss": "^3.3.0",
    "typescript": "^5"
  }
}

```

### LLM_agents/requirements.txt

```
aiohttp==3.9.3
aiosignal==1.3.1
annotated-types==0.6.0
anyio==4.2.0
apispec==6.4.0
attrs==23.2.0
bech32==1.2.0
blinker==1.7.0
certifi==2024.2.2
charset-normalizer==3.3.2
click==8.1.7
contourpy==1.2.0
cosmpy==0.9.2
cycler==0.12.1
ecdsa==0.18.0
fastapi==0.109.2
Flask==3.0.2
fonttools==4.49.0
frozenlist==1.4.1
googleapis-common-protos==1.62.0
grpcio==1.60.1
h11==0.14.0
idna==3.6
itsdangerous==2.1.2
Jinja2==3.1.3
joblib==1.3.2
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
kiwisolver==1.4.5
MarkupSafe==2.1.5
matplotlib==3.8.3
msgpack==1.0.7
multidict==6.0.5
nltk==3.8.1
numpy==1.26.4
outcome==1.3.0.post0
packaging==23.2
pandas==2.2.0
pillow==10.2.0
protobuf==4.25.3
PyAudio==0.2.14
pycryptodome==3.20.0
pydantic==1.10.14
pydantic_core==2.16.1
pyngrok==7.1.2
pyobjc==10.1
pyobjc-core==10.1
pyobjc-framework-Accessibility==10.1
pyobjc-framework-Accounts==10.1
pyobjc-framework-AddressBook==10.1
pyobjc-framework-AdServices==10.1
pyobjc-framework-AdSupport==10.1
pyobjc-framework-AppleScriptKit==10.1
pyobjc-framework-AppleScriptObjC==10.1
pyobjc-framework-ApplicationServices==10.1
pyobjc-framework-AppTrackingTransparency==10.1
pyobjc-framework-AudioVideoBridging==10.1
pyobjc-framework-AuthenticationServices==10.1
pyobjc-framework-AutomaticAssessmentConfiguration==10.1
pyobjc-framework-Automator==10.1
pyobjc-framework-AVFoundation==10.1
pyobjc-framework-AVKit==10.1
pyobjc-framework-AVRouting==10.1
pyobjc-framework-BackgroundAssets==10.1
pyobjc-framework-BusinessChat==10.1
pyobjc-framework-CalendarStore==10.1
pyobjc-framework-CallKit==10.1
pyobjc-framework-CFNetwork==10.1
pyobjc-framework-Cinematic==10.1
pyobjc-framework-ClassKit==10.1
pyobjc-framework-CloudKit==10.1
pyobjc-framework-Cocoa==10.1
pyobjc-framework-Collaboration==10.1
pyobjc-framework-ColorSync==10.1
pyobjc-framework-Contacts==10.1
pyobjc-framework-ContactsUI==10.1
pyobjc-framework-CoreAudio==10.1
pyobjc-framework-CoreAudioKit==10.1
pyobjc-framework-CoreBluetooth==10.1
pyobjc-framework-CoreData==10.1
pyobjc-framework-CoreHaptics==10.1
pyobjc-framework-CoreLocation==10.1
pyobjc-framework-CoreMedia==10.1
pyobjc-framework-CoreMediaIO==10.1
pyobjc-framework-CoreMIDI==10.1
pyobjc-framework-CoreML==10.1
pyobjc-framework-CoreMotion==10.1
pyobjc-framework-CoreServices==10.1
pyobjc-framework-CoreSpotlight==10.1
pyobjc-framework-CoreText==10.1
pyobjc-framework-CoreWLAN==10.1
pyobjc-framework-CryptoTokenKit==10.1
pyobjc-framework-DataDetection==10.1
pyobjc-framework-DeviceCheck==10.1
pyobjc-framework-DictionaryServices==10.1
pyobjc-framework-DiscRecording==10.1
pyobjc-framework-DiscRecordingUI==10.1
pyobjc-framework-DiskArbitration==10.1
pyobjc-framework-DVDPlayback==10.1
pyobjc-framework-EventKit==10.1
pyobjc-framework-ExceptionHandling==10.1
pyobjc-framework-ExecutionPolicy==10.1
pyobjc-framework-ExtensionKit==10.1
pyobjc-framework-ExternalAccessory==10.1
pyobjc-framework-FileProvider==10.1
pyobjc-framework-FileProviderUI==10.1
pyobjc-framework-FinderSync==10.1
pyobjc-framework-FSEvents==10.1
pyobjc-framework-GameCenter==10.1
pyobjc-framework-GameController==10.1
pyobjc-framework-GameKit==10.1
pyobjc-framework-GameplayKit==10.1
pyobjc-framework-HealthKit==10.1
pyobjc-framework-ImageCaptureCore==10.1
pyobjc-framework-InputMethodKit==10.1
pyobjc-framework-InstallerPlugins==10.1
pyobjc-framework-InstantMessage==10.1
pyobjc-framework-Intents==10.1
pyobjc-framework-IntentsUI==10.1
pyobjc-framework-IOBluetooth==10.1
pyobjc-framework-IOBluetoothUI==10.1
pyobjc-framework-IOSurface==10.1
pyobjc-framework-iTunesLibrary==10.1
pyobjc-framework-KernelManagement==10.1
pyobjc-framework-LatentSemanticMapping==10.1
pyobjc-framework-LaunchServices==10.1
pyobjc-framework-libdispatch==10.1
pyobjc-framework-libxpc==10.1
pyobjc-framework-LinkPresentation==10.1
pyobjc-framework-LocalAuthentication==10.1
pyobjc-framework-LocalAuthenticationEmbeddedUI==10.1
pyobjc-framework-MailKit==10.1
pyobjc-framework-MapKit==10.1
pyobjc-framework-MediaAccessibility==10.1
pyobjc-framework-MediaLibrary==10.1
pyobjc-framework-MediaPlayer==10.1
pyobjc-framework-MediaToolbox==10.1
pyobjc-framework-Metal==10.1
pyobjc-framework-MetalFX==10.1
pyobjc-framework-MetalKit==10.1
pyobjc-framework-MetalPerformanceShaders==10.1
pyobjc-framework-MetalPerformanceShadersGraph==10.1
pyobjc-framework-MetricKit==10.1
pyobjc-framework-MLCompute==10.1
pyobjc-framework-ModelIO==10.1
pyobjc-framework-MultipeerConnectivity==10.1
pyobjc-framework-NaturalLanguage==10.1
pyobjc-framework-NetFS==10.1
pyobjc-framework-Network==10.1
pyobjc-framework-NetworkExtension==10.1
pyobjc-framework-NotificationCenter==10.1
pyobjc-framework-OpenDirectory==10.1
pyobjc-framework-OSAKit==10.1
pyobjc-framework-OSLog==10.1
pyobjc-framework-PassKit==10.1
pyobjc-framework-PencilKit==10.1
pyobjc-framework-PHASE==10.1
pyobjc-framework-Photos==10.1
pyobjc-framework-PhotosUI==10.1
pyobjc-framework-PreferencePanes==10.1
pyobjc-framework-PushKit==10.1
pyobjc-framework-Quartz==10.1
pyobjc-framework-QuickLookThumbnailing==10.1
pyobjc-framework-ReplayKit==10.1
pyobjc-framework-SafariServices==10.1
pyobjc-framework-SafetyKit==10.1
pyobjc-framework-SceneKit==10.1
pyobjc-framework-ScreenCaptureKit==10.1
pyobjc-framework-ScreenSaver==10.1
pyobjc-framework-ScreenTime==10.1
pyobjc-framework-ScriptingBridge==10.1
pyobjc-framework-SearchKit==10.1
pyobjc-framework-Security==10.1
pyobjc-framework-SecurityFoundation==10.1
pyobjc-framework-SecurityInterface==10.1
pyobjc-framework-SensitiveContentAnalysis==10.1
pyobjc-framework-ServiceManagement==10.1
pyobjc-framework-SharedWithYou==10.1
pyobjc-framework-SharedWithYouCore==10.1
pyobjc-framework-ShazamKit==10.1
pyobjc-framework-Social==10.1
pyobjc-framework-SoundAnalysis==10.1
pyobjc-framework-Speech==10.1
pyobjc-framework-SpriteKit==10.1
pyobjc-framework-StoreKit==10.1
pyobjc-framework-Symbols==10.1
pyobjc-framework-SyncServices==10.1
pyobjc-framework-SystemConfiguration==10.1
pyobjc-framework-SystemExtensions==10.1
pyobjc-framework-ThreadNetwork==10.1
pyobjc-framework-UniformTypeIdentifiers==10.1
py
[truncated — 864 more characters]
```

### P2F backend/index.js

```javascript
const express = require('express');
const app = express();
require('dotenv').config();
const cors = require('cors');
const mongoose = require('mongoose');

const userModel = require('./model/user');
const orderModel = require('./model/order');

app.use(express.json());
app.use(cors({origin: true, credentials: true}));

app.get('/', (req, res) => {
  res.send('Hello World');
})

app.post('/login' , async (req, res) => {
    mongoose.connect(process.env.MONGO_CONNECT)
    const user = await userModel.findOne({
        email: req.body.email,
        password: req.body.password,
    })
    if (user) {
        res.send(user);
    } else {
        res.status(401).send("Unauthorized");
    }
})

app.post("/signup", async (req, res) => {
    const { email , password } = req.body;
    mongoose.connect(process.env.MONGO_CONNECT)

    // make a crypto wallet
    const crossmint_api_key = process.env.CROSSMINT_API_KEY;
    const options = {
        method: 'POST',
        headers: {'X-API-KEY': crossmint_api_key, 'Content-Type': 'application/json'},
        body: JSON.stringify({
            chain: "polygon",
            email: email
        })
    };
        
    const response = await fetch('https://staging.crossmint.com/api/v1-alpha1/wallets', options)
    const wallet = await response.json();
    const walletid = wallet.publicKey

    const user = await userModel.create({
        email: email,
        password: password,
        wallet: walletid,
        collectionID: "997be271-c6de-4716-a0d2-11c976c889f8",
        credentialList: []
    })

    res.send(user);
})

app.post('/issuecredential', async (req, res) => {
    const { email, orderID } = req.body;
    mongoose.connect(process.env.MONGO_CONNECT)
    const user = await userModel.findOne({
        email: email
    })
    const walletid = user.wallet;

    const order = await orderModel.findOne({
        _id: orderID
    })
    order.chef = user._id;
    order.save();

    const crossmint_api_key = process.env.CROSSMINT_API_KEY;

    const options = {
        method: "POST",
        headers: {
          "X-API-KEY": crossmint_api_key,
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
            "metadata": {
                "name": "Chef certificate credential",
                "image": "https://www.crossmint.com/assets/crossmint/logo.png",
                "description": `Proof of taking the order ${orderID}`
            },
            "recipient": "polygon:"+walletid,
            "credential": {
                "subject": {
                "chef": email
                },
                "expiresAt": "2025-02-18"
            }
        }),
    };

    const response = await fetch("https://staging.crossmint.com/api/unstable/collections/997be271-c6de-4716-a0d2-11c976c889f8/credentials", options)
    const data = await response.json();

    user.credentialList.push(data.credentialId);
    await user.save();

    res.send(user);
})

app.post('/verifycredential', async (req, res) => {
    const { credentialID } = req.body;
    mongoose.connect(process.env.MONGO_CONNECT)
    const crossmint_api_key = process.env.CROSSMINT_API_KEY;

    const options = {method: 'GET', headers: {'X-API-KEY': crossmint_api_key}};

    const response = await fetch("https://staging.crossmint.com/api/unstable/credentials/"+credentialID, options)
    const data = await response.json();

    const options2 = {
        method: 'POST',
        headers: {'X-API-KEY': crossmint_api_key, 'Content-Type': 'application/json'},
        body: JSON.stringify(
            {"credential":data}
        ) 
      };
      
    const verifyresponse = await fetch('https://staging.crossmint.com/api/unstable/credentials/verify', options2)

    const finaldata = await verifyresponse.json();
    res.send(finaldata);
})

app.get('/getuser', async (req, res) => {
    mongoose.connect(process.env.MONGO_CONNECT)
    const user = await userModel.findOne({
        _id: req.query.request_user
    })
    res.send(user);
})

app.post('/createorder', async (req, res) => {
    // recipe meta infos, email->request_user, compensation
    const { title, description, ingredients, instructions, email } = req.body;
    mongoose.connect(process.env.MONGO_CONNECT)

    const user = await userModel.findOne({
        email: email
    })
    if (!user) {
        res.status(401).send("Unauthorized");
    }

    const newOrder = await orderModel.create({
        recipe: {
            title: title,
            description: description,
            imageLink: "https://www.budgetbytes.com/wp-content/uploads/2022/07/Chicken-Alfredo-bowl.jpg",
            ingredients: ingredients,
            instructions: instructions,
        },
        request_user: user._id,
        chef: null,
        compensation: Math.floor(Math.random() * 20) + 5,
        isDelivered: false
    })

    res.send(newOrder);
})

app.get('/orders', async (req, res) => {
    mongoose.connect(process.env.MONGO_CONNECT)
    // find orders that are not delivered and chef is null
    const orders = await orderModel.find({
        isDelivered: false,
        chef: null
    })
    res.send(orders);
})

app.listen(4000, () => {});
```

### treehacks_frontend/src/app/layout.tsx

```typescript
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
  title: "Create Next App",
  description: "Generated by create next app",
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <body className={inter.className}>{children}</body>
    </html>
  );
}

```

### treehacks_frontend/src/app/page.tsx

```typescript
import Link from "next/link";
import Image from 'next/image';

export default function Home() {
  return (
    <main className="flex min-h-screen flex-col items-center justify-around bg-gradient-to-r from-[#FFC371] to-[#FF5F6D]">
      <Image src="/Logo.png" alt='logo' width={200} height={200} className='w-10/12 h-auto'/>
      <div className="flex flex-col gap-8">
        <Link href="/login" className="bg-[#252937] px-8 py-4 text-white text-xl rounded-lg text-center">Login</Link>
        <Link href="/signup" className="bg-[#252937] px-8 py-4 text-white text-xl rounded-lg text-center">Sign Up</Link>
      </div>
    </main>
  );
}

```

### treehacks_frontend/src/app/login/page.tsx

```typescript
"use client";
import Image from 'next/image';
import { useRouter } from 'next/navigation';
import React, { useState } from 'react'

export default function page() {
    const [email, setEmail] = useState('');
    const [password, setPassword] = useState('');

    const router = useRouter();

    async function login(){

        // const response = await fetch('/api/login', {
        //     method: 'POST',
        //     headers: {'Content-Type': 'application/json'},
        //     body: JSON.stringify({username, password})
        // })
        // const data = await response.json()
        const response = await fetch('http://localhost:4000/login', {
            method: 'POST',
            headers: {'Content-Type': 'application/json'},
            credentials: 'include',
            body: JSON.stringify({email, password})
        });

        if(response.ok){
            // link to dashboard?email:<email> encode the url
            // const encodedEmail = encodeURIComponent(email) 
            localStorage.setItem("email", email);
            router.push(`/dashboard`);
        } else {
            alert("login credential wrong")
        }
    }

    return (
        <div>
            <div className="flex min-h-screen flex-col items-center justify-around bg-gradient-to-r from-[#FFC371] to-[#FF5F6D]">
                {/* <h1 className="text-6xl font-bold text-white">Treehacks</h1> */}
                <Image src="/Logo.png" alt='logo' width={200} height={200} className='w-10/12 h-auto'/>
                <div className="flex flex-col gap-8 items-center">
                    <input type="text" placeholder="Email" value={email} onChange={(e) => setEmail(e.target.value)} className="bg-[#252937e0] px-8 py-4 text-white text-xl rounded-lg text-center" />
                    <input type="password" placeholder="Password" value={password} onChange={(e) => setPassword(e.target.value)} className="bg-[#252937e0] px-8 py-4 text-white text-xl rounded-lg text-center" />
                    <button className="w-2/3 bg-[#252937] px-6 py-2 text-white text-xl rounded-lg text-center" onClick={login}>Login</button>
                </div>
            </div>
        </div>
    )
}

```

### treehacks_frontend/src/app/dashboard/page.tsx

```typescript
"use client";
import Image from 'next/image';
import React, { useEffect, useState } from 'react'
import { Recipe } from '../../util/RecipeType';
import clsx from 'clsx';
import Recommendation from '@/components/Recommendation';
import Orders from '@/components/Orders';


export default function page() {
  const email = localStorage?.getItem('email')
  const [type, setType] = useState<"user" | "chef">("user")
  const [recipes, setRecipes] = useState<Recipe[]>([
    /* {
      id: 1,
      name: "Chicken Alfredo",
      userId: 1,
      description: "creamy Chicken Alfredo",
      imageLink: "https://www.budgetbytes.com/wp-content/uploads/2022/07/Chicken-Alfredo-bowl.jpg",
      isDelivered: false,
      compensation: 20,
      ingredients: "1 lb fettuccine\n1/2 cup unsalted butter\n1 cup heavy cream\n1 cup grated parmesan cheese\n1/2 tsp salt\n1/4 tsp black pepper\n2 cups cooked chicken",
      reciepe: "1)Chicken Alfredo\n 2)dothis\n 3)dothis\n",
      user: {
        name: "chef1",
      }
    
    },
    {
      id: 1,
      name: "Chicken Alfredo",
      userId: 1,
      description: "creamy Chicken Alfredo",
      imageLink: "https://www.budgetbytes.com/wp-content/uploads/2022/07/Chicken-Alfredo-bowl.jpg",
      isDelivered: false,
      compensation: 20,
      ingredients: "1 lb fettuccine\n1/2 cup unsalted butter\n1 cup heavy cream\n1 cup grated parmesan cheese\n1/2 tsp salt\n1/4 tsp black pepper\n2 cups cooked chicken",
      reciepe: "1)Chicken Alfredo\n 2)dothis\n 3)dothis\n",
      user: {
        name: "chef1",
      }
    
    } */
  ])
  const [orderlist, setOrderlist] = useState([])

  const [spin, setSpin] = useState(false)
  function search () {
    setSpin(true)
    setTimeout(() => {
      setSpin(false)
    }, 1000)
    /* loading time for geting recipe data */
    setSpin(false)
  }

  useEffect(() => {
    // call llm endpoint
    const fetchOrders = async () => {
      const response = await fetch('http://localhost:4000/orders', {
        method: 'GET',
        headers: {'Content-Type': 'application/json'},
      })
      const data = await response.json()
      setOrderlist(data)
      console.log(data)
    }

    const fetchRecipes = async () => {
      /* 
        LLM endpoint
      */
      // const response = await fetch('http://localhost:4000/recipes', {
      //   method: 'GET',
      //   headers: {'Content-Type': 'application/json'},
      // })
      // const data = await response.json()
      // setRecipes(data)

      setRecipes([
        {
          id: 1,
          name: "Chicken Alfredo",
          userId: 1,
          description: "creamy Chicken Alfredo",
          imageLink: "https://www.budgetbytes.com/wp-content/uploads/2022/07/Chicken-Alfredo-bowl.jpg",
          isDelivered: false,
          compensation: 20,
          ingredients: ["ingredients 1 do this", "ingredients 2 do this", "ingredients 3 do this"],
          reciepe: ["step1", "step2", "step3"],
          user: {
            name: "chef1",
          }
        },
        {
          id: 1,
          name: "Lentil Soup",
          userId: 1,
          description: "Delicious Lentil Soup",
          imageLink: "https://cookieandkate.com/images/2019/01/best-lentil-soup-recipe-4.jpg",
          isDelivered: false,
          compensation: 20,
          ingredients: ["ingredients 1 do this", "ingredients 2 do this", "ingredients 3 do this"],
          reciepe: ["step1", "step2", "step3"],
          user: {
            name: "chef1",
          }
        
        }
      ])
    }

    if(type === "chef"){
      fetchOrders()
    } else if(type === "user"){
      fetchRecipes()
    }
  }, [type])

  return (
    <div className="flex flex-col min-h-screen bg-gradient-to-r from-[#FFC371] to-[#FF5F6D] p-10 w-full">
      <div>
        <Image src="/MiniLogo.png" alt='logo' width={200} height={200} className='w-1/4 h-auto'/>
        <div className='flex gap-4 mt-4 w-full'>
          <input type="text" placeholder="Look up pills" className="bg-[#25293780] px-8 py-4 text-white text-xl rounded-lg text-center w-3/4"/>
          <Image src="/Pill.png" alt='search' width={50} height={50} className={clsx('aspect-square w-16 h-16 hover:scale-105', {"animate-spin": spin})} onClick={() => {search}}/>
        </div>
      </div>
      <div className='flex gap-4 py-4'>
        <p className='px-4 py-2 bg-green-300 rounded-md hover:scale-105' onClick={() => {setType("chef")}}>Be a chef</p>
        <p className='px-4 py-2 bg-green-300 rounded-md hover:scale-105' onClick={() => {setType("user")}}>Get a chef</p>
      </div>
      {
        type === "chef" && (
          <div className='mt-8 flex flex-col'>
            <h1 className="text-xl font-bold text-white">Orders Near You 🍳</h1>
            <div className='flex flex-col gap-4 mt-4'>
              {orderlist.map((order:any, index) => (
                <Orders chef={order.chef} compensation={order.compensation} isDelivered={order.isDelivered} recipe={order.recipe} request_user={order.request_user} _id={order._id} />
              ))}
            </div>
          </div>
        )
      }
      {
        type === "user" && (
          <div className='mt-8 flex flex-col'>
            <h1 className="text-xl font-bold text-white">Recipes Results</h1>
            <div className='flex flex-col gap-4 mt-4'>
              {recipes.map((recipe, index) => (
                <Recommendation {...recipe} key={index}/>
              ))}
            </div>
          </div>
        )
      }
      

    </div>
  )
}

```

### treehacks_frontend/src/app/signup/page.tsx

```typescript
"use client"
import { useRouter } from 'next/navigation';
import React, { useEffect, useState } from 'react'
import Image from 'next/image';

export enum Cuisines {
  American = 4,
  Chinese = 5,
  French = 6,
  Indian = 7,
  Italian = 8,
  Japanese = 9,
  Korean = 10,
  Mexican = 11,
  Thai = 12,
  Vietnamese = 13,
}

export enum DietaryRestrictions {
  Vegan = 5,
  Vegetarian = 6,
  GlutenFree = 7,
  None = 8,
}

export enum Goals {
  ProteinGoal = 1,
  CalorieGoal = 2,
}


export enum Cuisines {
  American = 4,
  Chinese = 5,
  French = 6,
  Indian = 7,
  Italian = 8,
  Japanese = 9,
  Korean = 10,
  Mexican = 11,
  Thai = 12,
  Vietnamese = 13,
}

export enum DietaryRestrictions {
  Vegan = 5,
  Vegetarian = 6,
  GlutenFree = 7,
  None = 8,
}

export enum Goals {
  ProteinGoal = 1,
  CalorieGoal = 2,
}



interface signUpData {
    username: string;
    password: string;
    age: number;
    bio: string;

    american: boolean;
    chinese: boolean; 
    french: boolean;
    indian: boolean;
    italian: boolean;
    japanese: boolean;
    korean: boolean;
    mexican: boolean;
    thai: boolean;
    vietnamese: boolean;

    vegan: boolean;
    vegetarian: boolean;
    glutenFree: boolean;

    proteinGoal?: number;
    calorieGoal?: number;
}

type Step = "credential" | "cuisine" | "restriction" | "goal" | "terra" | "complete"

export default function page() {
    const [username, setUsername] = useState('');
    const [password, setPassword] = useState('');

    const router = useRouter();

    async function signup(){
        console.log("username", username)
        console.log("password", password)
        // const response = await fetch('/api/signup', {
        //     method: 'POST',
        //     body: JSON.stringify({username, password})
        // })
        // const data = await response.json()
        
        // if(response.ok){
        //     router.push(`/dashboard?userid=${data.id}`)
        // } else {
        //     alert("signup failed")
        // }
    }

    return (
        <div>
            <div className="flex min-h-screen flex-col items-center justify-around bg-gradient-to-r from-[#FFC371] to-[#FF5F6D]">
                {/* <h1 className="text-6xl font-bold text-white">Treehacks</h1> */}
                <Image src="/Logo.png" alt='logo' width={200} height={200} className='w-10/12 h-auto'/>
                <div className="flex flex-col gap-8 items-center">
                    <input type="text" placeholder="Username" value={username} onChange={(e) => setUsername(e.target.value)} className="bg-[#252937e0] px-8 py-4 text-white text-xl rounded-lg text-center" />
                    <input type="password" placeholder="Password" value={password} onChange={(e) => setPassword(e.target.value)} className="bg-[#252937e0] px-8 py-4 text-white text-xl rounded-lg text-center" />
                    <button className="w-2/3 bg-[#252937] px-6 py-2 text-white text-xl rounded-lg text-center" onClick={signup}>Sign up</button>
                </div>
            </div>
        </div>
    )
}

/* 
export default function page() {
    const [step, setStep] = useState<Step>('credential');
    const [userid, setUserid] = useState<string>("" as string);
    const [signUpData, setSignUpData] = useState<signUpData>({} as signUpData);

    const router = useRouter();

    function handleInfoUpdate(e: React.ChangeEvent<HTMLInputElement>) {
        const field = e.target.name as keyof signUpData;
        
        setSignUpData(prevState => ({
            ...prevState, 
            [field]: e.target.value
        }));
    }

    function handleCheckboxUpdate(e: React.ChangeEvent<HTMLInputElement>) {
        const field = e.target.name as keyof signUpData;
        
        setSignUpData(prevState => ({
            ...prevState, 
            [field]: !prevState[field]
        }));
    }

    function saveAndContinue() {
        console.log(signUpData);
        const requestData = {
            username: signUpData.email,
            password: signUpData.password,
            age: parseInt(signUpData.age),
            bio:  signUpData.bio,
            diets: [],
            cuisines: [],  
            goals: [],  
        };


        if (signUpData.vegan) requestData.diets.push(DietaryRestrictions.Vegan);
        if (signUpData.vegetarian) requestData.diets.push(DietaryRestrictions.Vegetarian);
        if (signUpData.glutenFree) requestData.diets.push(DietaryRestrictions.GlutenFree);

        if (signUpData.american) requestData.cuisines.push(Cuisines.American);
        if (signUpData.chinese) requestData.cuisines.push(Cuisines.Chinese);
        if (signUpData.french) requestData.cuisines.push(Cuisines.French);
        if (signUpData.indian) requestData.cuisines.push(Cuisines.Indian);
        if (signUpData.italian) requestData.cuisines.push(Cuisines.Italian);
        if (signUpData.japanese) requestData.cuisines.push(Cuisines.Japanese);
        if (signUpData.korean) requestData.cuisines.push(Cuisines.Korean);
        if (signUpData.mexican) requestData.cuisines.push(Cuisines.Mexican);
        if (signUpData.thai) requestData.cuisines.push(Cuisines.Thai);
        if (signUpData.vietnamese) requestData.cuisines.push(Cuisines.Vietnamese);
        
        if (signUpData.proteinGoal) requestData.goals.push(Goals.ProteinGoal);
        if (signUpData.calorieGoal) requestData.goals.push(Goals.CalorieGoal);
        

        // Make the API request
        fetch('/api/register', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(requestData),
        })
        .then((response) => {
            if (response.ok) {
                return response.json();
            } else {
                throw new Error('Failed to register');
            }
        })
            .then((data) => {
            // do terra stuff here
                
                setUserid(data.id);
                setStep("terr
[truncated — 11652 more characters]
```

### treehacks_frontend/postcss.config.js

```javascript
module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
};

```

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