Skip to content

Commit

Permalink
Change from Expo Router to React Navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidye007 committed Aug 30, 2024
1 parent 4c060f0 commit 7d46578
Show file tree
Hide file tree
Showing 26 changed files with 651 additions and 483 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ source/backend/receipt_parsing.ipynb
app.log
receiptplusenv/
__pycache__
.pyc
*.pyc
*.cpython*
Binary file modified source/backend/__pycache__/config.cpython-312.pyc
Binary file not shown.
113 changes: 106 additions & 7 deletions source/backend/call_api_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -37,7 +37,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 16,
"metadata": {},
"outputs": [
{
Expand All @@ -48,7 +48,7 @@
"{\n",
" \"message\": \"Togekiss logged in successfully.\"\n",
"}\n",
"<RequestsCookieJar[<Cookie session=.eJwlzjsOwjAMANC7ZGbIz3Hcc7BXdmxDxYDU0An17lRiefP7htV3m8-wfPbDbmHdNCwheRKu0TJkvnTvmRScmUttLUoGbVw0qZReB4sOQkPEZpl7Q4BCCRhYxTtmcncSGZQIpREMMEct0FOP5nUo4SgNYx85cgSrFK7IMW3_b-7vh722OcP5A2ymMv0.ZsjZ5w.jXekCTDa3xl0J-lBeQTxrNDOEHY for 127.0.0.1/>]>\n"
"<RequestsCookieJar[<Cookie session=.eJwlzjsOwjAMANC7ZGbIz3Hcc7BXdmxDxYDU0An17lRiefP7htV3m8-wfPbDbmHdNCwheRKu0TJkvnTvmRScmUttLUoGbVw0qZReB4sOQkPEZpl7Q4BCCRhYxTtmcncSGZQIpREMMEct0FOP5nUo4SgNYx85cgSrFK7IMW3_b-7vh722OcP5A2ymMv0.ZtDneA.tW2hxua77GLVohpI5IKt7Kg3xcw for 127.0.0.1/>]>\n"
]
}
],
Expand Down Expand Up @@ -134,7 +134,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -145,7 +145,7 @@
"{\n",
" \"message\": \"Togekiss logged in successfully.\"\n",
"}\n",
"<RequestsCookieJar[<Cookie session=.eJwlzjEOwjAMQNG7ZGaIHdeOew52lMQ2VAxILZ0QdycS89OX_ifdYvfjkdb3fvol3TZLayLskCkyj8agS1ciZ5JaW3SRilBcaywcylhY1B0CbSh3YpxdVSM07FlYDEaZ2rgheORCZarlHCWYu4K1jgKOjiS2aCvNRpoj5-H7_-b6uvtzO470_QGoMzGk.ZsjdAQ.3wC0wLatrECDJzKWAJeFDLemcUI for receiptplus.pythonanywhere.com/>]>\n"
"<RequestsCookieJar[<Cookie session=.eJwlzjEOwjAMQNG7ZGaIHdeOew52lMQ2VAxILZ0QdycS89OX_ifdYvfjkdb3fvol3TZLayLskCkyj8agS1ciZ5JaW3SRilBcaywcylhY1B0CbSh3YpxdVSM07FlYDEaZ2rgheORCZarlHCWYu4K1jgKOjiS2aCvNRpoj5-H7_-b6uvtzO470_QGoMzGk.ZtDj0w.1PntknUAbLUJdrKRMHO61pXH9iM for receiptplus.pythonanywhere.com/>]>\n"
]
}
],
Expand Down Expand Up @@ -271,7 +271,7 @@
},
{
"cell_type": "code",
"execution_count": 51,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -446,7 +446,106 @@
" response = requests.post(url, files=files, cookies = session_cookie)\n",
"\n",
"print('Response code: ' + str(response.status_code))\n",
"print(json.dumps(response.json(), indent=4))\n"
"print(json.dumps(response.json(), indent=4))\n",
"# print(response.json().keys())\n"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'location': '2746 NE 45th Street',\n",
" 'purchases': [{'name': 'TWIN BROOK MILK', 'price': 6.99, 'quantity': 1.0},\n",
" {'name': 'BTI DEPOSIT', 'price': 2.15, 'quantity': 1.0},\n",
" {'name': 'PROG SOUP', 'price': 1.49, 'quantity': 1.0},\n",
" {'name': 'PROGRESSO SOUP', 'price': 1.49, 'quantity': 1.0},\n",
" {'name': 'NEXCARE TAPE', 'price': 6.49, 'quantity': 1.0},\n",
" {'name': 'DAVES KILLER BREADQA', 'price': 4.99, 'quantity': 1.0},\n",
" {'name': 'GRAPES BLACK', 'price': 3.49, 'quantity': 2.33},\n",
" {'name': 'GRAPES BLACK', 'price': 3.49, 'quantity': 1.75},\n",
" {'name': 'EGGPLANT', 'price': 2.89, 'quantity': 1.0},\n",
" {'name': 'NAVELS CA', 'price': 1.99, 'quantity': 3.66},\n",
" {'name': 'DRIS STRWBRY', 'price': 7.99, 'quantity': 1.0},\n",
" {'name': 'GREEN BEANS', 'price': 2.99, 'quantity': 1.0},\n",
" {'name': 'ROMA TOMATO', 'price': 1.99, 'quantity': 1.58},\n",
" {'name': 'EGGPLANT', 'price': 2.89, 'quantity': 1.0},\n",
" {'name': 'BARTLETT ORG QA', 'price': 1.99, 'quantity': 3.64},\n",
" {'name': 'AVOCADO HASS', 'price': 2.99, 'quantity': 1.0},\n",
" {'name': 'CALB CRUNCHY LOOPS<+', 'price': 1.99, 'quantity': 1.0},\n",
" {'name': 'CALB LENTIL SNAPS <+', 'price': 1.99, 'quantity': 1.0},\n",
" {'name': 'CALB LENTIL SNAPS <t', 'price': 1.99, 'quantity': 1.0},\n",
" {'name': 'CALB CRUNCHY LOOPS<+', 'price': 1.99, 'quantity': 1.0},\n",
" {'name': 'TLMK SNCKNG CHEESEQA', 'price': 4.99, 'quantity': 1.0},\n",
" {'name': 'NTSW TOMATOES', 'price': 4.99, 'quantity': 1.0},\n",
" {'name': 'RASPBERRIES RED QA', 'price': 2.99, 'quantity': 1.0},\n",
" {'name': 'BANANAS', 'price': 0.69, 'quantity': 2.75},\n",
" {'name': 'BANA BAKING', 'price': 0.49, 'quantity': 3.82},\n",
" {'name': 'SIMPLE TRUTH EGGS', 'price': 5.49, 'quantity': 1.0},\n",
" {'name': 'CELSSN ICE TEA', 'price': 4.99, 'quantity': 1.0},\n",
" {'name': 'BROCCOL CROWNS', 'price': 2.99, 'quantity': 1.28}],\n",
" 'receipt_date': '10/21/23',\n",
" 'store': 'jobs.qfc.com',\n",
" 'total': 119.31}"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"receipt"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Response code: 500\n",
"{\n",
" \"error\": \"An unexpected error occurred\"\n",
"}\n"
]
}
],
"source": [
"url = 'https://receiptplus.pythonanywhere.com/api/receipts'\n",
"# url = 'http://127.0.0.1:5000/api/receipts'\n",
"receipt = response.json()\n",
"# seesion_cookie = ''\n",
"response = requests.post(url, json=receipt, cookies = session_cookie)\n",
"print('Response code: ' + str(response.status_code))\n",
"print(json.dumps(response.json(), indent=4))"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2023-10-21 00:00:00\n"
]
}
],
"source": [
"from datetime import datetime\n",
"\n",
"date_str = '10/21/23'\n",
"date_obj = datetime.strptime(date_str, '%m/%d/%y')\n",
"print(date_obj)"
]
},
{
Expand Down
Binary file modified source/backend/model/__pycache__/receipt.cpython-312.pyc
Binary file not shown.
Binary file modified source/backend/model/__pycache__/user.cpython-312.pyc
Binary file not shown.
11 changes: 11 additions & 0 deletions source/frontend/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import { NavigationContainer } from "@react-navigation/native";
import AuthStackNavigator from "./app/AuthStackNavigator";

export default function App() {
return (
<NavigationContainer>
<AuthStackNavigator />
</NavigationContainer>
);
}
24 changes: 0 additions & 24 deletions source/frontend/app/(tabs)/AccountTab.tsx

This file was deleted.

40 changes: 0 additions & 40 deletions source/frontend/app/(tabs)/HistoryTab.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions source/frontend/app/(tabs)/PriceWatchTab.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions source/frontend/app/(tabs)/SummaryTab.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions source/frontend/app/(tabs)/UserValidTab.tsx

This file was deleted.

79 changes: 0 additions & 79 deletions source/frontend/app/(tabs)/_layout.tsx

This file was deleted.

Loading

0 comments on commit 7d46578

Please sign in to comment.