Skip to content

Commit

Permalink
update adr
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnmclean committed Feb 3, 2025
1 parent e59d7d7 commit 14be358
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
1 change: 0 additions & 1 deletion apps/sovoli.com/src/hooks/useAssetFileUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const useAssetFileUpload = ({
onFileUploaded,
uploadSignatures,
}: UseAssetFileUploadProps) => {
console.log(uploadSignatures);
const [files, setFiles] = useState<FileState[]>([]);

const uploadFile = useCallback(
Expand Down
21 changes: 14 additions & 7 deletions docs/adrs/0002-media-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,23 @@ We outgrew this very quickly as we needed to support uploading of images before

Method: **Compressed Signed Browser Upload**



We will run browser level compression so we can not only decrease the storage space requirement but also to improve the upload time, as in the case of *Annotations*, we need to send the image to the AI model very quickly.

```mermaid
We'll seed the react hook with a lit of upload signatures that will be used to upload images to cloudinary.

browser page is seeded with signature for uploading asset
user selects image
browser compresses and displays preview
image is uploaded using preloaded signature
image is uploaded to cloudinary and url returned
send that url to AI analysis
```mermaid
sequenceDiagram
SSR ->> Browser: Get list of upload signatures
Browser ->> Browser: Compress image & display preview
Browser ->> Browser: Check if signatures are available and valid
alt Signatures expired or empty
Browser ->> API: Request new upload signatures
API ->> Browser: Return new upload signatures
end
Browser ->> Cloudinary: Upload image using signature
Cloudinary ->> Browser: Return uploaded image data
```

Expand Down

0 comments on commit 14be358

Please sign in to comment.