This codebase has been refactored for better maintainability and ease of change. Here's the new structure:
├── templates/ # HTML templates
│ ├── base.html # Main page template
│ └── table-page.html # Statistics table template
├── config/ # Configuration files
│ └── pages.json # Page metadata and settings
├── data/ # JSON data files
│ ├── teams.json # Team statistics
│ ├── conferences.json # Conference data
│ └── ... # Other data files
├── js/ # Modular JavaScript
│ ├── navigation.js # Mobile navigation
│ ├── table-controls.js # Search/filter/sort
│ ├── data-loader.js # Data loading
│ └── main.js # App initialization
├── build.js # Build system
└── package.json # Project configuration
- Template System: All HTML pages are generated from templates
- Data Separation: Table data is stored in JSON files
- Configuration-Driven: Page settings in
config/pages.json - Modular JavaScript: Separated concerns into focused modules
- Build System: Automated page generation
npm installnpm run buildnpm start- Add page configuration to
config/pages.json:
"page12": {
"title": "New Stats",
"heading": "New Statistics Page",
"description": "Description of the new page",
"sectionTitle": "New Data Section",
"hasSearch": true,
"searchPlaceholder": "Search for items...",
"dataSource": "newdata",
"columns": ["Column1", "Column2", "Column3"]
}- Create data file
data/newdata.json:
[
{
"column1": "value1",
"column2": "value2",
"conf": "CONFERENCE"
}
]- Run build:
npm run build- Export your Excel data to CSV
- Convert CSV to JSON (use online tools)
- Replace the appropriate file in
data/ - Rebuild:
npm run build
Edit styles.css directly - no rebuild needed for CSS changes.
- Edit
templates/base.htmlfor page structure changes - Edit
templates/table-page.htmlfor table layout changes - Run
npm run buildafter template changes
- Clear separation of concerns
- Self-documenting structure
- Consistent patterns across all pages
- Add new pages by editing config
- Update all navigation in one place
- Modify table structure globally
- Single source of truth for data
- No HTML duplication
- Centralized configuration
- Type-safe data loading
- Automated page generation
npm run build- Generate all HTML pagesnpm run dev- Development mode (future: file watching)npm run clean- Clean generated filesnpm run serve- Start local servernpm start- Build and serve
Each data file should follow this pattern:
[
{
"team": "Team Name", // Main identifier
"conf": "CONFERENCE", // Conference (for filtering)
"otherField": "value" // Additional data fields
}
]The build system automatically maps JSON fields to table columns based on header names.