This is the IBM Fotobox. Deploy your own Fotobox straight to the IBM Cloud access it directly from any device with browser and camera. Take pictures and view them all from your device.
The solution is based on:
- The "frontend" a Svelte Single Page Application(SPA) running as a Code Engine app, that is able to scale to 0 in oder to optimise cost.
- The "upload" function which generates a thumbnail of the image and stores both in COS written in Python and running as a Code Engine function.
- The "downloader" a Go program designed to serve the images stored in COS or download all at one go if you are the operator of the fotobox.
- All images are stored in IBM Cloud Object Storage to ensure security and scalability.
If you use your own machine you'll need to install the following (if not already installed) and make sure you have a IBM Cloud Account:
In order to make the setup as convenient as possible we probide you with a setup script which uses terraform and the IBM Cloud CLI
-
Configure the
terraform.auto.tfvarswith your apikey and your resource group id -
Run the
setup.sh <apikey>and it will deploy all the required components and done
-
Setup a COS instance and a COS bucket this can be done over the UI or using the CLI note dont the bucket name and API credentials
-
Deploy the "upload" function using the CLI
ibmcloud ce fn create --name fotobox-cos-upload --runtime python --build-source upload-function
-
Deploy the "download" app using the CLI
ibmcloud ce app create --name fotobox-get-pics --build-dockerfile Dockerfile --build-source download-app
-
Create a secret map containing the following values. Use the following command to create the password
echo -n "password" | sha256 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8
Secrets/environment variables
apikey="cos api key mus upload und download können" resource_instance_id="cos credential" bucket="mybucket" imageprefix="my-event-" passwords="5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8" -
Reference the full secret to the function and the app
-
inside the the stores.js replace the URLs to the upload function and download app
export const uploadURL = "<replace with public function url>"
export const downloadURL = "<replace with download app url"- Deploy the app with the updates
ibmcloud ce app create --name fotobox-frontend --build-dockerfile Dockerfile --build-source frontend-appNow the Fotobox should be deployed and usable