HUB
Sign inSign up

tanaymondal/linksnap-frontend-beta

By tanaymondal

•Updated about 1 month ago

Image
0

7.0K

tanaymondal/linksnap-frontend-beta repository overview

React + Vite Frontend Client for the Link-Snap URL Platform, optimized and containerized with Nginx.

License: MIT Version Docker Frontend Docker Backend


This repository contains the containerized production-ready build of the Link-Snap client. It is a Single Page Application (SPA) designed to communicate with the linksnap-backend API.

Key Technical Features Served:

  • Performance & Virtualization: Utilizes React Virtualized lists and Suspense-based dynamic route chunking to maintain sub-second Time-To-Interactive (TTI) even with massive datasets.
  • Zero-Trust Client Authentication: Implements Device Bound Session Credentials (DBSC) flow, storing Access Tokens purely in memory while allowing silent background refresh via HTTP-Only cookies.
  • Bio-Link Page Builder: Drag-and-drop "Linktree-style" profile manager with real-time UI previews.
  • Geographic & Device Analytics: Interactive dashboards rendered via Recharts, backed by optimized Mongoose aggregation pipelines.
  • Progressive Web App (PWA): Full PWA support with service worker caching, install prompts, and offline status indicators.

⁠🏗️ Architecture

This container uses a multi-stage Docker build to serve the static bundle with security-hardened Nginx configurations:

StagePurposeBase Image
BuilderInstalls dependencies, runs Vite compilernode:24-alpine
ProductionServes static assets using Nginxnginx:1.27-alpine

Key Container Optimizations:

  • ✅ Unprivileged execution: Runs under a non-root linksnap user for security.
  • ✅ Single-Page Application routing: Custom nginx.conf fallback rule to prevent 404 errors on subroutes.
  • ✅ Compact footprints: Minimal footprint image (~45MB) with all node devDependencies completely excluded.

⁠🐳 Quick Start

⁠1. Pull the Image
docker pull tanaymondal/linksnap-frontend:latest
⁠2. Run the Container

The frontend requires configuration baked in at build time or resolved dynamically via reverse proxy (such as a CDN BFF/Gateway). In standard setups, you expose port 80:

docker run -d \
  -p 80:80 \
  --name linksnap-frontend \
  tanaymondal/linksnap-frontend:latest
⁠3. Access the Application

Open http://localhost.


⁠⚙️ Build Arguments (Baked into Client JS)

Because React is compiled to client-side static assets, frontend environment variables must be injected as build arguments during docker build:

Build ArgDescriptionDefault
VITE_BASE_URLBase canonical domain of the client apphttps://lksnp.qzz.io
VITE_DOMAINTarget short-link cookie domainlksnp.qzz.io
VITE_API_URLRoute path prefix for backend API/api

Example of rebuilding locally with custom targets:

docker build \
  --build-arg VITE_BASE_URL="http://localhost:5000" \
  --build-arg VITE_DOMAIN="localhost" \
  --build-arg VITE_API_URL="/api" \
  -f client/Dockerfile -t my-linksnap-frontend .

⁠📦 Docker Compose Topology (Full Stack)

To run the frontend together with the backend API and MongoDB/Redis stack, refer to the Compose template in the Link-Snap Backend Docker Hub Page⁠.


⁠🛡️ Security

  • Non-Root Execution: Container process permissions are locked to the linksnap system user.
  • Security Headers: Custom Nginx configs prevent clickjacking, MIME sniffing, and enforce strict HTTPS.

Tag summary
Recent tags
Content type
Image
Digest
sha256:5fafaccb1…
Size
34.3 MB
Last updated
about 1 month ago
docker pull tanaymondal/linksnap-frontend-beta:sha-eec4ff2