#SmallBusinessWeek Hackathon 2018
Sponored by U.S. Small Business Administration & Visa
Import excel files to gain access to rich analytics. A sample excel file can be found here.
- View average customer queue time for your establishments with
Powered by Visa: Wait Time - See merchant locations on a map with
Powered by Visa: Merchant Locations - See consumer spending over time
- Track pareto distributions of your customers
- Identify your data trends by any time range
- Find trending products with the
Abnormal Product Trendscard - Find
Customer Spendinghabits by inspecting products - Identify upward and downward trending produts with the
Popular Itemscard - Track revenue over
Total Ordersas well asProduct Totals - Quickly Identify Top selling products
Setup elasticsearch:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.tar.gz
tar xvf elasticsearch-6.2.4.tar.gz
bin/elasticsearch-plugin install x-pack
bin/elasticsearch
Create elastic search indicies:
curl -XPUT 'localhost:9200/_template/wait' -H 'Content-Type: application/json' -d '{ "index_patterns": ["wait*"], "settings": { "number_of_shards": 1 }, "mappings" : { "wait" : { "properties" : { "timestamp" : { "type": "date", "format" : "epoch_millis" }, "name" : { "type" : "keyword" }, "wait" : { "type" : "long" } } } }}'
curl -XPUT 'localhost:9200/_template/product' -H 'Content-Type: application/json' -d '{ "index_patterns": ["product*"], "settings": { "number_of_shards": 1 }, "mappings" : { "product" : { "properties" : { "Country" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }, "CustomerID" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }, "Description" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }, "InvoiceDate" : { "type" : "date", "format" : "epoch_millis" }, "InvoiceNo" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }, "Quantity" : { "type" : "long" }, "StockCode" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }, "UnitPrice" : { "type" : "long" } } } } }'
curl -XPUT 'localhost:9200/_template/sba' -H 'Content-Type: application/json' -d '{ "index_patterns": ["sba-*"], "settings": { "number_of_shards": 1 }, "mappings" : { "retail" : { "properties" : { "Country" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }, "CustomerID" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }, "Description" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }, "InvoiceDate" : { "type" : "date", "format" : "epoch_millis" }, "InvoiceNo" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }, "Quantity" : { "type" : "long" }, "StockCode" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }, "UnitPrice" : { "type" : "long" }, "latLong":{"type":"geo_point"} } } } }'
Setup Kibana
https://artifacts.elastic.co/downloads/kibana/kibana-6.2.4-darwin-x86_64.tar.gz
tar xvf kibana-6.2.4-darwin-x86_64.tar.gz
bin/kibana
Import dashboards
Management > Saved objects > Import: dashboard.json & visualizations.json
Sign up for a visa developer account to get access to visa enriched data.
- Create a new project and allow
- Visa Query Insights
- Merchant Search
- Download your
privateKey.pem - Download other credentials (User ID, Password, Visa Development Platform Certificate)
Import the cert to a local keystore
openssl pkcs12 -export -in cert.pem -inkey "privateKey.pem" -certfile cert.pem -out myProject_keyAndCertBundle.p12
keytool -importkeystore -srckeystore myProject_keyAndCertBundle.p12 -srcstoretype PKCS12 -destkeystore myProject_keyAndCertBundle.jks
keytool -list -v -keystore myProject_keyAndCertBundle.jks
Start the wait time monitor (refreshes every 30 seconds):
sbt run WaitTimeCron
Import your csv:
sbt run Main retail.csv




