Skip to content

Integrate Firebase #14

@6twenty

Description

@6twenty
  • All drawings are public, so no need for authentication
  • Hitting root URL initiates a blank canvas with a GUID (firebase IDs are quite long, but could have a database key with an incrementing number, which is converted to hexadecimal through hashid)
  • Hitting an ID URL, no extension fetches the path data and loads it; can continue editing (anyone can)
  • Hitting an ID URL with png extension - unsure how well this will work, but there's a node Canvas package which might allow generating the png on the fly (might need to see if response headers can be defined)
    • Check if a cached image exists in file storage; if not:
    • Retrieve path data from database
    • Render as single canvas (using same code as front-end download.js; ideally same source file)
    • Generate blob and create a file which is uploaded to file storage
    • Either the created file is simultaneously sent to the client (if possible) or we wait and redirect to the stored file
    • The file is stored using a key based on the ID of the drawing and a hash of the path data (so that the image is cached as long as the drawing remains the same)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions