Skip to content

Commit de5cb0c

Browse files
committed
refactor: move engine to TechEngine; TechAPI keeps data, site & self-deploy
TechAPI is now the curated dataset + public site + a lightweight bundled validator, and deploys its own GitHub Pages homepage. The API server, ingestion crawlers, static-dump generator, coverage checks and full validation live in TechEngine (linked as a submodule). - remove app/ backend, tests/, scripts/ (dump.py, seed.py), docs/, Dockerfile, docker-compose.yml, .env.example, .dockerignore, pyproject.toml - remove refresh-data.yml + test.yml (dump refresh and backend tests belong to TechEngine) - rewrite deploy-pages.yml to build & deploy site/ WITHOUT the backend — Pages is per-repo, so TechAPI deploys its own homepage; the static JSON dump it serves is produced by TechEngine and committed under site/public/v1 - keep data/, site/, the lightweight validator (scripts/validate.py -> app/validate.py) and validate-data.yml (self-check, then chains to TechEngine's full validation) Refs #1
1 parent 545e489 commit de5cb0c

58 files changed

Lines changed: 59 additions & 5258 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 0 additions & 18 deletions
This file was deleted.

.env.example

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
1-
<!-- PR title must follow Conventional Commits (§14.5), e.g. feat(api): add /compare endpoint -->
1+
<!-- PR title must follow Conventional Commits, e.g. feat(data/cpu): add EPYC Rome SKUs -->
22

33
## What & why
44

55
<!-- What does this change and why? Link issues with "Closes #123". -->
66

7-
## How
7+
## Source
88

9-
<!-- Key implementation notes. -->
10-
11-
## Testing
12-
13-
<!-- How was this verified? Paste test output or screenshots. -->
9+
<!-- Cite the upstream source (vendor product page, Wikipedia infobox, datasheet). -->
1410

1511
## Checklist
1612

17-
- [ ] Type hints on all new functions (§0.5.4)
18-
- [ ] Tests added/updated (§15)
19-
- [ ] `ruff check` and `pytest` pass locally
20-
- [ ] Data changes pass `python -m scripts.validate`
21-
- [ ] SPEC/README updated if behavior changed (§0.5.4)
13+
- [ ] `python -m app.validate` passes locally
14+
- [ ] Files live at the correct `data/<category>/<...>/<slug>.json` path
15+
- [ ] Slugs are kebab-case and unique within the category
16+
- [ ] `source_urls` cites at least one canonical reference

.github/workflows/deploy-pages.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
name: deploy-pages
22

3-
# Builds the Astro site (intro homepage + OpenAPI docs) together with the static
4-
# JSON data dump and deploys everything to GitHub Pages. The dataset does not need
5-
# to be complete — whatever is curated in data/ is published.
3+
# Builds the Astro site (site/) and deploys it to GitHub Pages. TechAPI owns its
4+
# own homepage, so it deploys itself (Pages is per-repo). No backend here — the
5+
# static JSON dump the site consumes is produced by TechEngine and committed
6+
# under site/public/v1 (served at <base>/v1/...).
67
# Enable once: Settings → Pages → Source = GitHub Actions.
78
on:
89
push:
910
branches: [main]
11+
paths:
12+
- "site/**"
13+
- ".github/workflows/deploy-pages.yml"
1014
workflow_dispatch:
1115

1216
permissions:
@@ -24,20 +28,6 @@ jobs:
2428
steps:
2529
- uses: actions/checkout@v4
2630

27-
- uses: actions/setup-python@v5
28-
with:
29-
python-version: "3.12"
30-
cache: pip
31-
32-
- name: Install Python deps
33-
run: pip install -e .
34-
35-
- name: Validate curated data
36-
run: python -m scripts.validate
37-
38-
- name: Generate static JSON dump + openapi.json
39-
run: python -m scripts.dump --output dump
40-
4131
- uses: actions/setup-node@v4
4232
with:
4333
node-version: "22"
@@ -50,11 +40,10 @@ jobs:
5040
npm ci
5141
npm run build
5242
53-
- name: Assemble site (Astro dist + JSON data dump)
43+
- name: Assemble _site
5444
run: |
5545
mkdir -p _site
5646
cp -r site/dist/. _site/
57-
cp -r dump/. _site/
5847
touch _site/.nojekyll
5948
6049
- uses: actions/upload-pages-artifact@v3

.github/workflows/refresh-data.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
11
name: validate-data
22

3+
# Self-check: every PR runs the bundled lightweight validator. Heavy checks
4+
# (coverage gaps, schema migrations, ingestion smoke tests) live in TechEngine.
35
on:
46
pull_request:
57
paths:
68
- "data/**"
9+
- "app/validate.py"
10+
push:
11+
branches: [main]
12+
paths:
13+
- "data/**"
14+
- "app/validate.py"
715

816
jobs:
9-
validate:
17+
self-validate:
1018
runs-on: ubuntu-latest
1119
steps:
1220
- uses: actions/checkout@v4
1321
- uses: actions/setup-python@v5
1422
with:
1523
python-version: "3.12"
16-
- name: Validate seed JSON (§9.3, §15.3)
17-
run: python -m scripts.validate
24+
- name: Self-check (bundled validator)
25+
run: python -m app.validate
26+
27+
engine-validate:
28+
needs: self-validate
29+
uses: GetTechAPI/TechEngine/.github/workflows/validate-data.yml@main
30+
with:
31+
data-ref: ${{ github.event.pull_request.head.sha || github.sha }}

Dockerfile

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)