How ree-ce/axml_viewer works
Project type and purpose
• This is a single-page front-end web application (“Front-end version of axml2xml”) that runs entirely in the browser.
• Its purpose is to let users drop or select an AXML file, parse it in JavaScript, and output an XML representation.
File structure
Top-level files and directories:
• index.html – the single HTML entry point
• css/styles.css – styling for the UI
• js/axml-parser.js – the core library that parses AXML into an intermediate structure and serializes to XML
• js/main.js – application logic (wiring UI elements to parser, handling user events)
• package.json & lock – Node dependencies and scripts (dev, deploy)
• vite.config.js – configuration for Vite (development server and bundling)
• .gitignore
No backend folder indicates pure front-end.
README for additional insights
• “npm run dev” → launches Vite dev server (local http server + live reload)
• “npm run deploy” → uses gh-pages to publish build output to GitHub Pages
• No mention of external APIs: all parsing is client-side.
Main components and their interactions
a. Browser / User Interface
• index.html + styles.css + bundled JS (main.js + axml-parser.js)
• UI elements: file input control, parse button, result area
b. Parsing Module
• axml-parser.js implements parseAXML() → returns DOM-like JSON → toXML()
c. Application Logic
• main.js listens for user events, calls parser, updates UI
d. Build & Deployment Tooling
• Vite (dev server, module bundling, hot reload)
• npm scripts for dev, build, deploy
• gh-pages for static hosting
e. External Service
• GitHub Pages serves the built SPA as static files
Relationships:
• User interacts with Browser/UI
• UI triggers Application Logic
• Logic calls Parsing Module
• Parser returns output back to Logic → UI
• Vite serves files in dev, bundles files for production
• Deployed bundle is served by GitHub Pages
Architectural patterns and design principles
• Modular JavaScript: separation between core parsing library (axml-parser.js) and view/controller logic (main.js)
• Static single-page application: no runtime server components
• Build pipeline pattern: use Vite as a dev server + bundler, then deploy static assets