Order processing in a firebase database.
- Users, Products, Orders
- Data is structured as 3 seperate entities
- No IDs will be stored in the entities themselves
- Firebase will auto generate all IDs
{
"name": "John Smith",
"email": "john@smith.com"
}
{
"name": "Item1",
"amount": "399",
"currency": "gbp"
}
{
"userID": "<firebase-generated-user-id>",
"productID": "<firebase-generated-product-id>",
"payment": {
"cvc": "222",
"object": "card",
"exp_month": "10",
"exp_year": "2020",
"number": "5200 8282 8282 8210"
}
}
docker build -t firebase-order-processing . && docker run -it --rm firebase-order-processing
- builds application
- installs packages
- runs
npm run all
npm install
- install packages
npm start
- cleans
dist/folder - builds application
- runs setup
- runs test
- starts process ordering
npm run clean
- removes
dist/folder and creates a new one
npm run build
- converts flow types into regular es6
- puts newly built application into
dist/folder
npm run setup
- enter stripe key
- enter database url
- enter secrets
- initialize database
npm run initialize
- reinitializes the database to the test data
npm test
- sidekick
- jshint
- security issues
- check for TODOs
- outdated dependencies
- mocha
- istanbul coverage
- flow
npm run cover
- runs test
- runs istanbul coverage checks to make sure most lines are hit
npm run process
- connects to firebase database
- starts process ordering