Skip to content

About

No description or website provided.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

117 Commits

Folders and files

Repository files navigation

frame-data

The frame data for FightCore both in database form as well as several scripts that have helped within the creation of this data.

The frame data is stored in PostgreSQL 17. The most recent backup is database/postgres-latest-dump.sql, with dated backups in database/dumps/.

JSON and CSV files

In the data folder are the CSV files are a mix of different JSON and CSV files. These are used in different FightCore products, but are free to be used by others.

Please note that these files are generated by the backend project and edits will not be accepted in pull requests.

Setup

Requirements: Docker and the .NET 9 SDK. The commands below use < and > file redirection, so on Windows run them in Git Bash or WSL, not PowerShell.

1. Start the database

cd database
docker compose up -d

This starts Postgres on localhost:5432 (user postgres, password localcontainer) and stores its data in database/db-data.

2. Restore the backup

docker exec fightcore_postgres createdb -U postgres FrameData
docker exec -i fightcore_postgres psql -U postgres -d FrameData -v ON_ERROR_STOP=1 < database/postgres-latest-dump.sql

The backup already contains every script in migrations/, so there is nothing else to apply after a restore.

3. Run the GraphQL API

cd backend
dotnet run --project FightCore.GraphQL

The connection string is in backend/FightCore.GraphQL/appsettings.Development.json.

4. Regenerate the exports

The exporters read appsettings.json from the current directory, so run them from their project folder. Output goes to the folder set in Exports:Folder (default C:/tmp/exports), which can then be copied into data/.

cd backend/FightCore.Exporters
dotnet run

cd ../Fightcore.MeleeSearchExporter
dotnet run

Making changes to the data

  1. Add a numbered SQL script to migrations/ (e.g. 023-description.sql).

  2. Apply it to your local database:

    docker exec -i fightcore_postgres psql -U postgres -d FrameData -v ON_ERROR_STOP=1 < migrations/023-description.sql
  3. Update the backup:

    docker exec fightcore_postgres pg_dump -U postgres FrameData > database/postgres-latest-dump.sql

    Optionally keep a dated copy in database/dumps/ named postgres_localhost-YYYY_MM_DD_HH_MM_SS-dump.sql.

Contributing

While we welcome others to contribute to the FightCore database, we would prefer if these contributions would be in the form of SQL Scripts. Both the backup files as well as the JSON in the data folder is only for generation and not manually edited.

About

No description or website provided.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages