This README provides instructions for managing the DLDT website, including deleting characters from the database, updating and relaunching the site, modifying data, dumping character database filepaths, and managing site files (HTML, CSS, etc.) within the Vue.js framework.
Use this checklist whenever you update printers, books, or characters.
Some data ingestion scripts require an API token. The current workflow supports using a temporary file: dldt_data/secret.py
This file typically contains
API_TOKEN = "your_token_here"
It is OK to create dldt_data/secret.py locally while running data collection scripts (e.g. get_data.py) Do not commit secret.py to git Delete secret.py after you are done running the scripts If secret.py ever contained a real token and was committed or copied elsewhere, revoke and rotate the token
- Update
dldt_data/cdt_printers.csv(canonical printers list) - Update
dldt_data/books.json(books metadata) - Update
dldt_data/extracted_character_data.json(characters) - If merging sources, dedupe and normalize first (especially
group_id/group_ID)
- Are any books known to have bad scans / corrupt extractions?
- If yes: add their
book_idto the book exclusion list inscripts/init-db.ts
- If yes: add their
- Are any printers deprecated or invalid?
- If yes: confirm they are in the
deletePrinterslist inscripts/init-db.ts
- If yes: confirm they are in the
- Compare:
- Number of printers in CSV vs unique
group_ids in characters - Character count before vs after update
- Number of printers in CSV vs unique
- If you see a big drop:
- Check for missing
group_ids incdt_printers.csv - Check for accidental over-filtering in
scripts/init-db.ts
- Check for missing
npm run migrateWatch the output for warnings like: - Missing group_id - Missing
printer entries - Skipped or filtered records
sudo docker compose restart client(If IIIF images are affected:)
sudo docker compose restart iiifLocal:
curl -I http://localhost:3000Production:
curl -I https://cdt.library.cmu.edu/Spot-check: - Printers list loads - Character grid loads - Character detail pages load - IIIF images render
sudo docker compose logs client
sudo docker compose logs iiifRe-check: - cdt_printers.csv completeness - books.json IDs -
extracted_character_data.json integrity - Filtering rules in
scripts/init-db.ts
- Prepare a list of character IDs in a text file, e.g.:
unique_id_flagged_for_deletion_2024-12-02.txt
everingham_A1679.002
everingham_A1679.004
maxwell_F1667.001
maxwell_F1667.003
- Run the
query_db.pyscript with a wildcard for--unique_id_list_fileto match ALL IDs to be deleted (including past files):
python3 query_db.py --remove_chars_from_json_path --unique_id_list_files dldt_data/unique_id_flagged_for_deletion_202*- Update and relaunch the site (see below).
- Stop any running container:
sudo docker compose stop client- (Optional) Remove build artifacts and perform a fresh install:
sudo rm -r -f .nuxt .output/ node_modules/
npm install- Migrate data:
npm run migrate- Start the container:
sudo docker compose start clientMain data files:
dldt_data/cdt_printers.csv--- Printer datadldt_data/books.json--- Book datadldt_data/extracted_character_data.json--- Character data
To add, modify, or remove data, edit the relevant file and then run:
npm run migrateFor details on the migration process, see:
scripts/init-db.ts
python3 query_db.py --dump_cached_char_paths dldt_data/cached_char_paths.txt --remove_chars_from_json_path --unique_id_list_files dldt_data/unique_id_flagged_for_deletion_202*
tar -cf dldt_data/cached_char_paths.tar -T dldt_data/cached_char_paths.txtpages/index.vue--- Main character list/gridpages/printers.vue--- Printers pagepages/about.vue--- About pagepages/characters/[id].vue--- Character detail pageserver/api/characters/[id].ts--- Character detail APIserver/api/character_class.ts--- Character classes APIserver/api/characters.ts--- Characters API (filters)server/api/printers.ts--- Printers APIlayouts/*.ts--- Layout filesplugins/*.ts--- Plugin scripts (Axios, Vuetify, etc.)
The DLDT project uses Vue.js. Site pages are built from .vue
components that combine:
<template>--- HTML-like markup<script>--- JavaScript/TypeScript logic<style>--- CSS (often scoped)
Key directories:
pages/--- Main pagescomponents/--- Reusable componentsassets/--- CSS, fonts, imagespublic/--- Static assetslayouts/--- Layout templates
- Edit
.vuefiles inpages/orcomponents/ - Test locally:
npm run dev- Commit changes:
git add .
git commit -m "Describe change"
git push- Rebuild & relaunch:
npm run migrate
sudo docker compose restart client- Uses Docker for deployment
- Uses npm for dependencies
- API code lives in
server/api/ - Migration logic lives in
scripts/init-db.ts - GitHub: https://github.com/printprobability/dldt