https://github.com/hackoregon/team-roster-api
https://github.com/hackoregon/team-roster-api
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hackoregon/team-roster-api
- Owner: hackoregon
- Created: 2019-08-26T08:26:53.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T06:06:32.000Z (over 3 years ago)
- Last Synced: 2025-03-28T03:14:43.956Z (about 1 year ago)
- Language: Python
- Size: 23.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Team Roster API
This API uses a Google Sheet as a backend to power a Lambda API for the Hack Oregon team roster.
## API Function
The API function reads Google credentials from the AWS Parameter Store in order to read the team roster from a Google Sheet using the `gsheets` package.
## Resizer Function
The Resizer function runs every time a new image is added to the `hacko-profiles-original`. It resizes the image and uploads it to the same path in the `hacko-profiles-resized` bucket.
## Adding images
The easiest way to add images to the `hacko-profiles-original` bucket is to use the AWS CLI.
```
aws s3 cp --recursive . s3://hacko-profiles-original
```
## Deploying
Deploying these functions is more complicated than you might expect because they rely on packages that need to be bundled and uploaded along with the Python source. Further more, the resizer function requires PIL, which needs to be built for the architecture of underlying server (so much for serverless, amirite?).
It's all captured in a Makefile though.
`make vendor`: This will create a local `vendor` directory that includes all the requisite packages to be uploaded, including the Linux `PIL` precompiled via a `.whl` file.
`make package`: This will create zip files for each function by zipping the `vendor` dir and adding the source function to each bundle.
`make publish`: This will update the source code for the two Lambda functions.