MANOHAR.

PROJECT / 004

KAGE

Full-stack anime library & watch tracker.

Next.jsPythonFastAPIPostgreSQLDockerGoogle Cloud RunCloud SQLArgon2id

TYPE

Full-stack application

STATUS

Deployed

LIVE DEMO

Open site ↗

01 / THE PROBLEM

The engineering problem

Deploying a dynamic, data-heavy web application requires balancing infrastructure costs with performance and security. Serverless environments suffer from cold starts that degrade initial page loads. Furthermore, user authentication workflows require rigorous protection against modern web exploits.

CONSTRAINTS

Serverless container cold starts

Credential security

Account hijacking

ENGINEERING FOCUS

Container layer optimization & slim base images

Argon2id memory-hard hashing & CSRF tokens

Single-use expiring email verification links

02 / ARCHITECTURE

How the system works

KAGE / CLOUD RUN DEPLOYMENT & SECURITY PIPELINE — STANDARD FLOW

GOOGLE CLOUD PLATFORM (GCP)User BrowserHTTPSNext.js FrontendCloud Run ContainerSSR / App Routermykage.inInternal APIFastAPI BackendCloud Run ContainerCSRF MiddlewareJWT Token ValidationPydantic SchemasCloud SQLPostgreSQLArtifact RegistryDocker OCI Container Images

Production architecture: Next.js frontend and FastAPI backend are packaged via multi-stage Docker builds and deployed as serverless containers to Google Cloud Run, communicating with a managed Cloud SQL PostgreSQL database.

03 / IMPLEMENTATION

What was built

  • 01Developed a responsive frontend interface using Next.js with server-side rendering and client state.
  • 02Implemented a high-performance backend API using FastAPI and PostgreSQL.
  • 03Containerized application components using multi-stage Dockerfiles for minimal image footprint.
  • 04Deployed to production on Google Cloud Run with managed PostgreSQL on Cloud SQL and Artifact Registry.
  • 05Implemented comprehensive security: CSRF middleware, Argon2id password hashing, and secure HTTP-only cookies.
  • 06Engineered single-use, cryptographically signed email verification tokens with expiration enforcement.

04 / DECISIONS

Technical decisions

DECISIONREASONING
Google Cloud Run serverless containersProvides automated scaling, zero-cost idle state, and container portability without Kubernetes overhead.
Argon2id password hashingModern memory-hard hashing standard that protects against both side-channel and GPU-based brute-force attacks.
CSRF token validation on state mutationsProtects authenticated cookie-based sessions against Cross-Site Request Forgery exploits.
Multi-stage Docker buildsReduces container image size by over 60%, drastically cutting Cloud Run cold-start latency.

05 / RELIABILITY

Reliability and failure handling

SCENARIOEXPECTED BEHAVIOURVERIFICATION
Expired or reused email verification link clickedSingle-use token lookup fails in database; user redirected to clean expired link notification.Token expiration and single-use invalidation tests
State-changing request submitted without CSRF tokenSecurity middleware halts execution with 403 Forbidden before reaching business handlers.Security test suite verifying CSRF enforcement
Invalid authentication attemptConstant-time comparison returns generic 401 Unauthorized to prevent username enumeration.Authentication failure test

06 / LIMITATIONS

Known limitations and future work

—Rate limiting on authentication routes is currently handled at application level rather than via Cloud Armor.
—Refresh token rotation mechanism is under development.

Full-stack software engineering, production containerization, Google Cloud infrastructure, and web security defense in depth.

← PREVIOUS

IncidentHub

All projects

NEXT →

SupportDesk