Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

IBM Fotobox

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.

Setup

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:

Automated Setup

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

  1. Configure the terraform.auto.tfvars with your apikey and your resource group id

  2. Run the setup.sh <apikey> and it will deploy all the required components and done

Manual setup

  1. 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

  2. Deploy the "upload" function using the CLI

    ibmcloud ce fn create --name fotobox-cos-upload  --runtime python  --build-source upload-function
  3. Deploy the "download" app using the CLI

    ibmcloud ce app create --name fotobox-get-pics --build-dockerfile Dockerfile  --build-source download-app
  4. 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"
    
  5. Reference the full secret to the function and the app

  6. 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"
  1. Deploy the app with the updates
ibmcloud ce app create --name fotobox-frontend --build-dockerfile Dockerfile  --build-source frontend-app

Now the Fotobox should be deployed and usable