Deploy flashbang
Instant duckduckgo style bang redirects - 14,000+ shortcuts in ~1ms
flashbang
Just deployed
Deploy and Host flashbang on Railway
Flashbang turns your browser's address bar into a shortcut launcher with over 14,000 bangs. Type !g kittens for Google, !w dogs for Wikipedia — a Service Worker handles redirects in ~1ms before your browser even renders a page. No tracking, no analytics, fully self-hostable.
About Hosting flashbang
Deploying flashbang on Railway is straightforward — Railway auto-detects the Dockerfile and builds everything automatically. The multi-stage Docker build fetches the latest bang definitions from DuckDuckGo and Kagi, compiles static assets with Bun, and produces a minimal runtime image. Static assets are pre-compressed with Brotli at build time for optimal performance. The PORT environment variable is set by Railway automatically. Once deployed, add your Railway URL as a custom search engine in your browser (https://your-app.up.railway.app?q=%s) and optionally enable search suggestions (https://your-app.up.railway.app/suggest?q=%s). Core redirects run entirely in the browser via the Service Worker — the server handles search suggestions and OpenSearch discovery.
Common Use Cases
- Private bang redirects — Self-host your own instance so search suggestions and OpenSearch requests never touch a third-party server
- Custom search launcher — Replace DuckDuckGo/Brave/Kagi bangs with a faster, zero-latency alternative that works in any browser
- Team or family search hub — Deploy a shared instance with custom bangs pointing to internal tools, wikis, or dashboards
Dependencies for flashbang Hosting
- Docker — Railway auto-detects the Dockerfile; no additional buildpack configuration needed
- Bun — Used inside the Docker build stage to fetch bang sources, generate the bang map, and bundle assets
Deployment Dependencies
- flashbang GitHub repository
- Bun runtime
- DuckDuckGo bang data (fetched at build time)
- Kagi bang data (fetched at build time)
Implementation Details
When you type !gh react in the address bar, a Service Worker intercepts the navigation request before the browser begins rendering. It parses the bang trigger, looks it up in a minimal in-memory map (~867 KB of trigger-to-URL pairs), and responds with a 302 redirect — no page load, no framework, no round-trip to a server. The bang data is parsed once when the Service Worker installs and stays in memory across navigations, achieving sub-1ms median redirect latency.
The server component handles two optional features that browsers don't route through Service Workers:
- Search suggestions (
/suggest) — Bang-aware autocomplete that surfaces bangs ranked by popularity, plus web search suggestions from your configured provider (Google, DuckDuckGo, Bing, Brave, or custom) - OpenSearch discovery (
/opensearch.xml) — Dynamically generated at request time using the current origin, so browsers auto-discover flashbang as a search engine on any domain
Bang data is sourced from DuckDuckGo and Kagi, merged and deduplicated at build time. Custom bangs stored in IndexedDB on the client take priority over built-ins. Once the Service Worker is installed, all bang redirects stay fully local on your machine — no server round-trip, works offline.
This template includes a GitHub Actions CI workflow that runs daily at 00:00 UTC to fetch the latest bang definitions from DuckDuckGo and Kagi, rebuild the generated JavaScript, and commit any changes. Your Railway deployment will automatically redeploy when the CI pushes updates, keeping your bang database current with no manual intervention.
After deployment, you need to generate a domain for your service since Railway does not assign one automatically:
- Open your project in the Railway dashboard
- Select the flashbang service
- Go to Settings → Networking → Public Networking
- Click Generate Domain to get a
*.up.railway.appURL (or add a custom domain) - Visit
https://your-domain.up.railway.app— if your browser supports OpenSearch, flashbang will appear in your search engine list automatically. Otherwise, manually add a custom search engine:- Search URL:
https://your-domain.up.railway.app?q=%s - Suggestion URL:
https://your-domain.up.railway.app/suggest?q=%s
- Search URL:
Why Deploy flashbang on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying flashbang on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
flashbang
ph1losof/flashbang