From dc34ed6ae8527f04c7bfbe4f11d62a693991e5f4 Mon Sep 17 00:00:00 2001 From: Nathan Tarbert Date: Wed, 15 Nov 2023 10:50:14 -0500 Subject: [PATCH 1/5] changed the breaking build constructor variable from to . Also added to the README because if we don't do a build we get a path error from ./website/build --- .DS_Store | Bin 0 -> 6148 bytes README.md | 8 +++++--- dynamodb.w | 6 +++--- main.w | 2 +- website/.env | 1 + 5 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 .DS_Store create mode 100644 website/.env diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..298c87eb85dc04557e8acf106c057db93d507b30 GIT binary patch literal 6148 zcmeHKOG-mQ5UkdK0XJE?oGW;PA;c5p0znKR5F+@?_N_dZM@#hwF}!3WxRGk;u9=>$ zdAwS@eht9p?@#x@48WA`h))k=^Kgc<-f6Zxa=zfE17d-wOEmq0t?C;gA@g4u%*3h!dv6 zxQ=e=-93_9~cC+cUwb&*MdzgFM~PrenX literal 0 HcmV?d00001 diff --git a/README.md b/README.md index dbc68f5..53b06db 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Battle of the Bites! -***Get ready to indulge your taste buds and crown the ultimate culinary champion in Battle of the Bites!*** 🍔🍕🍣 +**_Get ready to indulge your taste buds and crown the ultimate culinary champion in Battle of the Bites!_** 🍔🍕🍣 Swipe, vote, and savor the showdown as iconic dishes from around the world go head-to-head in a gastronomic clash like no other. Will pizza outflavor sushi? Can burgers grill their way to victory over tacos? @@ -19,6 +19,7 @@ Inspired by https://eloeverything.co/. To deploy your own copy of the app, first make sure you have AWS credentials configured in your terminal for the account and region you want to deploy to. Then: + 1. Clone this git repository. 2. Compile the project to AWS (with Terraform) using `wing compile -t tf-aws main.w`. 3. Run `cd target/main.tfaws` to find your deployment artifacts. @@ -29,11 +30,12 @@ Then: 1. Clone this git repository. 2. Run `cd website`. 3. Run `npm install`. -4. Create a file at `website/public/config.json` that contains the following: +4. Run `npm run build`, +5. Create a file at `website/public/config.json` that contains the following: ```json { - "apiUrl": "", + "apiUrl": "" } ``` diff --git a/dynamodb.w b/dynamodb.w index 6726c01..c8a54cb 100644 --- a/dynamodb.w +++ b/dynamodb.w @@ -33,7 +33,7 @@ pub class DynamoDBTableSim { key: str; data: cloud.Bucket; - init(props: DynamoDBTableProps) { + new(props: DynamoDBTableProps) { this.key = "data.json"; this.data = new cloud.Bucket(); this.data.addObject(this.key, "[]"); @@ -76,7 +76,7 @@ pub class DynamoDBTableAws { pub table: tfaws.dynamodbTable.DynamodbTable; tableName: str; hashKey: str; - init(props: DynamoDBTableProps) { + new (props: DynamoDBTableProps) { this.hashKey = props.hashKey; this.table = new tfaws.dynamodbTable.DynamodbTable( name: "${this.node.id}-${this.node.addr.substring(this.node.addr.length - 8)}", @@ -171,7 +171,7 @@ pub class DynamoDBTable { tableSim: DynamoDBTableSim?; tableAws: DynamoDBTableAws?; - init(props: DynamoDBTableProps) { + new (props: DynamoDBTableProps) { let target = util.env("WING_TARGET"); if target == "sim" { this.tableSim = new DynamoDBTableSim(props); diff --git a/main.w b/main.w index 0a4ebab..205df7a 100644 --- a/main.w +++ b/main.w @@ -56,7 +56,7 @@ class Util { class Store { table: ddb.DynamoDBTable; - init() { + new () { this.table = new ddb.DynamoDBTable(hashKey: "Name") as "Entries"; } diff --git a/website/.env b/website/.env new file mode 100644 index 0000000..4a0e998 --- /dev/null +++ b/website/.env @@ -0,0 +1 @@ +APIURL=https://a08y7o68y8.execute-api.us-east-1.amazonaws.com/development \ No newline at end of file From effe27f8d45072ca21072fde269770cf8432d2b5 Mon Sep 17 00:00:00 2001 From: Nathan Tarbert <66887028+NathanTarbert@users.noreply.github.com> Date: Wed, 15 Nov 2023 07:58:30 -0800 Subject: [PATCH 2/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 53b06db..00858ae 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Then: ```json { - "apiUrl": "" + "apiUrl": "", } ``` From f1e4fa4f92182d176ec6352c939fa3c7f69cd39c Mon Sep 17 00:00:00 2001 From: Nathan Tarbert <66887028+NathanTarbert@users.noreply.github.com> Date: Wed, 15 Nov 2023 07:58:45 -0800 Subject: [PATCH 3/5] Delete website/.env --- website/.env | 1 - 1 file changed, 1 deletion(-) delete mode 100644 website/.env diff --git a/website/.env b/website/.env deleted file mode 100644 index 4a0e998..0000000 --- a/website/.env +++ /dev/null @@ -1 +0,0 @@ -APIURL=https://a08y7o68y8.execute-api.us-east-1.amazonaws.com/development \ No newline at end of file From 498dccf82cbdec440fd733b9a22612fe1358e459 Mon Sep 17 00:00:00 2001 From: Nathan Tarbert <66887028+NathanTarbert@users.noreply.github.com> Date: Wed, 15 Nov 2023 08:51:07 -0800 Subject: [PATCH 4/5] Update dynamodb.w --- dynamodb.w | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dynamodb.w b/dynamodb.w index c8a54cb..8654e49 100644 --- a/dynamodb.w +++ b/dynamodb.w @@ -76,7 +76,7 @@ pub class DynamoDBTableAws { pub table: tfaws.dynamodbTable.DynamodbTable; tableName: str; hashKey: str; - new (props: DynamoDBTableProps) { + new(props: DynamoDBTableProps) { this.hashKey = props.hashKey; this.table = new tfaws.dynamodbTable.DynamodbTable( name: "${this.node.id}-${this.node.addr.substring(this.node.addr.length - 8)}", @@ -171,7 +171,7 @@ pub class DynamoDBTable { tableSim: DynamoDBTableSim?; tableAws: DynamoDBTableAws?; - new (props: DynamoDBTableProps) { + new(props: DynamoDBTableProps) { let target = util.env("WING_TARGET"); if target == "sim" { this.tableSim = new DynamoDBTableSim(props); From ada8c3b5172873078a36b2a559b188d37d7a523f Mon Sep 17 00:00:00 2001 From: Nathan Tarbert <66887028+NathanTarbert@users.noreply.github.com> Date: Wed, 15 Nov 2023 08:53:17 -0800 Subject: [PATCH 5/5] Update main.w --- main.w | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.w b/main.w index 205df7a..c29ff82 100644 --- a/main.w +++ b/main.w @@ -56,7 +56,7 @@ class Util { class Store { table: ddb.DynamoDBTable; - new () { + new() { this.table = new ddb.DynamoDBTable(hashKey: "Name") as "Entries"; }