dealstarter
v2.1237.1
Published
The Deal Starter Application
Downloads
3
Readme
DealStarter
DealStarter(DS) is Digital Retailing's off the shelf deal penciling widget.
Collaboration & List of Core Contributors
Domain Owning Team: GearShift
- (see Contributing Doc)
How to use DS
To use DS you simply have to sign up for an irrational amount of accounts across cox, drop a script tag on your site, call an exposed start method, and sell your first born to Digital Retailing.
Step 1 Sign up for Digital Retailing
Step 2 Drop script on a page your want the widget to show.
Step 3 Call start method with setup config when target div has loaded.
Paramter Store Setup
In order to make acquiring the ALKS keys transparent, you need to do initial setup using alks cli
. In order to do that, follow these steps:
npm install -g alks
if you haven't alreadyalks developer configure
and answer with the following answers (1 time operation):- ALKS server -
https://alks.coxautoinc.com/rest
- Network Username - Your Network username
- Network Password - Your Network password
- Save password - Y
- Please select your default ALKS account/role - Select your favorite account, recommended to be the one you use for debugging from
awsdrstnp
AWS Account - Please select your default output format -
export
- ALKS server -
Once this is done, npm start
will acquire keys for you so you can test.
NOTE: ALKS keys will last 12 hours, so automatic refresh of parameters after that period will stop working, but the service should continue to work with the current parameters.
How to run locally
(for instructions on using widget test with DealStarter read this)
Log into the MakeMyDeal NPM account, someone on your team should be able to provide credentials
Add routes to your local system using one of the following:
a. Clone Dr-System project and follow instructions in https://ghe.coxautoinc.com/DigitalRetailing/dr-system/blob/master/local-dev-proxy/local-proxy-docs.md.
We have an unified package.json (client & server) that expose this commands, if you wish to run only client or only server, these commands are available:
npm run client-serve
- runs client onlynpm run server-serve
- runs server onlynpm start
- runs both server and client AddTHEME=default
before the client to test with only one theme (no&&
needed)3(a). If you wish to run both client and server locally, you can do so with this command: `npm run serve` - runs both client and server
If you want to connect the server to a locally run DR Services API, run this command:
SERVICES_GATEWAY_PROTOCOL=http SERVICES_GATEWAY_HOST=127.0.0.1 SERVICES_GATEWAY_PORT=3000 npm run server-serve
To see your running code, you can go to a demo dealer like Aperture Demo Dealer. Navigate to a vehicle page. Once there, add a query parameter to the end of the url
dsEnv=local-ssl
.
If you use VSCode, you can run client on a terminal with npm run client-serve
and from VSCode go to the debugging tab and start server from the debugging dropdown, you will be able to setup breakpoints on server code if you debug from VSCode.
How to run automated tests
In terminal, run npm test
which will run server and client tests.
How to run locally-linked dependencies
- Navigate to dependency (e.g. dr-platform-shared) and run
npm link
. Repeat this step for all dependencies you need linked. - In DealStarter, for each dependency you want to link, run
npm link ${dependencyName}
such asnpm link @makemydeal/dr-platform-shared
. NOTE: In DealStarter, if you need to run an npm install for any reason and want to avoid having to relink your dependencies, runnpm run deeplink
. This will act as npm install while preserving local links. It does not create links for you, so you will have to run step 1 first to see a specific dependency linked on DealStarter.
To revert a locally linked dependency back to the latest published version, run the cutlink
command with the dependency.
Example: npm run cutlink dr-payment-redux
will revert @makemydeal/dr-payment-redux to it's published version in package.json
More on running dependencies locally here
How to test using a locally running instance of ShopperPlatform
npm run start-all
Runs both DealStarter and ShopperPlatform concurrently. This script makes the assumption that your DealStarter and ShopperPlatform repos are in the same directory.
How to test all themes locally
There is a dev helper which allows you to see all themes and easily switch between them. You can access it one of three ways:
- In the console, type:
showDevHelper()
- In the console, type:
devHelperUtils.open()
- Click inside the widget so that it is active. On your keyboard, press these keys:
up up down down left right left right
Testing Local Code against Production
Note: Requires a resource override plugin for your browser
Set NODE_ENV to production
NODE_ENV=production
Run both client and server
Set your plugin to route
https://{shop|accelerate}.dealer.com/static/ds/{liveVersion}/js/*
tohttps://dealstarter-client.makemydeal.dev/static/ds/{localVersion}/js/*
You can go one level up and remove thejs
on both if you want to test css or fonts
How to contribute
We thank you! We believe in our cause, but... we don't mind a little sleep either so if you follow the direction below we will owe you a beer (unless its a crap PR.. then you need to buy us one so we can get through reviewing it!).
- Submit an issue discussing the problem/iteration you would like to see.
- Branch off master, complete your work, submit PR.
- Please reference the submitted issue number in any PR with work against said issue.
- Merges should be squashed using conventional commits, so that we get our versioning working.
Please see CONTRIBUTING.md for more details.
How to test theme changes
THEME=sponsor1,sponsor2 npm run client-serve
it will compile only the themes listed (comma separated format), i.e THEME=default,lexus,toyota npm run client-serve
if you dont specify a sponsor or THEME it will compile all themes.
Requirements
- Node.js@dubnium
- Docker@latest
- [email protected]+
Getting started
npm install
npm run dev
Logging
Server Logging
Client Logging
Digital Retailing Client logger
Remote Logging
We do our remote logging using splunk. Our splunk data can be found at the following url: https://coxauto.splunkcloud.com/en-US/app/Agera/search
Common Search Terms
index="cai_mmd_preprod" eb_env="dr-dealstarter-dev" | search error
index="cai_mmd_prod" eb_env="dr-dealstarter-production-blue"
Troubleshooting
- If you see "https://undefined/js/validateInitState.chunk.js net::ERR_NAME_NOT_RESOLVED" the problem may be caused by having NODE_ENV defined (this is a known issue that will be resolved in future) - use
unset NODE_ENV
beforenpm run serve
to resolve issue.