A pure TypeScript/React website built with Bun runtime - converted from Next.js to a lightweight, high-performance static site.
# Install dependencies
bun install
# Start development server (port 6969)
bun run dev
# Or build for production
bun run build
# Serve production build (port 3100)
bun run startNote: This project uses Tailwind CSS v4 with PostCSS and Autoprefixer for optimal browser compatibility.
- Pure TSX/React: No Next.js framework overhead
- Bun Runtime: Blazing fast development and production server using Bun's native HTTP server and bundler
- Tailwind CSS v4: Latest version with PostCSS and Autoprefixer
- TypeScript: Full type safety throughout the application
- Custom Fonts: Geist Sans and Geist Mono variable fonts
- GitHub API Integration: Real-time contributor fetching with smart caching
- Avatar Proxy: Server-side avatar caching for optimal performance
- Production Optimized: Hash-based asset names, minification, and source maps
βββ public/ # Static assets
β βββ index.html # Main HTML template
β βββ styles.css # Compiled Tailwind CSS (generated)
β βββ fonts/ # Font files (Geist Sans & Mono)
β βββ BBCS_White_Large.svg
βββ src/
β βββ components/ # React components
β β βββ App.tsx # Main application component
β β βββ BobbingArrow.tsx
β β βββ Contributors.tsx
β βββ styles/
β β βββ globals.css # Global styles with Tailwind v4
β βββ main.tsx # React entry point
β βββ index.ts # Bun HTTP server & build tool
βββ dist/ # Production build output (generated)
βββ package.json # Dependencies and scripts
βββ postcss.config.js # PostCSS configuration
βββ tailwind.config.js # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
- Bun >= 1.0.0
bun installbun run devThe site will be available at http://localhost:6969
The development server (src/index.ts) provides:
- Bun.serve(): Native HTTP server on port 6969
- Static file serving: Serves files from
public/directory - On-the-fly bundling: Bundles React/TypeScript with inline source maps
- CSS processing: Compiles Tailwind CSS with PostCSS
- API endpoints:
/api/contributorsfor GitHub data,/avatar/:idfor cached avatars - Real-time TypeScript compilation: No separate build step needed
- Fetches contributors from multiple repositories on startup
- Caches contributor data and avatars for 12 hours
- Avatar proxy reduces external requests and improves performance
bun run buildThis command:
- Builds Tailwind CSS with PostCSS and Autoprefixer
- Cleans the
dist/folder - Bundles React application with minification
- Generates hash-based filenames for cache busting (e.g.,
bundle.qytmmfv7.js) - Creates source maps for debugging
- Copies static assets (fonts, images, etc.)
- Updates
index.htmlwith correct bundle references
Output directory: ./dist/
bun run startRuns the Bun HTTP server in production mode:
- Serves static files from
./dist/on port 3100 - Provides the same API endpoints as development
- Includes proper caching headers for static assets
- SPA fallback routing to
index.html
bun run build:cssCompiles Tailwind CSS to public/styles.css without building the entire application.
The project uses Tailwind CSS v4 with PostCSS:
tailwind.config.js: Tailwind v4 configuration with content pathspostcss.config.js: PostCSS plugins (Tailwind CSS, Autoprefixer)src/styles/globals.css: Tailwind imports and custom CSS
- Development: CSS compiled on server start via
bun run dev - Production: CSS compiled during build process
- Output:
public/styles.css(dev) ordist/styles.css(prod) - Modern CSS features with Autoprefixer for browser compatibility
- Gradient syntax:
bg-[linear-gradient(...)]for custom gradients
Main application component with three full-screen sections:
- Hero section: Organization branding with logo and tagline
- Projects showcase: Repository cards with descriptions and links
- Team display: GitHub contributors with avatars and profiles
- Fetches contributors from
/api/contributorsendpoint - Displays avatars using the
/avatar/:idproxy - Excludes bot accounts and specified users
- Aggregates data from multiple repositories
Animated scroll indicator with smooth CSS animations
The server provides two API endpoints:
Returns cached contributor data from GitHub API.
- Fetches from multiple repositories
- Updates every 12 hours
- Filters out bots and excluded users
Proxies and caches GitHub avatars.
- Reduces external API calls
- Returns cached images with proper headers
- Cache-Control:
public, max-age=86400(24 hours)
Tailwind v4 CSS with @import directives and custom styles
- Content paths for Tailwind scanning
- Theme customization
- Plugin configuration
PostCSS plugins:
@tailwindcss/postcss: Tailwind CSS v4autoprefixer: Vendor prefixes for browser compatibility
TypeScript configuration for React and Bun
Scripts:
dev: Start development serverbuild: Build for productionbuild:css: Build CSS onlystart: Serve production build
This project leverages Bun's capabilities:
- Fast bundling: Bun's built-in bundler is significantly faster than webpack/vite
- Native TypeScript: No need for ts-node or additional transpilers
- HTTP server: Built-in
Bun.serve()provides a production-ready server - File serving: Efficient static file serving with
Bun.file() - All-in-one: Bundler, runtime, package manager in a single tool
- Modern output: ESM modules, hash-based naming, tree-shaking
react: ^19.2.0 - UI libraryreact-dom: ^19.2.0 - React DOM renderer@tailwindcss/postcss: ^4.1.14 - Tailwind CSS v4 PostCSS plugin
tailwindcss: ^4.1.14 - CSS frameworkpostcss: ^8.5.6 - CSS transformation toolautoprefixer: ^10.4.21 - PostCSS plugin for vendor prefixes@types/bun: latest - Bun TypeScript definitions@types/react: ^19.2.2 - React TypeScript definitions@types/react-dom: ^19.2.2 - React DOM TypeScript definitionstypescript: ^5 (peer dependency)
After running bun run build, the dist/ folder contains a complete static site that can be deployed to:
- Vercel: Upload the
dist/folder or connect GitHub repo - Netlify: Drag & drop
dist/or configure build command - Cloudflare Pages: Connect repo with build command
bun run build - GitHub Pages: Upload
dist/contents - AWS S3 + CloudFront: Static website hosting
For full functionality (GitHub API caching, avatar proxy), deploy the Bun server:
# On your server
git clone <repository>
cd battlebit.community-rework
bun install
bun run build
PORT=3100 bun run startRecommended platforms:
- Fly.io: Native Bun support with Dockerfile
- Railway: Supports Bun runtime
- VPS/Cloud: DigitalOcean, Linode, AWS EC2 with Bun installed
PORT=3100 # Server port (optional, defaults to 3100 for production)FROM oven/bun:latest
WORKDIR /app
COPY package.json bun.lockb ./
RUN bun install
COPY . .
RUN bun run build
EXPOSE 3100
CMD ["bun", "src/index.ts", "serve"]