# Project export: munchies

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: you give, you get. a community-building platform for requesting, delivering, & donating food.
- Devpost: https://devpost.com/software/munchies-zghluv
- GitHub: https://github.com/anshitasaini/munchies
- Video: https://www.youtube.com/embed/C8RbIcMHefM?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 2 GitHub contributor(s) — Anshita Saini (27 commits), bensonngai02 (14 commits)

## Devpost submission (written by the team)

### Inspiration

Have you ever wanted food delivered to you, but you don't want to pay those outrageous UberEats/Doordash delivery fees? Or, have you ever had food that you wouldn't use and didn't want to go to waste? Introducing Munchies, the sustainable community-building platform for requesting, delivering, and donating food to others. As college students, we encounter these problems on a daily basis that would be solved with this app.

### What it does

Munchies is based on the model of giving and receiving to foster community, specifically in the form of food deliveries or donations. Users can request for food to be delivered by other munchers (such as from a local nearby Chick-fil-a); they simply have to pay the cost for the food, and the request costs some amount of non-monetary points. Therefore, to make requests, users have to help make deliveries to others as well, where each delivery earns them some number of points. This model is exactly the same with donations; users earn points for posting food donations that are picked up by others for use, and those who pick them up only have to pay in points. Community-building is the main goal and is attained implicitly and explicitly through our app's model. Implicitly, users are encouraged to support one another by making deliveries and donating food, simultaneously benefiting from their actions to have food delivered to them in the future. Explicitly, the app aims to encourage community members to build more sustainable habits, where food wastage is minimized in a world with limited resources.

### How we built it

We spent a significant amount of time coming up with our idea and fleshing out our user flow on paper. As we had two submodels (requesting/delivering food, offering/receiving donations) within our app's model, we blueprinted our idea and drew out the full user experience to make sure we were organized with our thoughts. It was imperative that the UI was simple for users to use, and all features (delivering, receiving, making donations) were easily accessible with minimal clicks. As such, we came up with a simple, straightforward Map and order interface to achieve our goal.

### Challenges we ran into

Coming up with a UI that was intuitive and facilitated both of our app's submodels (food deliveries vs donations) was difficult. Rendering many things on our map and including interactivity introduced various technical bugs that we spent a lot of time fixing. Creating all of our features for donators and food requesters was significantly time consuming. We had many parts and information we could use between different requests/responses, but we had to separately code various parts as data like menus existed on the page for someone wanting to order, but was not necessary for the page for someone donating their food. Scraping data for nearby restaurants with menu items was difficult, but we were able to find sufficient information for demonstration purposes.

### Accomplishments we're proud of

With 3 people and in around ~15-20 hours of active work, we were able to put together a reasonably and technically complex hack that we're proud of. Most importantly, this is an app that we built as we would realistically use it, and our vision at the beginning of the hackathon was mostly realized. We completed almost all of the features we intended to build, and our design and interface is reasonably polished. With some refinements, this would be an app we'd be happy to release to communities to test!

### What we learned

We all learned to use different frameworks that we were previously not exposed to very well. Specifically, our team used React, Chakra, and Google-Maps-React for our frontend, while our backend was composed of FastAPI and Supabase. We learned to collaborate very well together, maximizing work efficiency to chronologically breaking down and completing tasks one by one to go from an empty project to a fully-working product.

### What's next

Our platform was developed for the computer primary for ease of development and use for a 36 hour hackathon. However, we envision this app to be a mobile app for everyday use, so creating iOS and Android versions of the munchies app is the immediate next step. Further, connecting our app to already-popular food pickup apps like UberEats, Doordash, and Grubhub would be interesting, and we believe would attract many users.

## README (from the GitHub repository)

# munchies

## Detected evidence (automated analysis)

Indexed codebase: 27 recognized source files, 60 KB.
- CSS (language) — detected in the code
- Django (technology) — detected in the code
- FastAPI (technology) — detected in the code
- Flask (technology) — detected in the code
- HTML (language) — detected in the code
- Hugging Face (technology) — detected in the code
- JavaScript (language) — detected in the code
- LangChain (technology) — detected in the code
- OpenAI (technology) — detected in the code
- PostgreSQL (technology) — detected in the code
- Python (language) — detected in the code
- PyTorch (technology) — detected in the code
- React (technology) — detected in the code
- Redis (technology) — detected in the code
- Tailwind CSS (technology) — detected in the code
- Supabase (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (36 of 36)

```
.gitignore
munchies/backend/main.py
munchies/backend/requirements.txt
munchies/backend/stanford_imgs.json
munchies/backend/stanford_menus.json
munchies/frontend/.gitignore
munchies/frontend/package.json
munchies/frontend/public/index.html
munchies/frontend/public/manifest.json
munchies/frontend/public/robots.txt
munchies/frontend/README.md
munchies/frontend/src/App.css
munchies/frontend/src/App.js
munchies/frontend/src/App.test.js
munchies/frontend/src/ColorModeSwitcher.js
munchies/frontend/src/ContainerComponent.js
munchies/frontend/src/DateInput.js
munchies/frontend/src/DonationForm.js
munchies/frontend/src/index.css
munchies/frontend/src/index.js
munchies/frontend/src/InfoBox.js
munchies/frontend/src/LoadingScreen.js
munchies/frontend/src/Logo.js
munchies/frontend/src/Map.js
munchies/frontend/src/MarkerComponent.js
munchies/frontend/src/MenuItem.js
munchies/frontend/src/MenuList.js
munchies/frontend/src/RadioCard.js
munchies/frontend/src/reportWebVitals.js
munchies/frontend/src/serviceWorker.js
munchies/frontend/src/setupTests.js
munchies/frontend/src/test-utils.js
munchies/frontend/src/TimeDropdown.js
munchies/frontend/tailwind.config.js
package.json
README.md
```

### Dependencies

- munchies/backend/requirements.txt: aiohttp@==3.8.4, aiosignal@==1.3.1, amqp@==5.1.1, anyio@==3.6.2, appnope@==0.1.3, argilla@==1.7.0, argon2-cffi@==23.1.0, argon2-cffi-bindings@==21.2.0, arrow@==1.3.0, asgiref@==3.6.0, asttokens@==2.2.1, async-lru@==2.0.4, async-timeout@==4.0.2, attrs@==23.1.0, audioread@==3.0.1, autobahn@==23.1.2, Automat@==22.10.0, Babel@==2.14.0, backcall@==0.2.0, backoff@==2.2.1, beautifulsoup4@==4.12.2, billiard@==3.6.4.0, black@==23.1.0, bleach@==6.1.0, blinker@==1.6.2, blis@==0.7.11, Brotli@==1.0.9, bs4@==0.0.1, build@==1.0.3, CacheControl@==0.13.1, catalogue@==2.0.10, celery@==5.3.4, certifi@==2023.5.7, cffi@==1.15.1, channels@==4.0.0, channels-redis@==4.1.0, charset-normalizer@==3.1.0, cleo@==2.1.0, click@==8.1.3, click-didyoumean@==0.3.0, click-plugins@==1.1.1, click-repl@==0.2.0, cloudpathlib@==0.16.0, comm@==0.2.1, commonmark@==0.9.1, confection@==0.1.3, ConfigArgParse@==1.5.3, constantly@==15.1.0, contourpy@==1.0.7, crashtest@==0.4.1, cron-descriptor@==1.2.35, cryptography@==40.0.1, cssselect@==1.2.0, cycler@==0.11.0, cymem@==2.0.8, daphne@==4.0.0, dataclasses-json@==0.5.7, datasets@==2.12.0, debugpy@==1.6.6, decorator@==5.1.1, defusedxml@==0.7.1, Deprecated@==1.2.13, deprecation@==2.1.0, dill@==0.3.6, distlib@==0.3.7, dj-database-url@==1.2.0, Django@==4.2.6, django_debug_toolbar@==3.8.1, django-celery-beat@==2.5.0, django-configurations@==2.4.1, django-cors-headers@==4.1.0, django-email-verification@==0.3.1, django-environ@==0.10.0, django-filter@==23.1, django-nose@==1.4.7, django-redis@==5.2.0, django-timezone-field@==5.0, djangorestframework@==3.14.0, djangorestframework-camel-case@==1.4.2, dnspython@==2.3.0, drf-spectacular@==0.26.3, dulwich@==0.21.6, email-validator@==2.0.0.post2, environ@==1.0, et-xmlfile@==1.1.0, executing@==1.2.0, Faker@==18.4.0, fastapi@==0.95.2, fastjsonschema@==2.19.0, ffmpeg@==1.4, ffprobe@==0.5, filelock@==3.13.1, Flask@==2.3.1, Flask-BasicAuth@==0.2.0, Flask-Cors@==3.0.10, fonttools@==4.38.0, fqdn@==1.5.1, frozenlist@==1.3.3, fsspec@==2023.5.0, gevent@==22.10.2, geventhttpclient@==2.0.9, googlemaps@==4.10.0, greenlet@==2.0.2, gTTS@==2.4.0, gunicorn@==20.1.0, h11@==0.14.0, httpcore@==0.17.2, httptools@==0.5.0, httpx@==0.24.1, huggingface-hub@==0.17.3, hyperlink@==21.0.0, idna@==3.4, importlib-metadata@==6.8.0, incremental@==22.10.0, inflection@==0.5.1, installer@==0.7.0, ipykernel@==6.21.2, ipython@==8.10.0, ipywidgets@==8.1.2, isoduration@==20.11.0, itemadapter@==0.8.0, itemloaders@==1.1.0, itsdangerous@==2.1.2, jaraco.classes@==3.3.0, jedi@==0.18.2, Jinja2@==3.1.2, jmespath@==1.0.1, joblib@==1.2.0, json5@==0.9.14, jsonpointer@==2.4, jsonschema@==4.18.0, jsonschema-specifications@==2023.6.1, jupyter@==1.0.0, jupyter_client@==8.0.3, jupyter_core@==5.2.0, jupyter_server@==2.12.5, jupyter_server_terminals@==0.5.2, jupyter-console@==6.6.3, jupyter-events@==0.9.0, jupyter-lsp@==2.2.2, jupyterlab@==4.0.12, jupyterlab_pygments@==0.3.0, jupyterlab_server@==2.25.2, jupyterlab_widgets@==3.0.10, keyring@==24.3.0, kiwisolver@==1.4.4, kombu@==5.3.2, langchain@==0.0.180, langcodes@==3.3.0, lazy_loader@==0.3, librosa@==0.10.1, llvmlite@==0.41.1, load-dotenv@==0.1.0, locust@==2.15.1, loguru@==0.7.0, lxml@==4.9.2, Markdown@==3.4.3, MarkupSafe@==2.1.2, marshmallow@==3.19.0, marshmallow-enum@==1.5.1, matplotlib@==3.7.0, matplotlib-inline@==0.1.6, mistune@==3.0.2, monotonic@==1.6, more-itertools@==10.1.0, mpmath@==1.3.0, msg-parser@==1.2.0, msgpack@==1.0.5, multidict@==6.0.4, multiprocess@==0.70.14, murmurhash@==1.0.10, mypy-extensions@==1.0.0, nbclient@==0.9.0, nbconvert@==7.16.0, nbformat@==5.9.2, nest-asyncio@==1.5.6, networkx@==3.0, nltk@==3.8.1, noisereduce@==3.0.0, nose@==1.3.7, notebook@==7.0.8, notebook_shim@==0.2.3, numba@==0.58.1, numexpr@==2.8.4, numpy@==1.24.3, olefile@==0.46, openai@==0.27.7, openapi-schema-pydantic@==1.2.4, openpyxl@==3.1.2, orjson@==3.8.14, overrides@==7.7.0, packaging@==23.1, pandas@==1.5.3, pandoc@==2.3, pandocfilters@==1.5.1, parsel@==1.8.1, parso@==0.8.3, pathspec@==0.11.1, pdfminer.six@==20221105, pexpect@==4.8.0, pickleshare@==0.7.5, Pillow@==9.4.0, pinecone-client@==2.2.1, pkginfo@==1.9.6, platformdirs@==3.11.0, plumbum@==1.8.1, ply@==3.11, poetry@==1.7.1, poetry-core@==1.8.1, poetry-plugin-export@==1.6.0, pooch@==1.8.0, preshed@==3.0.9, prometheus-client@==0.19.0, prompt-toolkit@==3.0.38, Protego@==0.3.0, protobuf@==4.25.0, psutil@==5.9.4, psycopg2@==2.9.5, ptyprocess@==0.7.0, pure-eval@==0.2.2, pyarrow@==12.0.0, pyasn1@==0.4.8, pyasn1-modules@==0.2.8, pycparser@==2.21, pydantic@==1.10.8, PyDispatcher@==2.0.7, pydub@==0.25.1, Pygments@==2.14.0, PyJWT@==2.6.0, pylab-sdk@==1.3.2, pymongo@==4.6.0, pyOpenSSL@==23.1.1, pypandoc@==1.11, pyparsing@==3.0.9, pypdf@==3.8.1, PyPDF2@==3.0.1, pyproject_hooks@==1.0.0, python-crontab@==2.7.1, python-dateutil@==2.8.2, python-docx@==0.8.11, python-dotenv@==1.0.0, python-json-logger@==2.0.7, python-magic@==0.4.27, python-multipart@==0.0.6, python-pptx@==0.6.21, pytz@==2023.2, PyYAML@==6.0, pyzmq@==25.0.0, qtconsole@==5.5.1, QtPy@==2.4.1, queuelib@==1.6.2, rapidfuzz@==3.5.2, redis@==4.5.3, referencing@==0.29.1, regex@==2023.5.5, requests@==2.31.0, requests-file@==1.5.1, requests-toolbelt@==1.0.0, responses@==0.18.0, rfc3339-validator@==0.1.4, rfc3986@==1.5.0, rfc3986-validator@==0.1.1, rich@==13.0.1, rouge@==1.0.1, roundrobin@==0.0.4, rpds-py@==0.9.2, safetensors@==0.4.0, scikit-learn@==1.3.1, scipy@==1.10.1, Scrapy@==2.11.0, Send2Trash@==1.8.2, sentencepiece@==0.1.99, service-identity@==21.1.0, shellingham@==1.5.4, six@==1.16.0, smart-open@==6.4.0, sniffio@==1.3.0, soundfile@==0.12.1, soupsieve@==2.5, soxr@==0.3.7, spacy@==3.7.2, spacy-legacy@==3.0.12, spacy-loggers@==1.0.5, spark-submit@==1.4.0, SQLAlchemy@==2.0.15, sqlparse@==0.4.3, srsly@==2.4.8, stack-data@==0.6.2, starlette@==0.27.0, sympy@==1.12, tenacity@==8.2.2, terminado@==0.18.0, thinc@==8.2.1, threadpoolctl@==3.2.0, tiktoken@==0.4.0, tinycss2@==1.2.1, tldextract@==5.0.1, tokenizers@==0.14.1, tomlkit@==0.12.3, torch@==2.1.0, torchvision@==0.16.0, tornado@==6.2, tqdm@==4.66.2, traitlets@==5.9.0, transformers@==4.35.0, trove-classifiers@==2023.11.14, Twisted@==22.10.0, txaio@==23.1.1, typer@==0.9.0, types-python-dateutil@==2.8.19.20240106, typing_extensions@==4.6.2, typing-inspect@==0.9.0, tzdata@==2023.2, ujson@==5.7.0, unstructured@==0.6.8, uri-template@==1.3.0, uritemplate@==4.1.1, urllib3@==2.0.2, uvicorn@==0.22.0, uvloop@==0.17.0, vine@==5.0.0, virtualenv@==20.24.6, w3lib@==2.1.2, wasabi@==1.1.2, watchfiles@==0.19.0, wcwidth@==0.2.6, weasel@==0.3.4, webcolors@==1.13, webencodings@==0.5.1, websocket-client@==1.7.0, websockets@==11.0.3, Werkzeug@==2.3.0, widgetsnbextension@==4.0.10, wrapt@==1.14.1, xattr@==0.10.1, XlsxWriter@==3.1.0, xxhash@==3.2.0, yarl@==1.9.2, youtube-transcript-api@==0.6.1, zipp@==3.17.0, zope.event@==4.6, zope.interface@==6.0
- munchies/frontend/package.json: @chakra-ui/react@^2.8.2, @emotion/react@^11.11.3, @emotion/styled@^11.11.0, @testing-library/jest-dom@^5.17.0, @testing-library/react@^13.4.0, @testing-library/user-event@^14.5.2, axios@^1.6.7, framer-motion@^6.5.1, google-map-react@^2.2.1, google-maps-react-markers@^2.0.8, react@^18.2.0, react-dom@^18.2.0, react-icons@^3.11.0, react-scripts@5.0.1, tailwindcss@^3.4.1, web-vitals@^2.1.4
- package.json: @react-google-maps/api@^2.19.3, google-map-react@^2.2.1

### Recent commits (newest first)

- small bug fix
- make donators blue
- change map radius
- loading screen and finishing touches
- some formatting
- points working
- restaurant images and some other clean up
- clean up open close and fetch user from db
- fix other bug
- fix restaurant bug
- requesters
- donators
- restaurants work
- some stuff
- modal made
- made menu list
- Merge branch 'main' of https://github.com/anshitasaini/munchies
- donation form layout done
- show restaurants and donators on map
- add some schemas

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

### package.json

```
{
  "dependencies": {
    "@react-google-maps/api": "^2.19.3",
    "google-map-react": "^2.2.1"
  }
}

```

### munchies/frontend/package.json

```
{
  "name": "munchies",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@chakra-ui/react": "^2.8.2",
    "@emotion/react": "^11.11.3",
    "@emotion/styled": "^11.11.0",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^14.5.2",
    "axios": "^1.6.7",
    "framer-motion": "^6.5.1",
    "google-map-react": "^2.2.1",
    "google-maps-react-markers": "^2.0.8",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-icons": "^3.11.0",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "tailwindcss": "^3.4.1"
  }
}

```

### munchies/backend/requirements.txt

```
aiohttp==3.8.4
aiosignal==1.3.1
amqp==5.1.1
anyio==3.6.2
appnope==0.1.3
argilla==1.7.0
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asgiref==3.6.0
asttokens==2.2.1
async-lru==2.0.4
async-timeout==4.0.2
attrs==23.1.0
audioread==3.0.1
autobahn==23.1.2
Automat==22.10.0
Babel==2.14.0
backcall==0.2.0
backoff==2.2.1
beautifulsoup4==4.12.2
billiard==3.6.4.0
black==23.1.0
bleach==6.1.0
blinker==1.6.2
blis==0.7.11
Brotli==1.0.9
bs4==0.0.1
build==1.0.3
CacheControl==0.13.1
catalogue==2.0.10
celery==5.3.4
certifi==2023.5.7
cffi==1.15.1
channels==4.0.0
channels-redis==4.1.0
charset-normalizer==3.1.0
cleo==2.1.0
click==8.1.3
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.2.0
cloudpathlib==0.16.0
comm==0.2.1
commonmark==0.9.1
confection==0.1.3
ConfigArgParse==1.5.3
constantly==15.1.0
contourpy==1.0.7
crashtest==0.4.1
cron-descriptor==1.2.35
cryptography==40.0.1
cssselect==1.2.0
cycler==0.11.0
cymem==2.0.8
daphne==4.0.0
dataclasses-json==0.5.7
datasets==2.12.0
debugpy==1.6.6
decorator==5.1.1
defusedxml==0.7.1
Deprecated==1.2.13
deprecation==2.1.0
dill==0.3.6
distlib==0.3.7
dj-database-url==1.2.0
Django==4.2.6
django-celery-beat==2.5.0
django-configurations==2.4.1
django-cors-headers==4.1.0
django-email-verification==0.3.1
django-environ==0.10.0
django-filter==23.1
django-nose==1.4.7
django-redis==5.2.0
django-timezone-field==5.0
django_debug_toolbar==3.8.1
djangorestframework==3.14.0
djangorestframework-camel-case==1.4.2
dnspython==2.3.0
drf-spectacular==0.26.3
dulwich==0.21.6
email-validator==2.0.0.post2
environ==1.0
et-xmlfile==1.1.0
executing==1.2.0
Faker==18.4.0
fastapi==0.95.2
fastjsonschema==2.19.0
ffmpeg==1.4
ffprobe==0.5
filelock==3.13.1
Flask==2.3.1
Flask-BasicAuth==0.2.0
Flask-Cors==3.0.10
fonttools==4.38.0
fqdn==1.5.1
frozenlist==1.3.3
fsspec==2023.5.0
gevent==22.10.2
geventhttpclient==2.0.9
googlemaps==4.10.0
greenlet==2.0.2
gTTS==2.4.0
gunicorn==20.1.0
h11==0.14.0
httpcore==0.17.2
httptools==0.5.0
httpx==0.24.1
huggingface-hub==0.17.3
hyperlink==21.0.0
idna==3.4
importlib-metadata==6.8.0
incremental==22.10.0
inflection==0.5.1
installer==0.7.0
ipykernel==6.21.2
ipython==8.10.0
ipywidgets==8.1.2
isoduration==20.11.0
itemadapter==0.8.0
itemloaders==1.1.0
itsdangerous==2.1.2
jaraco.classes==3.3.0
jedi==0.18.2
Jinja2==3.1.2
jmespath==1.0.1
joblib==1.2.0
json5==0.9.14
jsonpointer==2.4
jsonschema==4.18.0
jsonschema-specifications==2023.6.1
jupyter==1.0.0
jupyter-console==6.6.3
jupyter-events==0.9.0
jupyter-lsp==2.2.2
jupyter_client==8.0.3
jupyter_core==5.2.0
jupyter_server==2.12.5
jupyter_server_terminals==0.5.2
jupyterlab==4.0.12
jupyterlab_pygments==0.3.0
jupyterlab_server==2.25.2
jupyterlab_widgets==3.0.10
keyring==24.3.0
kiwisolver==1.4.4
kombu==5.3.2
langchain==0.0.180
langcodes==3.3.0
lazy_loader==0.3
librosa==0.10.1
llvmlite==0.41.1
load-dotenv==0.1.0
locust==2.15.1
loguru==0.7.0
lxml==4.9.2
Markdown==3.4.3
MarkupSafe==2.1.2
marshmallow==3.19.0
marshmallow-enum==1.5.1
matplotlib==3.7.0
matplotlib-inline==0.1.6
mistune==3.0.2
monotonic==1.6
more-itertools==10.1.0
mpmath==1.3.0
msg-parser==1.2.0
msgpack==1.0.5
multidict==6.0.4
multiprocess==0.70.14
murmurhash==1.0.10
mypy-extensions==1.0.0
nbclient==0.9.0
nbconvert==7.16.0
nbformat==5.9.2
nest-asyncio==1.5.6
networkx==3.0
nltk==3.8.1
noisereduce==3.0.0
nose==1.3.7
notebook==7.0.8
notebook_shim==0.2.3
numba==0.58.1
numexpr==2.8.4
numpy==1.24.3
olefile==0.46
openai==0.27.7
openapi-schema-pydantic==1.2.4
openpyxl==3.1.2
orjson==3.8.14
overrides==7.7.0
packaging==23.1
pandas==1.5.3
pandoc==2.3
pandocfilters==1.5.1
parsel==1.8.1
parso==0.8.3
pathspec==0.11.1
pdfminer.six==20221105
pexpect==4.8.0
pickleshare==0.7.5
Pillow==9.4.0
pinecone-client==2.2.1
pkginfo==1.9.6
platformdirs==3.11.0
plumbum==1.8.1
ply==3.11
poetry==1.7.1
poetry-core==1.8.1
poetry-plugin-export==1.6.0
pooch==1.8.0
preshed==3.0.9
prometheus-client==0.19.0
prompt-toolkit==3.0.38
Protego==0.3.0
protobuf==4.25.0
psutil==5.9.4
psycopg2==2.9.5
ptyprocess==0.7.0
pure-eval==0.2.2
pyarrow==12.0.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.21
pydantic==1.10.8
PyDispatcher==2.0.7
pydub==0.25.1
Pygments==2.14.0
PyJWT==2.6.0
pylab-sdk==1.3.2
pymongo==4.6.0
pyOpenSSL==23.1.1
pypandoc==1.11
pyparsing==3.0.9
pypdf==3.8.1
PyPDF2==3.0.1
pyproject_hooks==1.0.0
python-crontab==2.7.1
python-dateutil==2.8.2
python-docx==0.8.11
python-dotenv==1.0.0
python-json-logger==2.0.7
python-magic==0.4.27
python-multipart==0.0.6
python-pptx==0.6.21
pytz==2023.2
PyYAML==6.0
pyzmq==25.0.0
qtconsole==5.5.1
QtPy==2.4.1
queuelib==1.6.2
rapidfuzz==3.5.2
redis==4.5.3
referencing==0.29.1
regex==2023.5.5
requests==2.31.0
requests-file==1.5.1
requests-toolbelt==1.0.0
responses==0.18.0
rfc3339-validator==0.1.4
rfc3986==1.5.0
rfc3986-validator==0.1.1
rich==13.0.1
rouge==1.0.1
roundrobin==0.0.4
rpds-py==0.9.2
safetensors==0.4.0
scikit-learn==1.3.1
scipy==1.10.1
Scrapy==2.11.0
Send2Trash==1.8.2
sentencepiece==0.1.99
service-identity==21.1.0
shellingham==1.5.4
six==1.16.0
smart-open==6.4.0
sniffio==1.3.0
soundfile==0.12.1
soupsieve==2.5
soxr==0.3.7
spacy==3.7.2
spacy-legacy==3.0.12
spacy-loggers==1.0.5
spark-submit==1.4.0
SQLAlchemy==2.0.15
sqlparse==0.4.3
srsly==2.4.8
stack-data==0.6.2
starlette==0.27.0
sympy==1.12
tenacity==8.2.2
terminado==0.18.0
thinc==8.2.1
threadpoolctl==3.2.0
tiktoken==0.4.0
tinycss2==1.2.1
tldextract==5.0.1
tokenizers==0.14.1
tomlkit==0.12.3
torch==2.1.0
torchvision==0.16.0
tornado==6.2
tqdm==4.66.2
traitlets==5.9.0
transformers==4.35.0
trove-classifiers==2023.11.14
Twisted==22.10.0
txaio==23.1.1
typer==0.9.0
types-python-dateutil==2.8.19.20240106
typing-inspect==0.9.0
typing_extensions==4.6.2
tzdata==2023.2
ujson==5.7.0
unstructured==0.6.8
uri-template==1.3.0
uritemplate==4.1.1
urllib3==2.0.2
uvicorn==0.22.0
uvloop==0.17.0
vine==5.0.0
virtualenv==20.24.6
w3lib==2.1.2
wasabi==1.1.2
watchfiles==0.19.0
wcwidth==0.2.6
weasel==0.3.4
webcolors==1.13
webencodings==0.5.1
websocket-client==1.7.0
websockets==11.0.3
Werkzeug==2.3.0
widgetsnbextension==4.0.10
wrapt==1.14.1
xatt
[truncated — 133 more characters]
```

### munchies/backend/main.py

```python
from fastapi import FastAPI
import googlemaps
import os
from dotenv import load_dotenv
import json
from supabase import create_client, Client
from fastapi.middleware.cors import CORSMiddleware
import postgrest
from pydantic import BaseModel

# to run: uvicorn main:app --reload

app = FastAPI()
load_dotenv()

origins = [
    "http://localhost:3000",
    "http://localhost:3001",
    "http://localhost:3001/chat/",
    "http://localhost:3001/chat/code/",
    "http://localhost:1420",
    "*",
]

app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

gmaps_api_key = os.getenv("GMAPS_API_KEY")
gmaps = googlemaps.Client(key=gmaps_api_key)

url: str = os.environ.get("SUPABASE_URL")
key: str = os.environ.get("SUPABASE_KEY")
supabase: Client = create_client(url, key)

@app.get("/nearby-restaurants/")
async def nearby_restaurants(latitude: float, longitude: float):
    # default location set to Jen Hsung
    places_result = gmaps.places_nearby(location=(37.42801109129112, -122.17436390356903), radius=1000, keyword='food')
    
    with open('stanford_menus.json', 'r') as file:
        menu_data = json.load(file)

    with open('stanford_imgs.json', 'r') as file:
        img_data = json.load(file)
    
    restaurants = []
    for place in places_result['results']:
        print(place)
        name = place.get('name')
        location = place.get('geometry', {}).get('location', {})
        restaurant = {'name': place.get('name'), 'address': place.get('vicinity'), 'location': location}
        
        if name in img_data:
            restaurant['img'] = img_data[name]
        
        if name in menu_data:
            restaurant['menu'] = menu_data[name]
        
        restaurants.append(restaurant)
    
    return {"nearby_restaurants": restaurants}

@app.get("/restaurant-details/")
async def restaurant_details(name: str):
    with open('stanford_menus.json', 'r') as file:
        data = json.load(file)
    
    print(data[name])
    return data[name]

@app.get("/nearby-requesters/")
async def nearby_requesters(latitude: float, longitude: float, radius: int):
    latitude, longitude = 37.42801109129112, -122.17436390356903
    
    response = supabase.table('requesters').select("*").execute()
    requesters = response.data

    # only get the requesters within radius
    nearby_requesters = []
    for requester in requesters:
        delivery_loc = (requester['delivery_lat'], requester['delivery_lng'])
        distance = gmaps.distance_matrix(delivery_loc, (latitude, longitude), mode='walking')
        if distance['rows'][0]['elements'][0]['distance']['value'] < radius:
            nearby_requesters.append(requester)
            
    return {"nearby_requesters": nearby_requesters}

@app.post("/create-request/")
async def create_request(requester_name: str, restaurant_name: str, delivery_lat: float, delivery_lng: float, expiry: str, order: str):
    # delivery_loc = {"latitude": 37.4380424, "longitude": -122.1642276}
    query_loc = (delivery_lat, delivery_lng)
    
    # get address of delivery location
    reverse_geocode_result = gmaps.reverse_geocode(query_loc)
    delivery_address = reverse_geocode_result[0]['formatted_address'] if reverse_geocode_result else "Address not found"

    # get nearest place with restaurant name from google maps
    places_result = gmaps.places_nearby(location=query_loc, radius=10000, keyword=restaurant_name)
    restaurant_loc = places_result['results'][0].get('geometry', {}).get('location', {})

    expiry = "2024-02-18T12:00:00Z"

    try:
        response = supabase.table('requesters').insert([{"name": requester_name, "restaurant_name": restaurant_name, "restaurant_lat": restaurant_loc['lat'], "restaurant_lng": restaurant_loc['lng'], "delivery_lat": delivery_lat, "delivery_lng": delivery_lng, "expiry": expiry, "order": order, "address": delivery_address}]).execute()
        print(response)
    except postgrest.exceptions.APIError as e:
        print(f"API Error: {e}")
        print(e.args)
        
@app.get("/nearby-donators/")
async def nearby_donators(latitude: float, longitude: float, radius: int):
    # latitude, longitude = 37.42801109129112, -122.17436390356903
    
    response = supabase.table('donaters').select("*").execute()
    donators = response.data

    nearby_donators = []
    for donater in donators:
        donater_loc = (donater['lat'], donater['lng'])
        distance = gmaps.distance_matrix((latitude, longitude), donater_loc, mode='walking')
        if distance['rows'][0]['elements'][0]['distance']['value'] < radius:
            nearby_donators.append(donater)
            
    return {"nearby_donators": nearby_donators}

@app.post("/create-donator/")
async def create_donator(name: str, items: str, latitude: float, longitude: float, expiry: str):
    expiry = "2024-02-18T12:00:00Z"
    try:
        response = supabase.table('donaters').insert([{"name": name, "items": items, "lat": latitude, "lng": longitude, "expiry": expiry, "fulfilled": False}]).execute()
    except postgrest.exceptions.APIError as e:
        print(f"API Error: {e}")
        print(e.args)

@app.get("/get-address/")
async def get_address(lat: float, lng: float):
    reverse_geocode_result = gmaps.reverse_geocode((lat, lng))
    return reverse_geocode_result[0]['formatted_address'] if reverse_geocode_result else "Address not found"
        
@app.get("/get-user/")
async def get_user(id: int):
    try:
        response = supabase.table('users').select("*").eq('id', id).execute()
        return response.data[0]
    except postgrest.exceptions.APIError as e:
        print(f"API Error: {e}")
        print(e.args)

@app.post("/create-user/")
async def create_user(name: str):
    try:
        response = supabase.table('users').insert([{"name": name, "points": 0}]).execute()
    except postgrest.exceptions.APIError as e:
        print(f"API Error: {e}")
        print(e.args)
        
class Upd
[truncated — 624 more characters]
```

### munchies/frontend/src/index.js

```javascript
import { ColorModeScript } from '@chakra-ui/react';
import React, { StrictMode } from 'react';
import * as ReactDOM from 'react-dom/client';
import App from './App';
import reportWebVitals from './reportWebVitals';
import * as serviceWorker from './serviceWorker';

const container = document.getElementById('root');
const root = ReactDOM.createRoot(container);

root.render(
  // <StrictMode>
  <>
  <ColorModeScript />
  <App />
  </>
  // </StrictMode>
);

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://cra.link/PWA
serviceWorker.unregister();

// 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();

```

### munchies/frontend/src/App.js

```javascript
import React, { useEffect, useState } from 'react';
import {
  ChakraProvider,
  theme,
  Image,
  Heading
} from '@chakra-ui/react';
import './App.css';
import MapComponent from './Map.js';
import ContainerComponent from './ContainerComponent.js';
import InfoBox from './InfoBox.js';
import bear from './munchies_logo.png'
import LoadingScreen from './LoadingScreen.js';

function App() {
  const currentUserId = 1;
  const [isLoading, setIsLoading] = useState(true);
  const [user, setUser] = useState(null);
  const [open, setOpen] = useState(false);
  const [mapWidth, setMapWidth] = useState('100%');
  const [requestingMode, setRequestingMode] = useState(false);
  const [mapMarginLeft, setMapMarginLeft] = useState('0px');
  const [restaurantActive, setRestaurantActive] = useState(false);
  const [restaurant, setRestaurant] = useState([]);
  const [donatorActive, setDonatorActive] = useState(false);
  const [donator, setDonator] = useState([]);
  const [requesterActive, setRequesterActive] = useState(false);
  const [requester, setRequester] = useState([]);
  const userUrl = `http://127.0.0.1:8000/get-user/?id=`;

  const handleLoadingComplete = () => {
    setIsLoading(false);
  };

  const fetchUser = (userId) => {
    fetch(userUrl + userId)
      .then((response) => response.json())
      .then((data) => {
        setUser(data);
      })
      .catch((error) => {
        console.error('Error fetching user data:', error);
    });
  };

  useEffect(() => {
    fetchUser(currentUserId);
  }, []);

  const openModal = () => {
    console.log('open modal');
    setOpen(true);
    setMapWidth('50%');
  }

  const closeModal = () => {
    console.log('close modal');
    setOpen(false);
    setMapWidth('100%');
  }

  return (
    <ChakraProvider theme={theme}>
    <div>
      {isLoading ? 
      <LoadingScreen onLoadingComplete={handleLoadingComplete} /> :
    
      <div className="App">
        <div style={{ display: 'flex', marginLeft: '80px', marginTop: '24px'}}>
            <Image src={bear} boxSize='60px'></Image>
            <div style={{padding: '12px'}}></div>
            <Heading>munchies</Heading>
        </div>
        
        {/* InfoBox and Map container */}

        <div style={{ display: 'flex', height: '100%', marginTop: '12px', marginLeft: '60px', marginRight: '60px', marginBottom: '60px' }}>
          {/* InfoBox (visible only when a user is clicked) */}
          
          {open && (
            <div style={{ flex: 1, padding: '12px'}}>
              <ContainerComponent
                height="100%">
                <InfoBox user={user} onClose={closeModal} setRequestingMode={setRequestingMode} restaurantActive={restaurantActive} restaurant={restaurant} donatorActive={donatorActive} donator={donator} requesterActive={requesterActive} requester={requester}/>
              </ContainerComponent>
            </div>
          )}
          {/* Map (width and margin-left controlled by state) */}
          <div
            style={{
              flex: '3',
              width: mapWidth,
              // marginLeft: mapMarginLeft,
              padding: '12px',
              boxSizing: 'border-box',
            }}>
            <ContainerComponent
              width="100%"
              height="700px"
              borderRadius="20px"
              borderColor="rgba(52, 152, 219, 0.5)"
            >
              <MapComponent requestingMode={requestingMode} setRestaurantActive={setRestaurantActive} setRestaurant={setRestaurant} setDonatorActive={setDonatorActive} setDonator={setDonator} setRequesterActive={setRequesterActive} setRequester={setRequester} userId={currentUserId} openModal={openModal} closeModal={closeModal} user={user} setUser={setUser}/>
            </ContainerComponent>
          </div>
        </div>
      </div>
    }
      </div>
      </ChakraProvider>
  );
}

export default App;

```

### munchies/frontend/tailwind.config.js

```javascript
/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    "./src/**/*.{js,jsx,ts,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}


```

### munchies/frontend/src/index.css

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

### munchies/frontend/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';

```

### munchies/frontend/src/App.test.js

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

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

```

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