{"id":16487606,"url":"https://github.com/saeris/scribe","last_synced_at":"2025-08-01T22:33:14.442Z","repository":{"id":20793272,"uuid":"73576835","full_name":"Saeris/Scribe","owner":"Saeris","description":"📜 A GraphQL Magic: The Gathering API Server for Compendium","archived":false,"fork":false,"pushed_at":"2022-07-08T08:42:53.000Z","size":691,"stargazers_count":13,"open_issues_count":18,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-19T17:55:58.175Z","etag":null,"topics":["apollo","apollo-server","bookshelfjs","graphql","graphql-server","hapijs","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Saeris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-12T20:31:23.000Z","updated_at":"2021-05-17T01:29:02.000Z","dependencies_parsed_at":"2022-06-29T10:55:08.145Z","dependency_job_id":null,"html_url":"https://github.com/Saeris/Scribe","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saeris%2FScribe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saeris%2FScribe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saeris%2FScribe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saeris%2FScribe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saeris","download_url":"https://codeload.github.com/Saeris/Scribe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228413945,"owners_count":17915919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apollo","apollo-server","bookshelfjs","graphql","graphql-server","hapijs","javascript"],"created_at":"2024-10-11T13:35:24.417Z","updated_at":"2024-12-06T05:01:42.217Z","avatar_url":"https://github.com/Saeris.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scribe\n*A GraphQL Magic: The Gathering API Server*\n\n## \u003ca name=\"contents\"\u003e\u003c/a\u003e Table of Contents\n\n  - [Getting Started](#start)\n  - [Installation](#install)\n  - [Running the Server Locally](#run)\n  - [Running the Server in Production](#production)\n  - [Resetting the Database](#reset)\n  - [License Information](#license)\n  - [Prior Art](#priorart)\n  - [Further Reading](doc/README.md)\n\n## \u003ca name=\"start\"\u003e\u003c/a\u003e Getting Started\n\n\u003e *[Back to Top](#contents)*\n\n## \u003ca name=\"install\"\u003e\u003c/a\u003e Installation\n\nBefore you start, make sure you have a working [NodeJS](http://nodejs.org/) environment, with NPM 3. Preferably use [Yarn](https://yarnpkg.com/) instead of NPM for installation of packages to ensure that you'll use exactly the same dependencies as the project.\n\nFrom the project folder, execute the following command:\n\n```shell\nnpm install\n```\n\nOr if you are using Yarn, execute this command instead:\n\n```shell\nyarn\n```\n\nOnce installation of project dependencies completes, run the following command to set up your local development environment:\n\n```shell\nnpm run setup\n```\n\nFirst this will create a default `.env` file in which you can define various environment variables such as your MySQL connection details, should you like to use it instead of SQLite3. `.env` is used to store sensitive information you do not want to commit.\n\nSecond, it will create a new database file under `src/scribe.sqlite` to serve as your default local development database. It will then run a set of Knex.js migrations to set up the default database schema.\n\nYour development environment is now ready to go!\n\n\u003e *[Back to Top](#contents)*\n\n## \u003ca name=\"run\"\u003e\u003c/a\u003e Running the Server Locally\n\nTo start the server, simply run the following command:\n\n```shell\nnpm start\n```\n\nThe server should now be listening on port `1337`. To access GraphiQL and begin exploring the API documentation, navigate to [http://127.0.0.1:1337/graphiql](http://127.0.0.1:1337/graphiql) in your browser of choice.\n\nNext, you can begin to populate your newly created database by running the following in a second terminal window:\n\n```shell\nnpm run populate\n```\n\nThis will populate the database with data from the [Magic: The Gathering API](https://docs.magicthegathering.io/) and download all card images to `src/images`.\n\n\u003e **Please note:** `populate` may take many hours to fully run! You can cancel the script at any time during execution. It is recommended that you at least allow it to run until some cards from the first set are added to the database in order to have a decent amount of seed data to play with. Execution may run faster using MySQL instead of SQlite3. Please refer to [Running the Server in Production](#production) for more information.\n\n\u003e *[Back to Top](#contents)*\n\n## \u003ca name=\"production\"\u003e\u003c/a\u003e Running the Server in Production\n\nIf you would like to run the server in \"production\" mode, you will first need to install and setup [MySQL](https://dev.mysql.com/downloads/mysql/) on your local machine. Once complete, set your connection details in `.env`. Scribe uses this file to configure the database connection, otherwise it will use defaults defined in `src/config/server.config.js`.\n\nTo reset your production database schema, run:\n\n```shell\nnpm run resetdb:prod\n```\n\n\u003e **Warning:** this will first attempt to **drop** any database named 'scribe'.\n\nWhen completed, you can then run the server in production using:\n\n```shell\nnpm run start:prod\n```\n\nTo switch back to development, simply run:\n\n```shell\nnpm run start:dev\n```\n\n\u003e *[Back to Top](#contents)*\n\n## \u003ca name=\"license\"\u003e\u003c/a\u003e Resetting the Database\n\nTo delete all the data in the database and start from scratch, run one of the following commands:\n\n**Development (Sqlite3):**\n```shell\nnpm run resetdb\n```\n\n**Production (MySQL):**\n```shell\nnpm run resetdb:prod\n```\n\nThis is useful when making changes to the database schema, the populate script, or simply when you need to clear out existing data.\n\n\u003e *[Back to Top](#contents)*\n\n## \u003ca name=\"license\"\u003e\u003c/a\u003e License Information\n\nThis application uses images and data that are copyright of Wizards of the Coast (http://magic.wizards.com/en)\n\nScribe is made available under the MIT License (https://opensource.org/licenses/mit-license.html)\n\nAttribution is greatly appreciated! Please feel free to fork the project and submit pull requests.\n\n\u003e *[Back to Top](#contents)*\n\n## \u003ca name=\"priorart\"\u003e\u003c/a\u003e Prior Art\n\nScribe would not be possible without the fantastic work of\nAndrew Backes @adback03 on his [Magic: The Gathering API](https://magicthegathering.io/) project.\n\n\u003e *[Back to Top](#contents)*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaeris%2Fscribe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaeris%2Fscribe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaeris%2Fscribe/lists"}