A JSON API to return data about the game Temtem from the Official Wiki, that is updated every 4 hours.
git clone [email protected]:maael/temtem-api.git
cd temtem-api
yarn
I used [email protected]
to develop it.
Script | Description |
---|---|
dev |
Starts the local development server on http://localhost:3000 , or whatever PORT is specified in env. |
build |
Builds server. |
start |
Started built server. |
lint |
Runs tslint against project. |
prettier |
Runs prettier against project, writing corrections. |
prettier:check |
Runs prettier against project, used by CI to check project. |
test |
|
data |
Runs data fetching scripts, you can filter them with a comma-separated list of codecs, and pass -D or --dry to do a dry run with no writes. |
assets |
Runs asset fetching scripts. |
summary |
Generates summary of fetched data. |
checker |
Checks generated data against codecs in ./scripts/checker/codecs using io-ts. |
sync |
Sequentially runs yarn data , yarn assets , and yarn summary . |
push |
Pushes ./data and ./public changes to GitHub. |
sync:push |
Sequentially runs yarn sync followed by yarn push . |
Environment Variable | Description |
---|---|
CIRCLECI_TOKEN |
Token for CircleCI, used in the /api/info endpoint to get status of last build. |
GA_TOKEN |
Token for google analytics, used on server to see API endpoint usage numbers. |
The data and asset scripts can be found in ./scripts/data
and ./scripts/assets
.
The data scripts are executed first, with get[Entity]
which gets the list of items with basic information from a category page or something similar, followed by embellish[Entity]
, that goes to each items page directly to embellish it with extra information. The data files are written to the ./data
directory.
got is used as the request library, and cheerio is used to parse the fetched HTML.
Once the data scripts are done, assets are collected, usually from items found in the data scripts execution and in the resulting .json
files in ./data
.
After this a summary file is created, listing all produced data files, and when they were updated.
Then the files in ./data
are checked against codecs in ./scripts/checker/codecs
to see if the produced shapes conform to what's expected, using io-ts.
The ./data
and ./public
directories are then pushed to GitHub, where now will deploy the changes.
Some extremely fuzzy and out of date types are available from @maael/temtem-types.
- Make sure
prettier
has been run, it should do it as a pre-commit hook thanks to husky and pretty-quick.
Also fair warning, I made this quick, so while it is Typescript, it's super loose with any
s all over the place.
- Breeding API endpoint
- Maybe automatic typing with quicktype or something
- Finish making data available under graphql endpoint. (minimal example here)
- Temtem Weakness Checker
- Temopedia mobile app
- EduardoAguiarS/Tempidia
- Khant-Ye-Yint/temx2dex
- TheSmartMonkey/temtem
- RonaldoAntonucci/temtemdex
- JhonatanMedeiros/temtem-info
- BenoitCrozemarie/project-temtem
- EricPohlers/temdex
- Maikoncg/temtemdex
- RealNickTriano/temtem-viewer
- Zhaetar/tempedia
- Xhiffer/temtemapi
- SeanTSinclair/temtem-combat
- EmilLubczynski/ProjectTemTem
- Marilyth/Temtem-EncounterTracker
- samrizzo/temtem-companion
- DoW-Gray/TemTem
- AnthonyGReed/temtrack
- SilvaraDesign/temtypes
- TesteurManiak/temtem_api_wrapper
- Liuk0000/TemTemTeamBuilder
- samrizzo/temtem-companion
- BenZr2/temtem_helper
- Iwasson/TemTem-Bot
- seanpavlak/Tempedia.Resource