Olszewskidev / lens-up

LensUp is a web application that serves as a virtual gallery, allowing party guests to upload their photos from the event and also write down their wishes.
51 stars 2 forks source link
azure azure-functions azure-queue azure-table-storage dotnet monorepo react reactjs signalr tailwind-css tailwindcss web-api web-app webapi webapp websocket

LensUp

lens-up-logo


Have you ever attended a wedding or a birthday party? If yes, you probably saw photo booth there. You get in, take a photo and paste it in the guest book - simple and fun. But what if we could bring this fun into the digital world? This is where LensUp comes to the rescue. LensUp is a web application that serves as a virtual gallery, allowing party guests to upload their photos from the event and also write down their wishes.

:mega: Project status

The video shows the project status as of 08.06.2024 and the core functionality of the application. LensUp state

Previous status video: 26.04.2024

:rocket: 100 days roadmap

Conclusion: The main goal of 100 days plan is to deliver core functionality related to adding photos and wishes. I also want to do that without any extra cost for Azure services. So whole app should works on local environment with azure simulators like Azurite. This fact forces certain application architecture decisions, because not all Azure services can be simulated locally. Additionally MVP version doesn't focus on authentication, authorization and security.

Core functionality

lens-up-core-func

  1. Guest sees Gallery UI with other guest photos. He also sees QR code in the application corner.

  2. Guest scans QR code, which redirects him to Photo Collector UI and there he can upload photo and wishes.

  3. Photo Collector UI send data to Photo Collector Service.

  4. Photo Collector Service upload guest photo to blob storage.

  5. Photo Collector Service add guest data to database.

  6. Photo Collector Service publish event to queue.

  7. Gallery Service receive the event and process it.

  8. Gallery Service push notification about new photo in the gallery for Gallery UI, and then Gallery UI adds new guest photo to gallery collection.

LensUp big picture:

lens-up-big-picture

Description:

:bomb: How to run LensUp locally

You can run the project locally on your machine using Docker. Follow the steps below to run the application locally:

  1. Before we start you should generate dev-certs for LensUp on your machine. This operation is required to hosting ASP.NET Core images with Docker over HTTPS. So generate a certificate using these commands:

    dotnet dev-certs https -ep "%USERPROFILE%\.aspnet\https\lens-up.pfx" -p localCertPassword
    dotnet dev-certs https --trust

    Replace %USERPROFILE% with your computer name. Example "C:\Users\Dell Precision 7520\.aspnet\https\lens-up.pfx"

    For local development purposes, we will use the password localCertPassword. Do not change this, as the same password is used in the docker-compose.yml file.

    The above commands should generate a lens-up.pfx certificate, and should place it in the directory as shown in the screenshot below.

    lens-up-cert

    This is necessary step, because docker-compose refers to that certificate!

  2. Install docker desktop on your machine (skip if you already done it).

  3. Run your docker desktop application.

  4. In the main project directory (lens-up), where the docker-compose.yml file is located, run the command docker-compose build. This will build 7 necessary LensUp images. The first time build may take a few minutes (up to 10 minutes). After completing these steps, you should see new images in the Docker Desktop application.

    lens-up-docker-images

  5. After the build command, run the docker-compose up to start the entire infrastructure. You should see in Docker Desktop that 7 containers related to LensUp have been started.

    lens-up-containers

  6. Now the entire application is running on your machine. You can use the following addresses:

How to create your first gallery and have fun with LensUp?

  1. Go to LensUp.BackOfficeService.API - https://localhost:8085/swagger/index.html

  2. Use Create endpoint to create your gallery. The endpoint returns the gallery identifier after it is created (1).

    lens-up-create-endpoint

  3. Before using the gallery, we need to activate it. In that case use Activate endpoint and pass galleryId and endDate in request body. Remember the endDate is validated and must be greater than the current time. Otherwise, your gallery will be treated as expired. The endpoint returns the gallery enterCode after it is activated (1).

    lens-up-activate-endpoint

  4. With your gallery enterCode you can open your gallery using LensUp.GalleryService.UI - http://localhost:5001/

    Log in to your gallery using enterCode.

    lens-up-login-form

  5. Now you can scan gallery QR code and upload photos to it. The code redirects to a form for adding photos to the gallery. You can use browser tool to scan QR code or if it doesn't work you can just go to http://localhost:5002/upload-photo/{enterCode}.

    lens-up-gallery-qr-code

  6. QR Code redirects you to add photo and wishes form. Now you can upload your data to gallery.

    lens-up-gallery-qr-code

  7. After successfully completing the form, we should see success notification and the photo should appear in the gallery.

    lens-up-upload-flow

:clipboard: 100 days TODO list

General aspects:

Backend aspects:

Back Office Service:
Gallery Service:
Photo Collector Service:

Frontend aspects:

Back Office UI:
Gallery UI:
Photo Collector UI: