{"id":15529234,"url":"https://github.com/davidyell/learning-express-mtg-api","last_synced_at":"2026-01-08T03:15:03.809Z","repository":{"id":45128670,"uuid":"444769916","full_name":"davidyell/Learning-Express-MTG-Api","owner":"davidyell","description":"Magic the Gathering deck building back-end api written in Typescript with Express and Prisma ORM","archived":false,"fork":false,"pushed_at":"2023-08-18T16:06:09.000Z","size":82326,"stargazers_count":0,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T08:13:45.900Z","etag":null,"topics":["express","learning-exercise","magic-the-gathering","sqlite","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidyell.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":"2022-01-05T10:59:06.000Z","updated_at":"2022-09-06T21:16:09.000Z","dependencies_parsed_at":"2023-01-19T02:00:13.604Z","dependency_job_id":null,"html_url":"https://github.com/davidyell/Learning-Express-MTG-Api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidyell%2FLearning-Express-MTG-Api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidyell%2FLearning-Express-MTG-Api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidyell%2FLearning-Express-MTG-Api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidyell%2FLearning-Express-MTG-Api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidyell","download_url":"https://codeload.github.com/davidyell/Learning-Express-MTG-Api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246106668,"owners_count":20724400,"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":["express","learning-exercise","magic-the-gathering","sqlite","typescript"],"created_at":"2024-10-02T11:16:59.712Z","updated_at":"2026-01-08T03:15:03.763Z","avatar_url":"https://github.com/davidyell.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Magic the Gathering Deck App\nA project to learn Node.js, Express.js and Typescript\n\n## What?\nIt provides a crud [OpenAPI](https://swagger.io/resources/open-api/) json web service with a few endpoints for building Magic the Gathering decks.\n\nEndpoints are documented in the [openapi.yml](https://github.com/davidyell/Learning-Express-MTG-Api/blob/main/openapi-dist.yaml) file in the root of the project.\n\n### Visualise the api\nYou can import the yaml into the Swagger editor to visualise the api.\n\n* Visit https://editor-next.swagger.io/\n* File \u003e Import URL\n* Enter `https://raw.githubusercontent.com/davidyell/Learning-Express-MTG-Api/main/openapi-dist.yaml`\n\n## Installation\nFor *first time* install, after the dependancies, you'll need to populate the database with some data.\n\n* Install the dependancies with `yarn install`\n* Copy the `.env.example` file to `.env` and update your database path\n* Create the database and schema `yarn prisma db push`\n* Insert the card data `sqlite3 -init ./infrastructure/sql/import-all.txt ./infrastructure/database.sqlite` then `.quit` (takes about 2 mins)\n* Seed some players and decks `yarn prisma db seed`\n* Run the dev server `yarn run dev`\n* Visit http://localhost:3001/api/decks or send a request from [Postman](https://www.postman.com/downloads/) to see some MtG decks\n\n## Testing\nTwo test suites exist, a unit and integration suite. These can be run with `yarn run test:unit` and `yarn run test:integration`, or run everything with `yarn run test`\n\nAn integration testing database must be created for the integration tests to run, which can be setup with `./infrastructure/setup-test-db.sh`, you'll need to quit from `sqlite3` after the import with `.quit`\n\n----\n## References\n\n:mortar_board: Learn to play Magic the Gathering! https://magic.wizards.com/en/intro\n\n:no_good: Not officially affiliated or endorsed by Wizards of the Coast or Magic the Gathering\n\n:bowing_man: Thanks to MTGJSON for their free data https://mtgjson.com/downloads/all-files/\n\n:thumbsup: [Node.js](https://nodejs.org/en/about/)\n\n:zap: [Typescript](https://www.typescriptlang.org/)  \n\n:earth_africa: [Express](https://expressjs.com/)  \n\n:card_file_box: [Rest API Tutorial](https://restfulapi.net/)\n\n:mortar_board: I bought an excellent Typescript course on Udemy. [Understanding TypeScript - 2022 Edition](https://www.udemy.com/course/understanding-typescript/)\n\n:tv: They also have a great YouTube channel [Academind](https://www.youtube.com/academind)\n\n ## License\n\nMTG Deck Building API\nCopyright (C) 2022 David Yell \u003cneon1024@gmail.com\u003e\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidyell%2Flearning-express-mtg-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidyell%2Flearning-express-mtg-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidyell%2Flearning-express-mtg-api/lists"}