- ✓ Base path support for GitHub Pages project sites
- ✓ Vite
baseconfig derived fromVITE_BASE_PATHenv var - ✓ GitHub Action builds and deploys to Pages on push to main
- ✓
VITE_DATASET_BASE_URLenvironment variable (default:/sample-data/) - ✓ Routing using react-router with 3 routes
- ✓ Minimal plain CSS styling
- ✓ Responsive layout
- ✓ Complete documentation
/- Home summary page with stats and features/matrix- Matrix view with filters and virtualized grid/ext/:name- Extension detail page
php-ext-com/
├── .github/workflows/deploy.yml # GitHub Actions deployment
├── public/
│ ├── sample-data/
│ │ ├── snapshots/latest.json # Sample data (10 extensions)
│ │ └── manifest.json # Dataset manifest
│ └── favicon.svg
├── src/
│ ├── components/
│ │ ├── CellDrawer.tsx # Cell detail drawer
│ │ ├── ExtensionDetail.tsx # Legacy modal component
│ │ ├── FilterBar.tsx # Filter controls
│ │ ├── Layout.tsx # Nav + footer layout
│ │ └── MatrixGrid.tsx # Virtualized grid
│ ├── hooks/
│ │ ├── useDataset.ts # Data loading hook
│ │ └── useFilters.ts # Filter state hook
│ ├── pages/
│ │ ├── ExtensionDetailPage.tsx # /ext/:name route
│ │ ├── HomePage.tsx # / route
│ │ └── MatrixPage.tsx # /matrix route
│ ├── types/
│ │ └── index.ts # TypeScript types
│ ├── utils/
│ │ ├── data.ts # Data utilities
│ │ └── url.ts # URL utilities
│ ├── App.tsx # Router setup
│ ├── index.css # Global styles
│ ├── main.tsx # Entry point
│ └── vite-env.d.ts # Type definitions
├── .eslintrc.cjs # ESLint config
├── .gitignore
├── COMMANDS.md # Command reference
├── DEPLOYMENT.md # Deployment guide
├── DEVELOPMENT.md # Dev guide
├── FILE_TREE.md # Complete file tree
├── FINAL_DELIVERY.md # This file
├── GITHUB_PAGES_SETUP.md # Pages setup guide
├── index.html
├── package.json
├── PROJECT_SUMMARY.md
├── QUICKSTART.md
├── README.md
├── tsconfig.json
├── tsconfig.node.json
└── vite.config.ts
export default defineConfig({
plugins: [react()],
base: process.env.VITE_BASE_PATH || '/', // ← Configurable base path
build: {
outDir: 'dist',
sourcemap: true,
rollupOptions: {
output: {
manualChunks: {
'react-vendor': ['react', 'react-dom', 'react-router-dom'],
'virtualization': ['react-window']
}
}
}
}
})VITE_BASE_PATH (Required for project sites)
- Default:
/ - Project site:
/php-ext-com/ - User site:
/ - Used for: Routing base and asset paths
VITE_DATASET_BASE_URL (Optional)
- Default:
/sample-data/ - Example:
https://api.example.com/data/ - Used for: Dataset manifest location
VITE_DATASET_URL (Optional - overrides BASE_URL)
- Default: None (uses BASE_URL)
- Example:
https://api.example.com/manifest.json - Used for: Complete dataset URL
- Repository Settings → Pages
- Source: GitHub Actions
Settings → Secrets and variables → Actions → Variables
Add these variables:
| Variable | Value | Purpose |
|---|---|---|
VITE_BASE_PATH |
/php-ext-com/ |
Routing base path |
VITE_DATASET_BASE_URL |
/sample-data/ |
Dataset location |
git push origin mainSite will deploy to: https://username.github.io/php-ext-com/
import { BrowserRouter, Routes, Route } from 'react-router-dom';
function App() {
return (
<BrowserRouter basename={import.meta.env.BASE_URL}>
<Layout>
<Routes>
<Route path="/" element={<HomePage />} />
<Route path="/matrix" element={<MatrixPage />} />
<Route path="/ext/:name" element={<ExtensionDetailPage />} />
</Routes>
</Layout>
</BrowserRouter>
);
}- Navigation bar with Home and Matrix links
- Active route highlighting
- Footer
- Wraps all page content
- Hero section with CTA button
- Stats cards (extensions, channels, platforms, etc.)
- Feature list
- Info section
- Links to /matrix
- Filter bar
- Virtualized matrix grid
- Cell drawer for details
- Navigation to extension pages
- Uses useParams to get extension name from URL
- Displays extension details grouped by PHP version
- Back button navigation
- Platform configuration cards
function getDatasetUrl(): string {
if (import.meta.env.VITE_DATASET_URL) {
return import.meta.env.VITE_DATASET_URL;
}
const baseUrl = import.meta.env.VITE_DATASET_BASE_URL || '/sample-data/';
return `${baseUrl}manifest.json`;
}- name: Build
run: bun run build
env:
VITE_BASE_PATH: ${{ vars.VITE_BASE_PATH || '/' }}
VITE_DATASET_URL: ${{ vars.VITE_DATASET_URL || '' }}
VITE_DATASET_BASE_URL: ${{ vars.VITE_DATASET_BASE_URL || '/sample-data/' }}Plain CSS in src/index.css:
- CSS custom properties for theming
- Navigation styles
- Page layouts (home, matrix, detail)
- Stats cards and feature list
- Responsive design with media queries
- Mobile-friendly navigation
Key sections:
- Navigation bar (
.nav) - Page containers (
.page-container) - Home page hero (
.home-hero) - Stats grid (
.stats-grid) - Matrix container (
.matrix-container) - Extension detail (
.extension-detail-content)
bun run dev
# Visit http://localhost:5173/VITE_BASE_PATH=/php-ext-com/ bun run dev
# Visit http://localhost:5173/php-ext-com/VITE_BASE_PATH=/php-ext-com/ bun run build
bun run preview
# Visit http://localhost:4173/php-ext-com/dist/index.html 0.77 kB │ gzip: 0.41 kB
dist/assets/index-*.css 9.06 kB │ gzip: 2.40 kB
dist/assets/virtualization-*.js 9.44 kB │ gzip: 3.32 kB
dist/assets/index-*.js 15.80 kB │ gzip: 4.76 kB
dist/assets/react-vendor-*.js 176.34 kB │ gzip: 57.92 kB
Total: ~211 KB (~68 KB gzipped)
After deploying to GitHub Pages:
- Site loads at GitHub Pages URL
- Home page (
/) displays correctly - Matrix page (
/matrix) displays correctly - Can navigate to extension detail pages (
/ext/gd, etc.) - Navigation links work (Home, Matrix)
- Active route is highlighted in nav
- Filters work on matrix page
- URL parameters persist filters
- Browser back/forward works
- Page refresh works on all routes
- No 404 errors in console
- Assets (CSS, JS) load correctly
- Data loads from configured source
| File | Purpose |
|---|---|
| README.md | Main documentation, overview, features |
| QUICKSTART.md | 5-minute setup guide |
| GITHUB_PAGES_SETUP.md | Complete Pages configuration guide |
| FILE_TREE.md | Complete file tree with descriptions |
| DEPLOYMENT.md | Deployment instructions |
| DEVELOPMENT.md | Development workflow and architecture |
| COMMANDS.md | Command reference |
| PROJECT_SUMMARY.md | Project summary and checklist |
| FINAL_DELIVERY.md | This file - delivery summary |
# Repository variables
VITE_BASE_PATH=/# Repository variables
VITE_BASE_PATH=/php-ext-com/# Repository variables
VITE_BASE_PATH=/php-ext-com/
VITE_DATASET_URL=https://api.example.com/manifest.json# Repository variables
VITE_BASE_PATH=/php-ext-com/
VITE_DATASET_BASE_URL=/php-ext-com/data/-
Push to GitHub
git push origin main
-
Enable GitHub Pages
- Settings → Pages → Source: GitHub Actions
-
Set Variables
- Settings → Actions → Variables
- Add
VITE_BASE_PATH
-
Wait for Deployment
- Check Actions tab for progress
- Usually completes in 1-2 minutes
-
Access Your Site
https://username.github.io/repository-name/
- ✅ Complete routing solution
- ✅ GitHub Pages base path support
- ✅ Environment variable configuration
- ✅ 3 distinct routes with proper navigation
- ✅ Responsive design with plain CSS
- ✅ Automated deployment workflow
- ✅ Comprehensive documentation
- ✅ Sample data included
- ✅ TypeScript throughout
- ✅ Production-ready build
See documentation files for troubleshooting and advanced configuration.
All requirements met and ready for production! 🎉