InvTrack / invtrack

GNU General Public License v3.0
1 stars 1 forks source link

summer project: golang image service #192

Open michalstruck opened 2 months ago

michalstruck commented 2 months ago

Working on invtrack became more of a chore to me, so to cheer myself up I decided to build a project I've had in mind for a couple weeks now. In essence, it'll be a microservice written in Go, used to transform images. We'll have cloud storage (not sure where yet), most (or all?) image requests will be passed through this service. Main task of the service is to downscale and crop images.

This would be useful if we wanted to store invoice/sales raport images taken from the app, and then provide thumbnails.

Or if we wanted to store and scan a high res image of an invoice. A necessary prerequisite is a cropped image creator in the app - to send only the relevant part to azure, and keep within the file size limits there. We'd send it through the image service, it'd be converted to grayscale (to save space and improve readability), then passed on to our cloud storage. In the meantime, based on the polygon bounds provided in the initial request the image would be cropped. That cropped image would be then passed to the corresponding edge function and a response from that would be finally returned. To reiterate: send image + more data to image service --> convert to grayscale --> store in the cloud In the meantime: crop converted image --> send to edge function to extract data --> return edge function response.

Notes: supabase-auth for auth, use a FROM scratch docker image to deploy the service 😁

Maybe it'd be a good idea to create it as a separate package, instead of inside the monorepo