Serverless convex hull service implemented on AWS cloud
This is a web application built with various serverless AWS components for ECE465. The overarching goal was to learn more about how to build an application deeply integrated with cloud technologies in a practical way.
This application is a simple web-app that allows you to upload a 3D model .obj file, and calculates the convex hull using @markus-wa/quickhull-go. The website is built using the Vue 3 framework and uses THREE.js for 3D visualzation. This is statically hosted in an S3 bucket (the "website bucket"). The files for the convex hull operation are stored in another bucket (the "uploads bucket"). A user may trigger the upload of a 3D model or the calculation of its convex hull, via a request to the REST API interface created with API Gateway, which calls the lambda integration of the same name.
In the time provided, I was unable to build a full-scale web-application with user/identity support (via AWS Cognito) or database storage (via RDS). AWS Educate also does not support Route 53 nor Cloudfront, so they were also not implemented in the final solution.
For a future iteration, a higher-level website-building service, such as Lightsail, CloudFormation, or Amplify may be much more efficient, since there was a lot of (repetitive) setup for all the permissions to be correct. However, it was a good learning experience to try to set up these serverless components without one of these higher-level services.
See presentation slide deck here.
See video presentation here.
See BUILD.md and INSTALL.md.
- Access to uploads bucket by presigned URLs only.
- Appopriate CORS headers for website use.
- Presign lambda has read access to uploads bucket.
- Convex hull lambda has GET/PUT access to uploads bucket.
- Presign endpoint calls presign lambda.
- Convex hull endpoint calls convex hull lambda.
- API Gateway stage has logging set up. 8 Each lambda has logging set up (to different loggroups).
- Lambdas need access to uploads bucket.
- Route 53 acts as a DNS server.
- Cloudfront acts as a CDN for the website, uploads bucket, API Gateway, and authorization page. It also supports HTTPS (necessary for Cognito).
- Cognito authorizes API requests using the users access token.
- Authorization lambda verifies the user's access token.
- Listmodels endpoint calls listmodels lambda.
- Listmodels lambda retrieves models entries from database.
- New model lambda creates new model entry in database.
- Listmodels/Newmodel lambdas require permissions for RDS.
- On new upload (PUT request) or creation of a hull (a new model), newmodel lambda will trigger.
- assets/: AWS architecture diagram
- aws_res/: AWS policy files for deploy scripts
- res/: sample files for test usage (e.g., .obj 3D model files)
- scripts/: Makefile subscripts for AWS deployment
- src/:
- src/chfrontend/: Vue 3 application frontend
- src/chhull/: convex hull lambda
- src/chpresign/: presign lambda
- src/chutil/: util package for generating random keys for lambdas
- src/convexhull/: 2D convexhull implementation*
- src/main/: driver for testing 3-D convex hull locally*
- src/objio/: util package for reading/dumping .obj 3D files
- src/qh3d/: my own attempt at writing a 3-D quickhull, largely based on the Java QuickHull3D; only got up to creating a simplex*
- Makefile: top-level Makefile and configuration
- BUILD.md: build instructions and prerequisites
- INSTALL.md: instructions to deploy to AWS cloud
- README.md: this file
*: These files were used when I was testing convex hull, but are not part of the serverless web-app.
