diff --git a/backend/db.js b/app/db/db.js similarity index 100% rename from backend/db.js rename to app/db/db.js diff --git a/backend/utils/arethereanynewitems.js b/app/lib/arethereanynewitems.js similarity index 100% rename from backend/utils/arethereanynewitems.js rename to app/lib/arethereanynewitems.js diff --git a/backend/utils/convertToDate.js b/app/lib/convertToDate.js similarity index 100% rename from backend/utils/convertToDate.js rename to app/lib/convertToDate.js diff --git a/backend/utils/scraptheitems.js b/app/lib/scraptheitems.js similarity index 100% rename from backend/utils/scraptheitems.js rename to app/lib/scraptheitems.js diff --git a/backend/utils/sendnotification.js b/app/lib/sendnotification.js similarity index 100% rename from backend/utils/sendnotification.js rename to app/lib/sendnotification.js diff --git a/backend/MarketAlert.js b/app/models/MarketAlert.js similarity index 89% rename from backend/MarketAlert.js rename to app/models/MarketAlert.js index 3c800c8..5150ac3 100644 --- a/backend/MarketAlert.js +++ b/app/models/MarketAlert.js @@ -1,5 +1,5 @@ const Sequelize = require("sequelize"); -const sequelize = require("./db.js"); +const sequelize = require("../db/db"); const MarketAlert = sequelize.define("market_alert", { id: { type: Sequelize.INTEGER, diff --git a/backend/.env b/backend/.env deleted file mode 100644 index c5ca10f..0000000 --- a/backend/.env +++ /dev/null @@ -1,19 +0,0 @@ -AWS_ENVIRONMENT=development -AWS_ACCESS_KEY_ID=your_key -AWS_SECRET_ACCESS_KEY=your_secret -AWS_PROFILE= -AWS_SESSION_TOKEN= -AWS_ROLE_ARN=your_amazon_role -AWS_REGION=us-east-1 -AWS_FUNCTION_NAME= -AWS_HANDLER=index.handler -AWS_MEMORY_SIZE=128 -AWS_TIMEOUT=3 -AWS_DESCRIPTION= -AWS_RUNTIME=nodejs6.10 -AWS_VPC_SUBNETS= -AWS_VPC_SECURITY_GROUPS= -AWS_TRACING_CONFIG= -AWS_LOGS_RETENTION_IN_DAYS= -EXCLUDE_GLOBS="event.json" -PACKAGE_DIRECTORY=build diff --git a/backend/.gitignore b/backend/.gitignore deleted file mode 100644 index c2658d7..0000000 --- a/backend/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/backend/README.md b/backend/README.md deleted file mode 100644 index c642703..0000000 --- a/backend/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# How to deploy automatically: - -1. set up aws cli with aws configure - diff --git a/backend/context.json b/backend/context.json deleted file mode 100644 index 9e26dfe..0000000 --- a/backend/context.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/backend/deploy.env b/backend/deploy.env deleted file mode 100644 index 71bbee5..0000000 --- a/backend/deploy.env +++ /dev/null @@ -1 +0,0 @@ -SECRET_VARIABLE=mysecretval diff --git a/backend/event.json b/backend/event.json deleted file mode 100644 index 61696a1..0000000 --- a/backend/event.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "key": "value", - "key2": "value2", - "other_key": "other_value" -} diff --git a/backend/event_sources.json b/backend/event_sources.json deleted file mode 100644 index c3aae42..0000000 --- a/backend/event_sources.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "EventSourceMappings": [ - { - "EventSourceArn": "your event source arn", - "StartingPosition": "LATEST", - "BatchSize": 100, - "Enabled": true - } - ], - "ScheduleEvents": [ - { - "ScheduleName": "node-lambda-test-schedule", - "ScheduleState": "ENABLED", - "ScheduleExpression": "rate(1 hour)", - "Input": - { - "key1": "value", - "key2": "value" - } - } - ], - "S3Events": [{ - "Bucket": "BUCKET_NAME", - "Events": [ - "s3:ObjectCreated:*" - ], - "Filter": { - "Key": { - "FilterRules": [{ - "Name": "prefix", - "Value": "STRING_VALUE" - }] - } - } - }] -} diff --git a/index.js b/index.js index 19ff662..d310870 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,10 @@ let express = require("express"); const path = require("path"); const bodyParser = require("body-parser"); -const MarketAlert = require("./backend/MarketAlert"); -const sendNotification = require("./backend/utils/sendnotification"); -const scrapTheItems = require("./backend/utils/scraptheitems"); -const sequelize = require("./backend/db.js"); +const MarketAlert = require("./app/models/MarketAlert"); +const sendNotification = require("./app/lib/sendnotification"); +const scrapTheItems = require("./app/lib/scraptheitems"); +const sequelize = require("./app/db/db"); const Twocheckout = require("2checkout-node"); const app = express();