Static website landing page for the Keyboard Vagabond fediverse community. This project creates an optimized, containerized website for deployment on Kubernetes.
## 🌟 Features
- **Ultra-optimized CSS**: 94.4% reduction (154KB → 8.6KB) using PurgeCSS and cssnano
- **Minified HTML**: 16.3% size reduction with html-minifier-terser
- **Containerized**: Docker + nginx for Kubernetes deployment
- **Modern CSS Framework**: Built with Pico CSS
- **ARM64 Compatible**: Optimized for ARM-based Kubernetes clusters
## 🏗️ Project Structure
```
Keyboard-Vagabond-Web/
├── dist/ # 🚀 Production build (optimized)
│ ├── index.html # Minified landing page
│ ├── about.html # Minified about page
│ ├── css/styles.css # Optimized CSS (8.6KB)
│ └── assets/ # Static assets
├── public/ # 📝 Development files
├── build.sh # 🐳 Container build script
├── minify-build.js # 🗜️ CSS/HTML optimization
├── Dockerfile # 🐳 Container definition
├── nginx.conf # 🌐 Web server config
└── package.json # 📦 Dependencies & scripts
```
## 🚀 Quick Start
### Prerequisites
- **Node.js** (v16+ recommended)
- **Docker**
- **npm**
### Development
```bash
# Clone and setup
git clone <your-repo>
cd Keyboard-Vagabond-Web
npm install
# View development version
open public/index.html
```
### Build & Deploy
```bash
# Full production build (recommended)
npm run build
# to run locally
docker build -t keyboard-vagabond-local .
docker run -d -p 8080:80 --name test-container keyboard-vagabond-local
```
## 📋 Available Scripts
| Command | Description |
|---------|-------------|
| `npm run build` | **Full production build** - Optimize + containerize + push |
| `npm run dist-minified` | Create optimized `dist/` folder (CSS + HTML minified) |
| `npm run dist` | Create `dist/` folder with CSS optimization (auto-runs PurgeCSS) |
| `npm run build-basic` | Basic build using `dist` command |
| `npm run optimize-css` | CSS optimization only (PurgeCSS) |
| `npm run clean` | Clean all build artifacts |
| `./build.sh` | Build and push Docker container |
## 🚢 Deployment Guide
### Step 1: Prepare Environment
```bash
# Ensure you have access to the registry
docker login registry.keyboardvagabond.com
# Install dependencies
npm install
```
### Step 2: Build Production Assets
```bash
# Create optimized build (recommended - includes minification)
npm run dist-minified
# OR create basic optimized build
npm run dist
```
This creates a `dist/` folder with:
- ✅ CSS optimized from 154KB to 8.6KB (94.4% reduction)
- ✅ HTML minified (16.3% reduction)
- ✅ Production-ready static files
### Step 3: Container Build & Push
```bash
# Build and push container
./build.sh
```
Or use the complete pipeline:
```bash
# Full build pipeline
npm run build
```
### Step 4: Kubernetes Deployment
The container is pushed to `registry.keyboardvagabond.com/library/keyboard-vagabond-web:latest`