Generate beautiful, dynamic GitHub README badges that showcase your reading statistics. Track your books, favorites, and currently reading status with automatically updating badges.
- Beautiful SVG Badges: Custom-designed badges with modern styling
- Dynamic Updates: Badges update automatically when you change your data
- Persistent Storage: Book data saved securely in Redis database
- Easy Deployment: Deploy to Render with simple setup
- Book Search: Search and add books from Open Library
- Rich Statistics: Display total books, top genres, favorite authors
- GitHub Integration: Perfect for GitHub README profiles
-
Fork this repository
-
Create a Render account at render.com
-
Create a new Web Service:
- Connect your GitHub repository
- Set the following configuration:
- Root Directory:
. - Build Command:
./build.sh - Start Command:
npm start
- Root Directory:
-
Set up your database:
- Create an Upstash Redis database at upstash.com
- Copy the REST URL and token
-
Configure environment variables in Render:
UPSTASH_REDIS_REST_URL=https://your-db.upstash.io UPSTASH_REDIS_REST_TOKEN=your_token_here -
Deploy: Render will build and deploy your application
-
Use your application:
- Visit your deployed site:
https://your-app.onrender.com - Add books to your reading library
- Set favorites and currently reading
- Generate your badge data
- Visit your deployed site:
-
Get your badge URL:
https://your-app.onrender.com/api/badge/main -
Add to your GitHub README:

- Add Books: Search and add books to your reading library
- Set Preferences: Mark favorites and currently reading books
- Generate Badge: Create your personalized reading stats badge
- Automatic Updates: Badge updates whenever you change your data
- Permanent Link: Same URL always shows your latest stats
POST /api/generate-badge
Content-Type: application/json
{
"username": "your-github-username",
"books": ["book-id-1", "book-id-2"],
"favorites": ["book-id-1"],
"currentlyReading": "book-id-2"
}GET /api/user-dataResponse: Returns saved reading data or 404 if no data exists
GET /api/badge/main
Accept: image/svg+xmlGET /api/search-books?q=search-termGET /api/books/:idResponse: Returns complete book details with resolved author names
{
"id": "OL14926019W",
"title": "The Lord of the Rings",
"authors": ["J.R.R. Tolkien"],
"genres": ["Fantasy", "Adventure"],
"pageCount": 0
}- Backend: Node.js, Fastify
- Frontend: React, Vite, Tailwind CSS
- Database: Upstash Redis
- Badge Generation: SVG.js
- Book Data: Open Library API
- Deployment: Render
# Clone the repository
git clone https://github.com/your-username/reading-stats.git
cd reading-stats
# Install dependencies
npm install
cd frontend && npm install && cd ..
# Set up environment variables
# Create .env.local with your Redis credentials
UPSTASH_REDIS_REST_URL=https://your-db.upstash.io
UPSTASH_REDIS_REST_TOKEN=your_token_here
# Start development servers
npm run dev # Backend on port 3000
cd frontend && npm run dev # Frontend on port 5173Modify badge appearance in src/badge/generator.ts:
- Colors, fonts, layout
- Statistics display
- Icon styles
Update styles in frontend/src/:
- Tailwind CSS classes
- Component styling
- Responsive design
The badge displays:
- Total Books: Number of books in your library
- Top Genre: Most read genre
- Top Author: Most read author
- Currently Reading: Your current book with cover
- Book data stored securely in Redis
- No personal information collected
- SVG badges served with cache control
- Environment variables for sensitive data
- Open Library for book data
Happy Reading!
Show off your reading journey with dynamic, beautiful badges!