You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -31,37 +36,46 @@ Originally designed as a zero-ingress VM-based setup (using Cloudflare tunnels a
31
36
We eliminated all long-lived Google Cloud Service Account JSON keys from GitHub Secrets. The deployment pipeline authenticates securely using short-lived OpenID Connect (OIDC) tokens through GCP Workload Identity Federation, drastically reducing the security risk profile.
32
37
33
38
### 2. Fully Managed Serverless Hosting
34
-
Migrated from a self-managed `e2-micro` VM to **Google Cloud Run**. The application scales down to zero instances when idle, removing host OS maintenance, security patching overhead, and daemon service monitoring.
39
+
Migrated from a self-managed `e2-micro` VM to **Google Cloud Run**. Both the static web app and the visitor tracker microservice are hosted on Cloud Run. The services scale down to zero instances when idle, removing host OS maintenance and daemon service monitoring.
35
40
36
-
### 3. State-Locked Declarative IaC
37
-
The infrastructure (Cloud Run service and public IAM bindings) is defined declaratively using **Terraform** with state locked in a **GCS Remote Backend**. The pipeline automatically applies modifications on push to the `main` branch.
41
+
### 3. Serverless Go & Firestore Visitor Analytics
42
+
Implemented a custom visitor and active session tracker API in **Go (Golang)**. It connects to **Google Cloud Firestore (Native Mode)** to record live session metadata and atomically increment unique site views.
43
+
-**Resource Footprint Optimization:** The Go microservice runs within a resource-restricted container limited to `128Mi` memory, utilizing `cpu_idle = true` to throttle CPU during inactivity, reducing idle container costs to zero.
44
+
-**Session Lifecycle & Bloat Prevention:** The API writes ephemeral active session documents and executes auto-eviction queries to delete sessions older than 5 minutes, preventing Firestore database bloat.
45
+
-**Cache Control & CORS:** Sends strict no-cache headers to ensure metrics remain fresh, and includes proper CORS configuration for seamless client integration.
38
46
39
-
### 4. LaTeX Resume Automation with Caching
47
+
### 4. State-Locked Declarative IaC
48
+
The infrastructure (Cloud Run services and public IAM invoker bindings) is defined declaratively using **Terraform** with state locked in a **GCS Remote Backend**. The pipeline automatically applies modifications on push to the `main` branch.
49
+
50
+
### 5. LaTeX Resume Automation with Caching
40
51
The pipeline compiles `resume.tex` to `resume.pdf` during the workflow run. To optimize deployment speed, `actions/cache` is used to cache `resume.pdf` based on the hash of `resume.tex`.
41
-
***Deployment Optimization:** If `resume.tex` has not changed, the LaTeX setup and compilation step are skipped completely, saving ~1.5 minutes per run.
52
+
-**Deployment Optimization:** If `resume.tex` has not changed, the LaTeX setup and compilation step are skipped completely, saving ~1.5 minutes per run.
42
53
43
-
### 5. Runtime Hardening
44
-
The portfolio is served using `nginxinc/nginx-unprivileged:1.27.0-alpine-slim` running on non-root UID 101, safeguarding the environment against container-escape vulnerabilities.
54
+
### 6. Runtime Hardening
55
+
The portfolio frontend is served using `nginxinc/nginx-unprivileged:1.27.0-alpine-slim` running on non-root UID 101, safeguarding the environment against container-escape vulnerabilities.
45
56
46
57
---
47
58
48
59
## 📂 Repository Structure
49
60
50
-
*`main.tf` : Terraform configuration for the Cloud Run v2 service and public access bindings (`roles/run.invoker` for `allUsers`).
61
+
*`main.tf` : Terraform configuration for both the frontend and tracker API Cloud Run services, including public access bindings (`roles/run.invoker` for `allUsers`).
51
62
*`variables.tf` : Declarative input variables for container tags.
52
63
*`Dockerfile` : Configured to optionally copy `resume.pdf` using wildcards to protect local/dev builds if the PDF hasn't been compiled locally.
53
-
*`index.html` : The main web page detailing the 4-phase architectural evolution.
64
+
*`index.html` : The main web page detailing the 4-phase architectural evolution and displaying live session stats in the footer.
54
65
*`resume.tex` : The LaTeX source file for the professional resume.
-`main.go` : The Go listener with Firestore SDK integrations, CORS, and cleanup routines.
68
+
-`Dockerfile` : Multi-stage build (`golang:alpine` to `alpine:latest`) to produce a highly-minimized execution image.
69
+
*`.github/workflows/deploy.yml` : Secure CI/CD workflow utilizing OIDC auth, LaTeX caching, Docker builds for both containers, and Terraform apply.
56
70
57
71
---
58
72
59
73
## ⚙️ Automated Deployment Flow
60
74
61
75
1.**Change Detection & Cache Check:** GitHub Actions checks if `resume.tex` has changed. If unchanged, it restores `resume.pdf` from the cache.
62
76
2.**LaTeX Compilation (Conditional):** If the cache is missed, it compiles `resume.tex` into `resume.pdf`.
63
-
3.**Hardened Containerization:** The runner builds the unprivileged Nginx image, copying both `index.html`and `resume.pdf` (if present) into the image, and pushes it to GCP Artifact Registry using OIDC authentication.
64
-
4.**Declarative Deploy:** Runs `terraform init` and `terraform apply` using the new image tag, deploying the service and ensuring public web ingress access.
77
+
3.**Hardened Containerization:** The runner builds the unprivileged Nginx frontend imageand the compiled Go tracker API image, pushing both to GCP Artifact Registry using OIDC authentication.
78
+
4.**Declarative Deploy:** Runs `terraform init` and `terraform apply` using the new image tags, deploying/updating both Cloud Run services and ensuring public web ingress access.
Copy file name to clipboardExpand all lines: resume.tex
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -94,6 +94,13 @@ \section{Technical Projects}
94
94
\item Hardened application deployments by using rootless, unprivileged Docker containers and enforcing E2E strict HTTPS, DNSSEC, and HSTS policies at the Cloudflare Edge to minimize the system attack surface.
\item Developed a lightweight, low-latency API in \textbf{Go (Golang)} to track live website sessions and unique page views, running on an optimized \textbf{Google Cloud Run} container.
100
+
\item Integrated \textbf{Google Cloud Firestore (Native Mode)} for transactional state storage, implementing atomic increment operations and concurrent query aggregations.
101
+
\item Designed automated database bloat prevention to clean up expired sessions and enforced strict HTTP Cache-Control headers to deliver real-time metrics dynamically.
0 commit comments