SquireTournamentServices / mtg-search-engine

This repo will have the AST for the mtg search engine. This repo is for checking if a card matches a query. It will (when I get round to it) have implementations in an array of languages.
The Unlicense
2 stars 1 forks source link

mtg-search-engine

This is an open source library and, standalone application that supports the searching of MTG cards and sets. It has a syntax that is similar to Scryfall but it can be embedded anywhere.

Frontend Main Memory tests Coverage codecov

Requirements

  • these can be included via submodules, see the SquireDesktop repo for an example

Optional Requirements

Building and Testing

This project is written in C and, targets all platforms. There is an optional frontend and web API for this project, these can simply not be built.

Backend / Library / CLI

# You might want to use a Nix shell to install things for you
nix-shell shell.nix

# Or on mac
# nix-shell shell_mac.nix

# You should be in a python virtual environment
python -m venv .
# If you are on windows or use fish, you must change this line
source bin/activate

pip install -r requirements.txt

# .
mkdir -p build
cd build

# ./build/
# You can use -DMSE_DOXYGEN=ON to generate documentation
cmake -DMSE_WEB_API=ON -DUSE_JEMALLOC=ON ..
# cmake -DMSE_WEB_API=ON -DUSE_JEMALLOC=ON ..
cmake --build . -j

ctest -V -j # Runs all the tests

Testing on poor internet

Local test flag for slow internet: MSE_TEST, use this to make the program always read a cached copy of AllPrintings.json, really useful when running on crap internet.

export MSE_TEST=true
./mtg-search-engine-tests

Frontend

The frontend uses NextJS with the app dir.

cd frontend
npm i
npm build