mirror of
https://github.com/tiennm99/thptqg.git
synced 2026-10-14 00:17:03 +00:00
Revert "refactor: one frontend, one parser, one schema (#4)"
This reverts commit d60c81e5a6.
This commit is contained in:
1 parent
d60c81e5a6
commit
dfbe207599
421 files changed
+9834
-14451
No files matched your search
@@ -24,29 +24,57 @@ jobs:
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: parser
|
||||
workspaces: |
|
||||
2016/tools/xlsxread
|
||||
2017/tools/xlsxread
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
package_json_file: 2017/package.json
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '24'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: package-lock.json
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: |
|
||||
2016/pnpm-lock.yaml
|
||||
2017/pnpm-lock.yaml
|
||||
|
||||
- run: npm ci
|
||||
|
||||
# One parser binary builds every dataset; build-db.js reads the dataset
|
||||
# list from src/datasets.js and gzips each database in place, leaving no
|
||||
# uncompressed file behind.
|
||||
- name: Build databases
|
||||
- name: Build 2016 site
|
||||
working-directory: '2016'
|
||||
run: |
|
||||
npm run build:rust
|
||||
npm run build:db
|
||||
set -euo pipefail
|
||||
cargo build --release --manifest-path tools/xlsxread/Cargo.toml
|
||||
./tools/xlsxread/target/release/xlsxread build \
|
||||
--schema tools/xlsxread/configs/thptqg2016-data.toml \
|
||||
--input data --output public/thptqg2016.db
|
||||
pnpm install --frozen-lockfile
|
||||
gzip -k -9 public/thptqg2016.db
|
||||
pnpm build
|
||||
rm -f dist/thptqg2016.db
|
||||
|
||||
# One Vite build produces every page. scripts/assemble-site.js copies the
|
||||
# emitted index.html to each dataset path (and the legacy nested URLs),
|
||||
# then fails the job if any uncompressed database reached the artifact.
|
||||
- name: Build and assemble site
|
||||
run: npm run build:site
|
||||
- name: Build 2017 site variants
|
||||
working-directory: '2017'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cargo build --release --manifest-path tools/xlsxread/Cargo.toml
|
||||
./tools/xlsxread/target/release/xlsxread build --schema tools/xlsxread/configs/thptqg2017-data.toml --input data --output public/thptqg2017.db
|
||||
./tools/xlsxread/target/release/xlsxread build --schema tools/xlsxread/configs/thptqg2017-data-old.toml --input data-old --output public-old/thptqg2017.db
|
||||
./tools/xlsxread/target/release/xlsxread build --schema tools/xlsxread/configs/thptqg2017-data-old2.toml --input data-old2 --output public-old2/thptqg2017.db
|
||||
pnpm install --frozen-lockfile
|
||||
gzip -kf -9 public/thptqg2017.db
|
||||
gzip -kf -9 public-old/thptqg2017.db
|
||||
gzip -kf -9 public-old2/thptqg2017.db
|
||||
pnpm build:all
|
||||
rm -f dist/thptqg2017.db dist/old/thptqg2017.db dist/old2/thptqg2017.db
|
||||
|
||||
- name: Assemble site
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p _site
|
||||
cp index.html _site/
|
||||
cp -r 2016/dist _site/2016
|
||||
cp -r 2017/dist _site/2017
|
||||
|
||||
- uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
### Editors ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
||||
|
||||
### Node ###
|
||||
node_modules/
|
||||
|
||||
### Build output ###
|
||||
dist/
|
||||
|
||||
### Generated databases and Vite publicDir staging ###
|
||||
.build/
|
||||
|
||||
### Rust build artefacts ###
|
||||
parser/target/
|
||||
|
||||
### Assembled Pages artifact ###
|
||||
_site/
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Snowpack dependency directory (https://snowpack.dev/)
|
||||
web_modules/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional stylelint cache
|
||||
.stylelintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variable files
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
.parcel-cache
|
||||
|
||||
# Next.js build output
|
||||
.next
|
||||
out
|
||||
|
||||
# Nuxt.js build / generate output
|
||||
.nuxt
|
||||
dist
|
||||
|
||||
# Gatsby files
|
||||
.cache/
|
||||
# Comment in the public line in if your project uses Gatsby and not Next.js
|
||||
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||
# public
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# vuepress v2.x temp and cache directory
|
||||
.temp
|
||||
.cache
|
||||
|
||||
# Sveltekit cache directory
|
||||
.svelte-kit/
|
||||
|
||||
# vitepress build output
|
||||
**/.vitepress/dist
|
||||
|
||||
# vitepress cache directory
|
||||
**/.vitepress/cache
|
||||
|
||||
# Docusaurus cache and generated files
|
||||
.docusaurus
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
|
||||
# Firebase cache directory
|
||||
.firebase/
|
||||
|
||||
# TernJS port file
|
||||
.tern-port
|
||||
|
||||
# Stores VSCode versions used for testing VSCode extensions
|
||||
.vscode-test
|
||||
|
||||
# yarn v3
|
||||
.pnp.*
|
||||
.yarn/*
|
||||
!.yarn/patches
|
||||
!.yarn/plugins
|
||||
!.yarn/releases
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
|
||||
# Vite logs files
|
||||
vite.config.js.timestamp-*
|
||||
vite.config.ts.timestamp-*
|
||||
|
||||
# Generated database files
|
||||
public/*.db
|
||||
public/*.db.gz
|
||||
|
||||
# Rust build artifacts
|
||||
tools/xlsxread/target/
|
||||
File renamed without changes.
@@ -0,0 +1,57 @@
|
||||
# thptqg2016
|
||||
|
||||
Lookup tool for Vietnam's 2016 National High School Graduation Exam (THPT Quốc gia) scores — 877,461 candidates nationwide.
|
||||
|
||||
Fully static app running entirely in the browser (SQLite via `sql.js`). No backend, no query logging.
|
||||
|
||||
## Features
|
||||
|
||||
- **Quick lookup** by exam ID (`số báo danh`) or full name (diacritics-insensitive)
|
||||
- **Custom read-only SQL** (SELECT / PRAGMA / EXPLAIN / WITH) with 7 built-in preset queries
|
||||
- **Complete data**: 12 subjects (Math, Literature, Physics, Chemistry, Biology, History, Geography, English, French, German, Japanese, Chinese), exam cluster, date of birth, gender
|
||||
- Safety caps: 100 rows for lookup, 1000 rows for custom SQL
|
||||
- Dark mode, `Ctrl+Enter` shortcut to run queries
|
||||
|
||||
## Demo
|
||||
|
||||
<https://tiennm99.github.io/thptqg/2016/>
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
# Build the SQLite database from source Excel files (requires Rust stable)
|
||||
pnpm run build:db
|
||||
|
||||
# Or build in two steps:
|
||||
pnpm run build:rust # compile the xlsxread binary
|
||||
./tools/xlsxread/target/release/xlsxread build \
|
||||
--schema tools/xlsxread/configs/thptqg2016-data.toml \
|
||||
--input data \
|
||||
--output public/thptqg2016.db
|
||||
|
||||
pnpm run dev # Vite dev server
|
||||
pnpm run build # Production bundle → dist/
|
||||
pnpm run lint # ESLint
|
||||
```
|
||||
|
||||
The database is built by the `xlsxread` Rust binary (`tools/xlsxread/`), which
|
||||
reads the 119 mixed `.xls`/`.xlsx` files and auto-detects the column layout per
|
||||
file (`separate-scores`, `mapped`, or positional default). No Node.js Excel
|
||||
library is required at build time.
|
||||
|
||||
The GitHub Actions workflow (`.github/workflows/deploy.yml`) compiles
|
||||
`xlsxread`, builds the DB, gzips it, and deploys to GitHub Pages on every push
|
||||
to `main`.
|
||||
|
||||
## Tech stack
|
||||
|
||||
React 19 · Vite · sql.js (WASM) · xlsxread (Rust, build-time) · GitHub Pages
|
||||
|
||||
## Documentation
|
||||
|
||||
- [Project overview (PDR)](./docs/project-overview-pdr.md)
|
||||
- [Codebase summary](./docs/codebase-summary.md)
|
||||
- [System architecture](./docs/system-architecture.md)
|
||||
- [Deployment guide](./docs/deployment-guide.md)
|
||||
|
||||
**Source**: Originally published at <https://dtntbacgiang.edu.vn/tin-tuc/tin-tuc-su-kien/cong-bo-diem-thi-thptqg-2016-toan-bo-120-cum-thi-da-co-diem.html> (currently inaccessible). Data is for reference only.
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 421 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user