# Project export: TAShopping

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: Cal Hacks 11.0
- Tagline: Tool Assisted Shopping; Accelerate your shopping to robot-like efficiency
- Devpost: https://devpost.com/software/tashopping
- GitHub: https://github.com/Turtdle/TAS-Shopping-2
- Demo: https://tas-frontend-backup.reflex.run/
- Result: winner (Reflex: Best app built using reflex.dev)
- Team: 1 GitHub contributor(s) — Sam (4 commits)

## Devpost submission (written by the team)

### Inspiration

Food is a basic human need. As someone who often finds themselves wandering the aisles of Target, I know firsthand how easy it is to get lost among the countless products and displays. The experience can quickly become overwhelming, leading to forgotten items and a less-than-efficient shopping trip. This project was born from the desire to transform that chaos into a seamless shopping experience. We aim to create a tool that not only helps users stay organized with their grocery lists but also guides them through the store in a way that makes shopping enjoyable and stress-free.

### What it does

TAShopping is a smart grocery list app that records your grocery list in an intuitive user interface and generates a personalized route in (almost) any Target location across the United States. Users can easily add items to their lists, and the app will optimize their shopping journey by mapping out the most efficient path through the store.

### How we built it

Data Aggregation: We utilized Selenium for web scraping, gathering product information and store layouts from Target's website. Object Storage: Amazon S3 was used for storing images and other static files related to the products. User Data Storage: User preferences and grocery lists are securely stored using Google Firebase. Backend Compute: The backend is powered by AWS Lambda, allowing for serverless computing that scales with demand. Data Categorization: User items are classified with Google Gemini API: AWS API Endpoint provides a reliable way to interact with the backend services and handle requests from the front end. Webapp: The web application is developed using Reflex, providing a responsive and modern interface for users. iPhone App: The iPhone application is built with Swift, ensuring a seamless experience for iOS users.

### Challenges we ran into

Data Aggregation: Encountered challenges with the rigidity of Selenium for scraping dynamic content and navigating web page structures. Object Storage: N/A (No significant issues reported) User Data Storage: N/A (No significant issues reported) Backend Compute: Faced long compute times; resolved this by breaking the Lambda function into smaller, more manageable pieces for quicker processing. Backend Compute: Dockerized various builds to ensure compatibility with the AWS Linux environment and streamline deployment. API: Managed the complexities of dealing with and securing credentials to ensure safe API access. Webapp: Struggled with a lack of documentation for Reflex, along with complicated Python dependencies that slowed development. iPhone App: N/A (No significant issues reported)

### Accomplishments we're proud of

Successfully delivered a finished product with a relatively good user experience that has received positive feedback. Achieved support for hundreds of Target stores across the United States, enabling a wide range of users to benefit from the app.

### What we learned

We learned a lot about: Gemini: Gained insights into effective data aggregation and user interface design. AWS: Improved our understanding of cloud computing and serverless architecture with AWS Lambda. Docker: Mastered the process of containerization for development and deployment, ensuring consistency across environments. Reflex: Overcame challenges related to the framework, gaining hands-on experience with Python web development. Firebase: Understood user authentication and real-time database capabilities through Google Firebase. User Experience (UX) Design: Emphasized the importance of intuitive navigation and clear presentation of information in app design. Version Control: Enhanced our collaboration skills and code management practices using Git.

### What's next

There are many exciting features on the horizon, including: Google SSO for web app user data: Implementing Single Sign-On functionality to simplify user authentication. Better UX for grocery list manipulation: Improving the user interface for adding, removing, and organizing items on grocery lists. More stores: Expanding support to additional retailers, including Walmart and Home Depot, to broaden our user base and shopping capabilities.

## README (from the GitHub repository)

# Grocery Store Route Optimization

Application to take grocery store shopping list and grocery store location and create an optimal store route to find all items in the shortest path possible; deploy on web android iphone

Example:

![Route Image](route_image.png)

# Route Creation API

This API allows you to create a route based on a given state, address, and grocery list. It returns an image of the generated route.

## Endpoint


`POST https://oj35b6kjt7.execute-api.us-west-2.amazonaws.com/default/`

valid functions are:

- `create_route`
- `get_categories`
- `get_route`
- `categorized_items`


## Authentication

Authentication is required for this API. Include your API key in the `x-api-key` header.

## Headers

| Header          | Value              | Description                             |
|-----------------|--------------------|-----------------------------------------|
| Content-Type    | application/json   | Specifies the request body format       |
| x-api-key       | Your-API-Key       | Your unique API key for authentication  |

## Request Body

The request body should be a JSON object with the following structure:

get_categories
```json
{
  "state": string,
  "address": string,
}
```

categorize_items
```json
{
  "categories": array of strings,
  "grocery_list": array of strings,
}
```

get_route and create_route
```json
{
  "state": string,
  "address": string,
  "grocery_dic": {
    "label":  array of strings
  }
}
```
### Fields

| Field         | Type     | Description                                        |
|---------------|----------|----------------------------------------------------|
| state         | string   | The state where the route should be created        |
| address       | string   | The full address for the route                     |
| grocery_list  | array    | An array of strings representing grocery categories|

## Response

### Success Response

- **Status Code:** 200 OK
- **Content-Type:** application/json

categorize_items
```json
{
  {
    "label":  array of strings
  }
}
```

get_categories
```json
{
  "labels": array of strings
}
```

get_route
```json
{
  "route": array of strings
}
```

create_route
```json
{
  "image": string
}
```

The `image` field contains a base64-encoded string representing the route image.

### Error Response

- **Status Code:** 4XX or 5XX
- **Content-Type:** application/json

```json
{
  "message": string
}
```

The `message` field contains information about the error.

## Example

### Request

```http
POST https://oj35b6kjt7.execute-api.us-west-2.amazonaws.com/default/create_route

Content-Type: application/json
x-api-key: vMEKwZ3DMH9CTzD0pmLcR5RQV95XeFoa2JjxyH89

{
  "state": "california",
  "address": "16858 Golden Valley Pkwy, Lathrop, CA 95330-8535",
  "grocery_dic": {
    "dairy": ["milk", "yogurt"],
  } 
}
```

### Response

```json
{
  "image": "base64_encoded_image_data"
}
```

## Notes

- The API key provided in the example (`vMEKwZ3DMH9CTzD0pmLcR5RQV95XeFoa2JjxyH89`) is just for demonstration purposes. Replace it with your actual API key; This key won't work. nice try


## Detected evidence (automated analysis)

Indexed codebase: 2557 recognized source files, 32000 KB.
- Anthropic (technology) — detected in the code
- C (language) — detected in the code
- C++ (language) — detected in the code
- CSS (language) — detected in the code
- JavaScript (language) — detected in the code
- Python (language) — detected in the code
- AWS (technology) — claimed on Devpost, not found in the code
- Firebase (technology) — claimed on Devpost, not found in the code
- Google Gemini (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (120 of 5742)

```
deployment_package_2/dockerfile
deployment_package_2/lambda_function.py
deployment_package_2/package/_yaml/__init__.py
deployment_package_2/package/annotated_types-0.7.0.dist-info/INSTALLER
deployment_package_2/package/annotated_types-0.7.0.dist-info/licenses/LICENSE
deployment_package_2/package/annotated_types-0.7.0.dist-info/METADATA
deployment_package_2/package/annotated_types-0.7.0.dist-info/RECORD
deployment_package_2/package/annotated_types-0.7.0.dist-info/WHEEL
deployment_package_2/package/annotated_types/__init__.py
deployment_package_2/package/annotated_types/py.typed
deployment_package_2/package/annotated_types/test_cases.py
deployment_package_2/package/anthropic-0.36.2.dist-info/INSTALLER
deployment_package_2/package/anthropic-0.36.2.dist-info/licenses/LICENSE
deployment_package_2/package/anthropic-0.36.2.dist-info/METADATA
deployment_package_2/package/anthropic-0.36.2.dist-info/RECORD
deployment_package_2/package/anthropic-0.36.2.dist-info/REQUESTED
deployment_package_2/package/anthropic-0.36.2.dist-info/WHEEL
deployment_package_2/package/anthropic/__init__.py
deployment_package_2/package/anthropic/_base_client.py
deployment_package_2/package/anthropic/_client.py
deployment_package_2/package/anthropic/_compat.py
deployment_package_2/package/anthropic/_constants.py
deployment_package_2/package/anthropic/_decoders/jsonl.py
deployment_package_2/package/anthropic/_exceptions.py
deployment_package_2/package/anthropic/_files.py
deployment_package_2/package/anthropic/_legacy_response.py
deployment_package_2/package/anthropic/_models.py
deployment_package_2/package/anthropic/_qs.py
deployment_package_2/package/anthropic/_resource.py
deployment_package_2/package/anthropic/_response.py
deployment_package_2/package/anthropic/_streaming.py
deployment_package_2/package/anthropic/_tokenizers.py
deployment_package_2/package/anthropic/_types.py
deployment_package_2/package/anthropic/_utils/__init__.py
deployment_package_2/package/anthropic/_utils/_logs.py
deployment_package_2/package/anthropic/_utils/_proxy.py
deployment_package_2/package/anthropic/_utils/_reflection.py
deployment_package_2/package/anthropic/_utils/_streams.py
deployment_package_2/package/anthropic/_utils/_sync.py
deployment_package_2/package/anthropic/_utils/_transform.py
deployment_package_2/package/anthropic/_utils/_typing.py
deployment_package_2/package/anthropic/_utils/_utils.py
deployment_package_2/package/anthropic/_version.py
deployment_package_2/package/anthropic/lib/__init__.py
deployment_package_2/package/anthropic/lib/_extras/__init__.py
deployment_package_2/package/anthropic/lib/_extras/_common.py
deployment_package_2/package/anthropic/lib/_extras/_google_auth.py
deployment_package_2/package/anthropic/lib/.keep
deployment_package_2/package/anthropic/lib/bedrock/__init__.py
deployment_package_2/package/anthropic/lib/bedrock/_auth.py
deployment_package_2/package/anthropic/lib/bedrock/_client.py
deployment_package_2/package/anthropic/lib/bedrock/_stream_decoder.py
deployment_package_2/package/anthropic/lib/bedrock/_stream.py
deployment_package_2/package/anthropic/lib/streaming/__init__.py
deployment_package_2/package/anthropic/lib/streaming/_messages.py
deployment_package_2/package/anthropic/lib/streaming/_prompt_caching_beta_messages.py
deployment_package_2/package/anthropic/lib/streaming/_prompt_caching_beta_types.py
deployment_package_2/package/anthropic/lib/streaming/_types.py
deployment_package_2/package/anthropic/lib/vertex/__init__.py
deployment_package_2/package/anthropic/lib/vertex/_auth.py
deployment_package_2/package/anthropic/lib/vertex/_client.py
deployment_package_2/package/anthropic/pagination.py
deployment_package_2/package/anthropic/py.typed
deployment_package_2/package/anthropic/resources/__init__.py
deployment_package_2/package/anthropic/resources/beta/__init__.py
deployment_package_2/package/anthropic/resources/beta/beta.py
deployment_package_2/package/anthropic/resources/beta/messages/__init__.py
deployment_package_2/package/anthropic/resources/beta/messages/batches.py
deployment_package_2/package/anthropic/resources/beta/messages/messages.py
deployment_package_2/package/anthropic/resources/beta/prompt_caching/__init__.py
deployment_package_2/package/anthropic/resources/beta/prompt_caching/messages.py
deployment_package_2/package/anthropic/resources/beta/prompt_caching/prompt_caching.py
deployment_package_2/package/anthropic/resources/completions.py
deployment_package_2/package/anthropic/resources/messages.py
deployment_package_2/package/anthropic/tokenizer.json
deployment_package_2/package/anthropic/types/__init__.py
deployment_package_2/package/anthropic/types/anthropic_beta_param.py
deployment_package_2/package/anthropic/types/beta_api_error.py
deployment_package_2/package/anthropic/types/beta_authentication_error.py
deployment_package_2/package/anthropic/types/beta_error_response.py
deployment_package_2/package/anthropic/types/beta_error.py
deployment_package_2/package/anthropic/types/beta_invalid_request_error.py
deployment_package_2/package/anthropic/types/beta_not_found_error.py
deployment_package_2/package/anthropic/types/beta_overloaded_error.py
deployment_package_2/package/anthropic/types/beta_permission_error.py
deployment_package_2/package/anthropic/types/beta_rate_limit_error.py
deployment_package_2/package/anthropic/types/beta/__init__.py
deployment_package_2/package/anthropic/types/beta/beta_cache_control_ephemeral_param.py
deployment_package_2/package/anthropic/types/beta/beta_content_block_param.py
deployment_package_2/package/anthropic/types/beta/beta_content_block.py
deployment_package_2/package/anthropic/types/beta/beta_image_block_param.py
deployment_package_2/package/anthropic/types/beta/beta_input_json_delta.py
deployment_package_2/package/anthropic/types/beta/beta_message_delta_usage.py
deployment_package_2/package/anthropic/types/beta/beta_message_param.py
deployment_package_2/package/anthropic/types/beta/beta_message.py
deployment_package_2/package/anthropic/types/beta/beta_metadata_param.py
deployment_package_2/package/anthropic/types/beta/beta_raw_content_block_delta_event.py
deployment_package_2/package/anthropic/types/beta/beta_raw_content_block_start_event.py
deployment_package_2/package/anthropic/types/beta/beta_raw_content_block_stop_event.py
deployment_package_2/package/anthropic/types/beta/beta_raw_message_delta_event.py
deployment_package_2/package/anthropic/types/beta/beta_raw_message_start_event.py
deployment_package_2/package/anthropic/types/beta/beta_raw_message_stop_event.py
deployment_package_2/package/anthropic/types/beta/beta_raw_message_stream_event.py
deployment_package_2/package/anthropic/types/beta/beta_text_block_param.py
deployment_package_2/package/anthropic/types/beta/beta_text_block.py
deployment_package_2/package/anthropic/types/beta/beta_text_delta.py
deployment_package_2/package/anthropic/types/beta/beta_tool_choice_any_param.py
deployment_package_2/package/anthropic/types/beta/beta_tool_choice_auto_param.py
deployment_package_2/package/anthropic/types/beta/beta_tool_choice_param.py
deployment_package_2/package/anthropic/types/beta/beta_tool_choice_tool_param.py
deployment_package_2/package/anthropic/types/beta/beta_tool_param.py
deployment_package_2/package/anthropic/types/beta/beta_tool_result_block_param.py
deployment_package_2/package/anthropic/types/beta/beta_tool_use_block_param.py
deployment_package_2/package/anthropic/types/beta/beta_tool_use_block.py
deployment_package_2/package/anthropic/types/beta/beta_usage.py
deployment_package_2/package/anthropic/types/beta/message_create_params.py
deployment_package_2/package/anthropic/types/beta/messages/__init__.py
deployment_package_2/package/anthropic/types/beta/messages/batch_create_params.py
deployment_package_2/package/anthropic/types/beta/messages/batch_list_params.py
deployment_package_2/package/anthropic/types/beta/messages/beta_message_batch_canceled_result.py
[5622 more files omitted for size]
```

### Dependencies

- deployment_package_2/package/requirements.txt: anthropic, google-generativeai
- deployment_package_2/requirements.txt: anthropic, google-generativeai
- deployment_package_3/package/requirements.txt: boto3
- deployment_package_3/requirements.txt: boto3
- deployment_package/package/requirements.txt: boto3, numpy, Pillow, requests
- deployment_package/requirements.txt: boto3, numpy, Pillow, requests

### Recent commits (newest first)

- YUMMERS
- balls
- cool commit message
- testapi
- 3
- 2
- init commit

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

### route-creation-api-docs.md

```markdown
# Route Creation API

This API allows you to create a route based on a given state, address, and grocery list. It returns an image of the generated route.

## Endpoint


POST https://oj35b6kjt7.execute-api.us-west-2.amazonaws.com/default/create_route


## Authentication

Authentication is required for this API. Include your API key in the `x-api-key` header.

## Headers

| Header          | Value              | Description                             |
|-----------------|--------------------|-----------------------------------------|
| Content-Type    | application/json   | Specifies the request body format       |
| x-api-key       | Your-API-Key       | Your unique API key for authentication  |

## Request Body

The request body should be a JSON object with the following structure:

get_categories
```json
{
  "state": string,
  "address": string,
}
```

categorize_items
```json
{
  "categories": array of strings,
  "grocery_list": array of strings,
}
```

get_route and create_route
```json
{
  "state": string,
  "address": string,
  "grocery_dic": {
    "category": array of strings,
    "labels": array of strings
  }
}
```

### Fields

| Field         | Type     | Description                                        |
|---------------|----------|----------------------------------------------------|
| state         | string   | The state where the route should be created        |
| address       | string   | The full address for the route                     |
| grocery_list  | array    | An array of strings representing grocery categories|

## Response

### Success Response

- **Status Code:** 200 OK
- **Content-Type:** application/json

```json
{
  "image": string
}
```

The `image` field contains a base64-encoded string representing the route image.

### Error Response

- **Status Code:** 4XX or 5XX
- **Content-Type:** application/json

```json
{
  "message": string
}
```

The `message` field contains information about the error.

## Example

### Request

```http
POST https://oj35b6kjt7.execute-api.us-west-2.amazonaws.com/default/create_route

Content-Type: application/json
x-api-key: vMEKwZ3DMH9CTzD0pmLcR5RQV95XeFoa2JjxyH89

{
  "state": "california",
  "address": "16858 Golden Valley Pkwy, Lathrop, CA 95330-8535",
  "grocery_list": ["bedding", "baby", "girls", "snacks", "seasonal", "pets"]
}
```

### Response

```json
{
  "image": "base64_encoded_image_data"
}
```

## Notes

- The API key provided in the example (`vMEKwZ3DMH9CTzD0pmLcR5RQV95XeFoa2JjxyH89`) is just for demonstration purposes. Replace it with your actual API key; This key won't work. nice try

```

### deployment_package_2/package/idna-3.10.dist-info/LICENSE.md

```markdown
BSD 3-Clause License

Copyright (c) 2013-2024, Kim Davies and contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

```

### deployment_package_3/requirements.txt

```
boto3
```

### deployment_package/requirements.txt

```
Pillow
requests
boto3
numpy
```

### deployment_package_2/requirements.txt

```
anthropic
google-generativeai
```

### deployment_package_2/dockerfile

```
FROM public.ecr.aws/lambda/python:3.12

COPY requirements.txt .

RUN pip install -r requirements.txt -t /var/task

COPY lambda_function.py /var/task/

CMD ["lambda_function.lambda_handler"]
```

### deployment_package/dockerfile

```
FROM public.ecr.aws/lambda/python:3.12

COPY requirements.txt .

RUN pip install -r requirements.txt -t /var/task

COPY lambda_function.py /var/task/

CMD ["lambda_function.lambda_handler"]
```

### deployment_package_3/dockerfile

```
FROM public.ecr.aws/lambda/python:3.12

COPY requirements.txt .

RUN pip install -r requirements.txt -t /var/task

COPY lambda_function.py /var/task/

CMD ["lambda_function.lambda_handler"]
```

### deployment_package_3/package/requirements.txt

```
boto3
```

### deployment_package/package/requirements.txt

```
Pillow
requests
boto3
numpy
```

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