Portfolio website built with React (Vite SPA). Hosting infrastructure — S3, CloudFront, API Gateway, Lambda, DynamoDB, and Cognito — is provisioned on AWS with Terraform.
frontend/ React + Vite single-page app
infra/terraform/ AWS infrastructure (Terraform); Lambda sources live in api/
infra/deploy/ Python helper that syncs the built frontend to S3 + invalidates CloudFront
scripts/ build.sh (build frontend), deploy.sh (deploy frontend), format.sh (format frontend + backend)
Terraform state is stored remotely in S3 (s3://dkavalchek-terraform), so Terraform can be
run from any machine with AWS credentials.
Pushes to main deploy automatically via GitHub Actions:
deploy-frontend.yaml— builds the frontend and uploads it on every push tomain.deploy-backend.yaml— runsterraform apply, but only when files underinfra/terraform/**change.
Pull requests are gated by validate.yaml (Prettier, terraform fmt -check, frontend build, terraform validate).
Requires the AWS CLI configured with credentials, plus Node, uv, and Terraform installed. All scripts can be run from any directory.
Frontend:
./scripts/build.sh # tsc + vite build -> frontend/dist
./scripts/deploy.sh # upload dist to S3 and invalidate the CloudFront cacheThe build reads VITE_API_URL, VITE_COGNITO_USER_POOL_ID, and
VITE_COGNITO_USER_POOL_CLIENT_ID from frontend/.env (see Terraform outputs for the values).
Backend (infrastructure):
First-time setup on a new machine or fresh checkout — run init once to configure the
S3 backend and download providers. State lives remotely in S3, so there is nothing to
create locally; init just connects this working directory to the existing state:
terraform -chdir=infra/terraform initinit is a per-checkout step (the .terraform/ directory it creates is git-ignored), and
needs to be re-run only when the backend or provider configuration changes. Once initialized:
terraform -chdir=infra/terraform plan # review changes
terraform -chdir=infra/terraform apply # provisionIf init reports a backend configuration mismatch, re-run it with -reconfigure.
npm install --prefix frontend
npm run dev --prefix frontend./scripts/format.sh