This is a simple photo booth application that allows users to take pictures through a web interface on a gphoto2 compatible camera (I'm using a6400), and then send the pictures to an email address.
Note: This is some what of a work in progress, I was planning to use it at a Hackathon but I kept getting segfaults from the gphoto2 bindings.
Another note is that there is some "security" built into this application like the option to use https and a password to access the backend, but I wouldn't trust this too much.
There's two main components to this project, the website and the backend which controls the camera.
First you'll need to create frontend/.env
based on the frontend/.env-template
file. Here's a little more about each of the variables.
The frontend is a svelte application, so you'll need to install the dependencies and then can either build the application or run it in development mode.
npm install
npm run dev
The website will be available at http://localhost:3000
.
Like the website, you'll need to create backend/.env
based on the backend/.env-template
file. Here's a little more about each of the variables.
backend/simulated.mp4
.The backend is a python application that uses the gphoto2 bindings to control the camera. You'll need to install the dependencies and then can run the application.
You might need to install some dependencies for gphoto2 or the binary itself. I remember that I had to install some dependencies on my RaspberryPI to get it to work, although sorry I don't remember what they were.
pip install -r requirements.txt
python3 server.py
The backend will be available at http://localhost:8000
.
If you want to use SSL, you'll need to generate a certificate and key and put them in backend/ssl/cert.pem
and backend/ssl/key.pem
respectively. You can use the following commands to generate a self signed certificate and key.
openssl req -x509 -newkey rsa:4096 -keyout backend/ssl/key.pem -out backend/ssl/cert.pem -days 365 -nodes
Note: If you're using a self signed certificate, you'll need to open your backend url in a browser and accept the certificate before you can use it. I personally do this by going through the network tab, opening the failed request in a new tab by double clicking then hitting accept. When you refresh the website it should work.