zwyeo / uChef-Microservice-ESD

ESD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

uchef

Additional Notes

Most of our development are done on MacOS. We have not tested our application extensively on Windows or Linux.

Microservices setup

Please make sure that you have docker running before proceeding further. Run the below command in your terminal upon loading up our application. Please also ensure that MAMP is running, and run the 2 sql files in src/data to create the Fairprice and ColdStorage schemas.

cd services
docker-compose build
docker-compose up

Kong Setup

  1. Access Konga interface via localhost:1337
  2. Login with any credentials
  3. Click on dashboard on the left and create a new connection (Name = default, Kong Admin URL = http://kong:8001)
  4. Click on snapshots on the left
  5. Import from file
  6. Import Uchef Kong.json file in the main folder
  7. Click on details after file is imported
  8. Click restore
  9. Tick all the checkboxes
  10. Click Import Objects

Required dependencies

Ensure that all dependencies are installed before running docker-compose build

Stripe CLI listener

This is for the stripe webhook to work. Please install the stripe CLI listener by following the steps below.

brew install stripe/stripe-cli/stripe
sudo stripe login --interactive

Use the following API key when prompted API key: sk_test_51MmDHTHHejWNjfqnvGdRbaOCNtclUwprKx9MZXPvtEuRwPnaXtQdXt9ROhbZ1yMhkUJHPhBjOwRLSoEW8ULlfsZM00TtyTrit9 Press 'Enter' when you see 'How would you like to identify this device in the Stripe Dashboard?'

Use the following command

sudo stripe listen --forward-to localhost:5001/stripe_webhook

If you do not have brew installed, then run the following command in your terminal.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Android Studio Device Emulator

This is to receive the push notification from the server (to simulate scenario 3). Please install Android Studio and use it to open the android project in the folder named android. You will need an apropriate emulator to run the application. In Android Studio, use Tools -> Device Manager -> Create Device to create a new emulator. The emulator must be running in order to receive the push notification. Our team used a Pixel 2 API Upside Down Cake to emulate the receipt of the push notification.

When running the application for the first time, a token will be generated by the emulator in the Android Studio terminal. Copy the token and paste it into services/fcm_cloud_messaging.py on line 13. This is to allow the server to send push notifications to the emulator.

Front end setup

Please make sure that you have node.js installed for this before proceeding further. Run the below command in your terminal upon loading up our application.

npm install
npm run serve

Then, use the following login credentials for testing:

Login: testuser1@gmail.com
Password: test123

Do not type in index.html into the address bar as it will not work. Just use the address given in the terminal (most likely localhost:8080) as the root is being intercepted by our App.vue. To terminate your session, simply press Ctrl + C on your terminal.

Credits

G2T2 - Douglas, Zhi Wei, Jaden, Joseph, Zu Yao

About

ESD


Languages

Language:Vue 73.6%Language:Python 13.0%Language:JavaScript 6.5%Language:Kotlin 3.1%Language:HTML 1.9%Language:CSS 1.1%Language:Dockerfile 0.9%