mirror of
https://github.com/tiennm99/thptqg2017.git
synced 2026-09-17 20:20:07 +00:00
a5904a5d782b3e577028ea8b6f1047e4f74e8917
The four build variants existed only because the app could not resolve its own dataset. Now that it can, vite.config.js is a single build with an absolute base and no VARIANT switching, and the workflow compiles Rust once, installs Node dependencies once, and builds the site once — it previously built the same Rust crate twice and ran two separate pnpm installs. Because base is absolute, the emitted index.html references /thptqg/assets/... regardless of where it is served from, so the same file works as an entry point at any depth. scripts/assemble-site.js copies it to each dataset path and to the two legacy nested URLs, giving a real static file at every published route. That is what removes the need for an SPA 404-fallback redirect, which would otherwise have rewritten URLs and interfered with the ?q= deep links. Generated databases move to a gitignored .build/public, which Vite consumes as its publicDir. build-db.js gzips without -k, and the assemble step then refuses to finish if any uncompressed database artefact reached the output — .db, .db-journal, .db-wal or .db-shm. Previously a raw 100+ MB database was written into the source tree and deleted afterwards by an rm in the workflow, so shipping one was a missing cleanup step away. Both build scripts import DATASET_IDS from src/datasets.js rather than repeating the dataset list in workflow shell, so the four ids are declared in exactly one place across the frontend, the database build and the assembly. Verified by running the full pipeline locally and serving the artifact over HTTP: all nine routes return 200, every entry point is byte-identical, asset references are absolute, and the databases are fetchable. The guard was tested by injecting a raw .db and .db-journal into the build, which failed the assembly as intended.
thptqg
Tra cứu điểm thi THPT Quốc gia — exam-score lookup for Vietnam's national high
school graduation exam. Client-side SQL (sql.js) over a SQLite database built
from the ministry's raw .xls score files by the Rust xlsxread CLI.
Served as one site at tiennm99.github.io/thptqg.
| Directory | Year | Size | Site |
|---|---|---|---|
2016/ |
THPT QG 2016 — 877,461 candidates | ~50 MB raw data | /2016/ |
2017/ |
THPT QG 2017 — ~861,000 candidates | ~117 MB raw data | /2017/ (+ old, old2 generations) |
Each year was a standalone repository (thptqg2016, thptqg2017), merged here
with full history. Each keeps its own tools/xlsxread copy because the raw
data formats differ per year.
The Deploy to GitHub Pages workflow builds both years' databases and site
bundles and publishes them behind a root index.
Description
Tra cứu điểm thi THPT Quốc gia 2016–2017 — 1,7 triệu thí sinh · Truy vấn SQL client-side với sql.js
Readme
Apache-2.0
194 MiB
Languages
Go
67.1%
JavaScript
18.9%
Svelte
11.6%
CSS
2.2%
HTML
0.2%