Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aasmal97/arky-personal-website-aws-cdk
This describes and deploys all the infrastructure used in AWS to power the backend of my personal portfolio website.
https://github.com/aasmal97/arky-personal-website-aws-cdk
aws-cdk azure-computer-vision backend github-webhooks google-drive-api infastructure-as-code personal-website rest-api typescript
Last synced: 1 day ago
JSON representation
This describes and deploys all the infrastructure used in AWS to power the backend of my personal portfolio website.
- Host: GitHub
- URL: https://github.com/aasmal97/arky-personal-website-aws-cdk
- Owner: aasmal97
- Created: 2023-01-27T22:37:09.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-04T00:18:33.000Z (11 days ago)
- Last Synced: 2025-01-04T00:20:24.306Z (11 days ago)
- Topics: aws-cdk, azure-computer-vision, backend, github-webhooks, google-drive-api, infastructure-as-code, personal-website, rest-api, typescript
- Language: TypeScript
- Homepage: https://www.arkyasmal.com
- Size: 321 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Introduction
The purpose of this web application is to showcase the projects that Arky has created throughout his software development journey.This is the entire backend, deployed on AWS. The client side is deployed [here](https://arkyasmal.com)
If you are looking for the client side code go [here](https://github.com/aasmal97/Arky-Personal-Website-Client-Side)
## Notable Structure
This app is structured into 3 categories, with important functions associated with each
1. [Hosting](./app/lib/hosting/) contains the functions required to deploy cloudfront distributions, all domains, and s3 buckets.
2. [Rest API](./app/lib/restAPI/) contains the function to deploy the monolithic Rest API on API Gateway, as well as every lambda function connected to it.
3. [Webhooks](./app/lib/webhooks/) contains the functions that deploy a DynamoDB Table that is used to store webhook data, so a cron job can run and refresh them after expiration. This also contains the logic that deploys a seperate API on API Gateway that handles callback events from a github and google drive webhook event.
## Dependencies
This app uses a series of dependencies and you can check the list in the following [package.json file](./package.json). Most notably are the following:
1. [AWS CDK Lib](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-construct-library.html) which is used to deploy all AWS infastructure, as code.
2. [Google Apis](https://github.com/googleapis/google-api-nodejs-client) for creating webhooks on a personal google drive, that push changes to database when changes are made
3. [Jimp](https://github.com/jimp-dev/jimp) for programmatically editing images
4. [HTML to Text](https://github.com/html-to-text/node-html-to-text) for parsing through HTML, and allowing personal site to display information available to the public UI, but not available on it's public API
5. [Email validator](https://github.com/manishsaraan/email-validator) for validating email structures, and [date-fns](https://date-fns.org/) for validating dates
6. [Azure's Computer Vision AI API](https://azure.microsoft.com/en-ca/products/cognitive-services/computer-vision) that is used to generate a caption to an uploaded image.## Build + Deploy
#### Build
This project uses Typescript for type safety, however, AWS lambda functions cannot be written as such. Therefore, custom build steps are needed to compile typescript to javascript.This is automated by calling custom build scripts, included in the top-level directories (hosting, rest api and webhooks). These scripts use built-in node libraries, like ```execShellCommand``` and `fs` for initiating build actions, and copying resulting files into the build folder.
This works suprisingly well, and no issues have been observed so far. However, there is always a chance that files will take to long to copy, and cause a build failure.1. To build this project, to check for type saftey, run npm build
2. To build this project and migrate compiled files into a build folder and generate a cloudformation template, run ```npm bootstrap```#### Deployment
This project is auto deployed through a custom github action, that creates cloudformation templates and then auto deploys them to AWS.To initate the deploy process on your local machine you must:
1. Request access to an account on AWS, that has AWS Lambda, Route 53, API gateway, Cloudfront and/or DynamoDB access. You will only be able to change infastructure that your account has access to.
2. Run ```npm serve```