- The API gateway currenty has only 1 route called /snapshot which links to the lambda function below
- Takes url query params userId, projectId and saveType
- Also recieves code as base64 encoded string in request body
- The lambda function recieves the userId, projectId, saveType (patch or snapshot) and the code
- The lambda function stores the code file into the S3 bucket under the user and project
- The code file is sent to the lambda function as a base64 encoded string and decoded in the lambda function
- Based on the save_type the file is saved under /snapshot or /patch
- Created s3 bucket
- Created lambda with S3 execution full access permissions
- Created API gateway
- The uploading to S3 and downloading from S3 flow is working - upload yjs data to S3 and getting the same data back. No corruption
- Started work on patches - very similar flow
- I tested patches working on local. Now I think i need a /history route for getting last x updates
- I also need to update the /snapshot route to apply patches on the latest update.