The purpose of this project is to test out signed cookies/urls.
sequenceDiagram
participant web
participant api
participant db
participant cf as cloudfront
participant s3
web->>api: POST create file to upload
api->>db: create file record in db
db->>api: here's the file record
api->>web: here is where you'll upload that file
web->>cf: upload file
cf->>s3: file is getting uploaded
sequenceDiagram
participant web
participant api
participant db
participant cf as cloudfront
participant s3
web->>api: GET all files added
api->>db: Give me all of the file records
db->>api: Here are the file records
api->>web: file records are retrieved
The database is just mongo db served from docker. It stores file records which consists of a unique id, name of the file, and it's location within S3
The API is an express server that handles all of the file interactions. It is also responsible for doing the signing of the file url in S3 so that it can be viewed.
The infrastructure was setup using terraform
This S3 bucket was set up to be private and can only be accessed via Cloudfront
Cloudfront was used to be the entry point to the S3 bucket and set up to use a signing group which is used to determine who can have access to those files.