Skip to content

SplittyDev/spacebadgers

Repository files navigation

badgers.space Logo

SpaceBadgers - Fast SVG Badges

Yes, badgers is an ingenious name. It contains the word badge, is similar to badgen (a popular badge generation service), includes the -rs suffix 🦀 and it's an actual word! Badgers are awesome animals. And they're also the mascot of the University of Wisconsin-Madison. I don't know why I'm telling you this, I don't even live in the US. But hey, the more you know.

Live instance at badgers.space

Project Structure

  • badgers: Core spacebadgers library
  • badgers-utils: Internal utilities for spacebadgers
  • badgers-cli: CLI for generating SVG badges
  • badgers-worker: Cloudflare worker
  • badgers-web: Web frontend for badgers.space

Service Integrations

  • GitHub
  • Codeberg
  • crates.io
  • npm
  • PyPI

More integrations coming soon!

Why SpaceBadgers?

The creation of SpaceBadgers was spurred by my experiences and challenges with existing badge generators such as shields.io and badgen.net. These platforms offer excellent services, but I found certain issues that could be improved upon. Here's why I decided to build SpaceBadgers:

1. Performance: Acknowledging past speed concerns with platforms like Shields.io, SpaceBadgers emphasizes high performance and reliability. Our Rust-based core library and Cloudflare worker enable swift, edge-based badge delivery. Smooth integration with third-party services is achieved via NextJS API routes on Vercel, and we continually aim to enhance speed by utilizing the edge runtime.

2. Stability: Badgen.net was created as a faster alternative to shields.io, but due to its lack of active maintenance, it often breaks, leading to broken images. SpaceBadgers is actively maintained and is committed to ensuring stability and uptime.

3. SVG Exclusivity: In contrast to Shields.io, which produces images, SpaceBadgers dedicates itself solely to the generation of SVGs. Recognizing the scalability and high-quality visuals of SVGs, we deemed them the ideal choice. To optimize performance, we serve SVGs in a minified form, ensuring a swift and efficient delivery of badges.

Building SpaceBadgers has been a labor of love, aiming to offer a superior, reliable, and open-source SVG badge generator for the developer community. I am excited to hear your feedback and to continue evolving this project with your help. Your suggestions, contributions, and active participation are always welcome.

Development

Clone the repository and make sure to initialize the submodules

git submodule update --init --recursive

Environment Variables

Paste this template into badgers-web/.env.local

#
# Frontend Configuration
#

# Worker protocol
NEXT_PUBLIC_API_PROTO=http

# Worker host
NEXT_PUBLIC_API_HOST=127.0.0.1:8787

# Web frontend protocol
NEXT_PUBLIC_WEB_PROTO=http

# Web frontend host
NEXT_PUBLIC_WEB_HOST=127.0.0.1:3000

#
# API Tokens
#

# Required for GitHub badges
GITHUB_TOKEN=ghp_Foo1234567

# Required for crates.io badges
CRATESIO_TOKEN=cio51fdR1234567

# Required for Codeberg badges
CODEBERG_TOKEN=foobar123456789

spacebadgers

Click to expand

Prerequisites

  • cargo

Running tests

cargo test -p spacebadgers

badgers-worker

Click to expand

Prerequisites

  • cargo
  • yarn (preferred) or npm

Installing dependencies

cd badgers-worker
npm install         # If you're using npm
yarn                # If you're using yarn

Running locally

cd badgers-worker
npm run dev         # If you're using npm
yarn dev            # If you're using yarn

Deploying to Cloudflare

cd badgers-worker
npm run deploy      # If you're using npm
yarn deploy         # If you're using yarn

badgers-web

Click to expand

Prerequisites

  • yarn (preferred) or npm

Installing dependencies

cd badgers-web
npm install         # If you're using npm
yarn                # If you're using yarn

Running locally

cd badgers-web
npm run dev         # If you're using npm
yarn dev            # If you're using yarn

Contributors

Ross MacArthur
Ross MacArthur

💻
Marcin Puc
Marcin Puc

💻
Michael Altfield
Michael Altfield

🐛 🤔
Add your contributions