A GitHub README banner generator that produces animated SVG banners via a URL API and a drag‑style builder UI with live preview.
- 🚀 Performance-First: Zero runtime dependencies in the generator library. Works identically on the server and in the browser.
- 🎨 Infinite Customization: 35+ shape types, 20+ animations, and 15+ color presets.
- ⚡ Live Preview: The builder UI provides a byte-identical preview of the API output.
- 📱 Responsive Design: Optimized for all screen sizes.
- 🔗 Seamless Integration: Simply copy the URL or Markdown and paste it into your GitHub README.
This is a pnpm monorepo with three artifacts and one shared library:
-
lib/banner-svg/— Pure-TypeScript SVG generator (no node deps). Used by both the API server and the frontend so the live preview is byte-identical to what the API returns.types.ts—BannerParams,TextLayer, and union types.shapes.ts— 28 shapes (waving, blob, circuit, terminal, hexagon, …).gradients.ts— 20 color presets + custom multi-stop gradients (linear/radial/conic).patterns.ts— 14 pattern overlays (dots, grid, circuit, hexagon, …).particles.ts— 10 animated particle systems (stars, snow, embers, matrix, …) with deterministic PRNG so URLs render identically server-side.effects.ts— Vignette/scanlines/grain/light-leak/fog overlays + drop shadows + color adjust filters (brightness, contrast, saturation, hue, blur).animations.ts— 22 CSS keyframe animations with per-layer delay & global speed.text.ts— Multi-line text layers with gradient fill, glow, stroke, shadow, rotation.fonts.ts— 28 Google fonts (Poppins, Orbitron, JetBrains Mono, Press Start 2P, …) loaded via@importinside the SVG.generator.ts—generateBannerSVG(params)composes everything into a self-contained SVG with embedded CSS.params.ts—parseQueryParams()andparamsToQuery()round-trip a banner config through URL search params.presets.ts— 16 ready-made gallery presets across categories.
-
artifacts/api-server— Express 5 server. The/api/bannerGET route returnsimage/svg+xml(1-hour browser cache, 1-day s-max-age) so the URL can be embedded directly in a GitHub README. -
artifacts/bannerforge— React + Vite + Tailwind v4 + shadcn/ui frontend (the builder). Three-panel layout: control tabs on the left, live preview in the middle, embed/download on the right. State managed by Zustand with undo/redo history. -
artifacts/mockup-sandbox— Component preview sandbox (canvas iframe target).
- Node.js (v18 or higher)
- pnpm package manager
Recommended:
- Git
- A terminal that supports PowerShell (Windows) or bash/zsh (macOS/Linux)
- Clone the repository:
git clone https://github.com/abir2afridi/Github-AnimatedBanner.git
cd Github-AnimatedBanner- Install pnpm globally (recommended):
npm install -g pnpmIf pnpm is not available in your terminal, you can still use:
npx pnpm -v- Install dependencies:
pnpm installOr (works even if pnpm isn't on PATH):
npx pnpm installIf you want the full experience (builder UI + API server), run both together.
pnpm --filter @workspace/bannerforge devOn Windows (PowerShell):
pnpm --filter @workspace/bannerforge devThe builder will be available at http://localhost:5173/
pnpm --filter @workspace/api-server devThe API server defaults to port 3000 if no PORT environment variable is provided.
From repo root:
npm run dev:allThis starts:
@workspace/bannerforge(Vite dev server)@workspace/api-server(Express server)
npm run dev:sandboxBoth the frontend and API server support environment variables for configuration.
| Variable | Default | Target | Description |
|---|---|---|---|
PORT |
5173 |
Frontend | Port for the Vite dev server. |
PORT |
3000 |
API Server | Port for the Express backend. |
BASE_PATH |
/ |
Frontend | The base path for the frontend application. |
VITE_API_BASE |
Frontend | Overrides the API base used to generate banner URLs (e.g. to point the local builder at the Vercel deployment) |
# For Frontend
$env:PORT="5173"; $env:BASE_PATH="/"; npm run dev:bannerforge
# For API Server
$env:PORT="3000"; npm run dev:api# For Frontend
PORT=5173 BASE_PATH=/ npm run dev:bannerforge
# For API Server
PORT=3000 npm run dev:apiIf you want to override them:
macOS/Linux:
PORT=5173 BASE_PATH=/ pnpm --filter @workspace/bannerforge devWindows (PowerShell):
$env:PORT="5173"; $env:BASE_PATH="/"; pnpm --filter @workspace/bannerforge devIf you want the local builder to generate Vercel-ready URLs instead of localhost, set:
VITE_API_BASE=https://github-animatedbanner.vercel.app/apiBy default, the local builder generates URLs pointing to localhost:5173/api. To generate URLs that work on the deployed Vercel instance (for GitHub README embeds), set the VITE_API_BASE environment variable:
- Create
artifacts/bannerforge/.env.local:
VITE_API_BASE=https://github-animatedbanner.vercel.app/api- Restart the dev server:
npm run devNow all banner URLs generated by the builder will point to the Vercel API, allowing you to copy and paste them directly into GitHub READMEs.
pnpm buildThis will typecheck and build all workspace packages.
- If
pnpmis not recognized on Windows after installing globally, usenpx pnpm ...or restart the terminal. - If
npm run dev:allfails with a "PORT environment variable is required" error, ensure you are using the latest version of the code where a fallback to port 3000 has been implemented. - If the API server still fails to start, you can manually set the port:
$env:PORT="3000"; npm run dev:api.
The project is deployed on Vercel:
- Production: https://github-animated-banner-e7bg60pzv-abir2afridi-5746s-projects.vercel.app
- Alias: https://github-animated-banner-seven.vercel.app
To deploy to Vercel:
npx vercel deploy --prodLocal development uses workspace scripts like npm run dev or npm run dev:all. These are not used by Vercel deployments.
The project uses a vercel.json configuration file that:
- Sets the build command to build the bannerforge artifact
- Configures the output directory to
artifacts/bannerforge/dist/public - Uses
npx pnpmfor installation and build commands - Includes environment variables for
BASE_PATH(default:/)
GET /api/banner?type=waving&preset=ocean&text=Hello&desc=Welcome
Vercel (live) example:
https://github-animatedbanner.vercel.app/api/banner?type=waving&preset=ocean&text=Hello&desc=Welcome
Use the API URL directly as an image source:
Common params:
type— shape id (e.g.waving,terminal,circuit,hexagon)preset— color preset (e.g.ocean,cyberpunk,lava)color— comma-separated custom stops (ff5500@0,ffaa00@50,ffee00@100)pattern,particles,overlay,shadow— overlay layerstext,fontFamily,fontSize,fontColor,animationdesc,descFontSize,descColor— second text linewidth,height,gradientType,gradientAngle,reverse,speed,blur,brightness,contrast,saturation,hueRotate
The api-server and bannerforge web workflows are wired up automatically. Both use PORT and BASE_PATH env vars provided by the Replit artifact router.
The shared library is consumed via @workspace/banner-svg (workspace dependency). It has zero runtime deps so it works identically on Node (api server) and in the browser (live preview).
- All HSL theme values for the BannerForge frontend live in
artifacts/bannerforge/src/index.css(forced dark theme). - The preview panel uses
<object data="data:image/svg+xml;...">(not<img>) so the embedded CSS animations keep running. - The generator returns a single self-contained
<svg>string with<style>block so the SVG can be embedded directly in a README without external assets.