A purly Flask commercial web app, using machine leanring to automatically label the uploaded images. This project has made with the purpose to demonstrate all the google technologies. Some technologies are included:
- Google App Engine
- Firebase Storage
- Firebase Authentication
- Firebase Database
- Google Storage Bucket
- Google Pub/Sub
- Google AutoML
- Google Vision API
- Stripe
- Google Cloud Function
- Go to Google Console to create new project.
- Search credentails and create the new credential, download credential file as a *.json file
- Go to Firebase Console and create new project. Copy the credential information and note somewhere to use later
- Install Google SDK, Python with seperate environment. If you don't mind to run in local environment, so install the all the necessary libraries from requirements.txt with the command: pip install -r requirements.txt
- Go to Google Console, select the menu storage and create a new bucket
- Go to Google Console, select pub-sub and create the following topic
- new-product
- payment-process
- payment-completion
- Go to app.py and change the os.environ['GOOGLE_APPLICATION_CREDENTIALS']=="path/to/your-credential.json
- Go to static/initFirebase.js and change the parameters to your firebase credential which you have when create the firebase application
- Go to Google Console, select the cloud function and create the two function
- First function: upload_image, copy the code in the main.py from the upload_image folder and choose HTTP as a trigger
- Second function: detect_label, copy the code in the main.py from the dectect_label folder and choose Pub/Sub as a trigger
- Go to Stripe Dashboard, create new project and change get the API key, change the API key in the stripe.js to the new API key.
- Go to Google Console, select App Engine and following the instruction
- Active the Google and Email authentication in Firebase Console.
- Deploy the application with google cloud sdk by following the command:
- gcloud init
- gcloud app deploy
The workflow of the application:
- User go the application and use google account as authentication
- Click to the sell button and upload the image.
- When user click the submit, the image will be stored in google storage, the detail is stored in firebase database, also the google cloud function will automatically detect the label for the image and assign the label for data.
- Customer can click add to cart to add the product to the cart
- Go to the cart and choose checkout
- Enter information and pay with the stripe.
The detail of how I constructed the application which integrate Google technologies will coming soon.
Some images of the application