{"id":23611569,"url":"https://github.com/rawsashimi1604/poke_tcg_db","last_synced_at":"2026-04-12T03:35:51.065Z","repository":{"id":58210970,"uuid":"528080614","full_name":"rawsashimi1604/Poke_TCG_DB","owner":"rawsashimi1604","description":"Poke TCG DB is a web application made to conveniently access all the information you need on Pokemon TCG Cards at one place.","archived":false,"fork":false,"pushed_at":"2022-09-10T09:23:50.000Z","size":9663,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-27T16:16:04.333Z","etag":null,"topics":["database","express","fullstack","javascript","nextjs","pokemon","postgresql","reactjs","restapi","tradingcard"],"latest_commit_sha":null,"homepage":"https://poke-tcg-db.vercel.app/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rawsashimi1604.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-08-23T16:45:32.000Z","updated_at":"2023-03-07T07:50:55.000Z","dependencies_parsed_at":"2023-01-18T02:45:47.361Z","dependency_job_id":null,"html_url":"https://github.com/rawsashimi1604/Poke_TCG_DB","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/rawsashimi1604%2FPoke_TCG_DB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawsashimi1604%2FPoke_TCG_DB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawsashimi1604%2FPoke_TCG_DB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawsashimi1604%2FPoke_TCG_DB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rawsashimi1604","download_url":"https://codeload.github.com/rawsashimi1604/Poke_TCG_DB/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239483870,"owners_count":19646426,"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":["database","express","fullstack","javascript","nextjs","pokemon","postgresql","reactjs","restapi","tradingcard"],"created_at":"2024-12-27T16:16:08.770Z","updated_at":"2026-04-12T03:35:46.044Z","avatar_url":"https://github.com/rawsashimi1604.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ePoke TCG DB - Web database on your favourite Pokemon TCG Cards!\u003c/h1\u003e\n\n\u003cdiv align=\"\"\u003e\n  \u003cimg src=\"https://badgen.net/badge/License/Apache License 2.0/yellow?labelColor=black\"/\u003e\n  \u003cimg src=\"https://badgen.net/badge/npm/8.15.0/green?labelColor=black\"/\u003e\n  \u003cimg src=\"https://badgen.net/badge/node/16.17.0/green?labelColor=black\"/\u003e\n\u003c/div\u003e\n\n\u003cbr/\u003e\n\n![Home](./docs/Homepage.png)\n\n## About\nPoke TCG DB is a web application made to conveniently access all the information you need on Pokemon TCG Cards at one place. Get the latest cards, card sets and prices from [TCGPlayer](https://www.tcgplayer.com/)! Started this project to learn more about full stack development and SQL in particular.\n\n## Frameworks / Libraries used\n\n| Framework    | Function                                                      |\n| ----------   | ------------------------------------------------------------- | \n| Next.js      | Frontend framework to display data to users |\n| axios      | HTTP requests to backend server |\n| MUI      | Prebuilt form components |\n| TailwindCSS      | CSS styling and color palettes |\n| formik     | Form handling |\n| Express.js     | Backend framework to serve HTTP requests and routing |\n| pokemontcgsdk    | Node.js wrapper around Pokemon TCG API |\n| PostgreSQL     | Relational Database |\n| Vercel     | Host frontend service |\n| Heroku     | Host backend service |\n\n## How it works\n- Frontend and Backend connects through REST APIs.\n- Backend queries cloud Postgres database on request hit.\n- Gets data and runs through middleware\n- Outputs JSON to Next.js app.\n- Next.js parses JSON and serves to end user.\n\n## ER Diagram\n### Made using [SqlDBM](https://sqldbm.com/Home/) \n![ER Diagram](./docs/ER_Diagram.png)\n\n## API routes\n\nAPI URL: https://poke-tcg-db.herokuapp.com/\n\n### Card\n| Type    | Route | Description |\n| ----------   | -------- | -------- | \n| `GET`    | `/api/cards/all` | Get all cards from database. |\n| `GET`    | `/api/cards/set/:set` | Get all cards from database by specific set_id. |\n| `GET`    | `/api/cards/type/\u003ctype\u003e?quantity=\u003cqty\u003e` | Get all cards from database that matches type with specific quantity. |\n| `GET`    | `/api/cards/:card_id` | Get card from database by card_id. \n| `GET`    | `/api/cards/all?quantity=\u003cqty\u003e` | Get all cards from database with specific quantity. Ordered by latest released cards. |\n| `GET`    | `/api/cards/count` | Get total card count from database.|\n| `GET`    | `/api/cards/search?card_name=\u003ccard_name\u003e\u0026set_id=\u003cset_id\u003e\u0026type_id=\u003ctype_id\u003e\u0026supertype_id=\u003csupertype_id\u003e\u0026rarity_id=\u003crarity_id\u003e` | Search for card in database. card_name param is required. |\n\n### Set\n| Type    | Route | Description |\n| ----------   | -------- | -------- | \n| `GET`    | `/api/sets/all` | Get all card sets from database. |\n| `GET`    | `/api/sets/id/:id` | Get set from database by set_id. |\n| `GET`    | `/api/sets/count` | Get total card set count from database.|\n\n### Types\n| Type    | Route | Description |\n| ----------   | -------- | -------- | \n| `GET`    | `/api/types/all` | Get all pokemon types from database. |\n\n### Supertypes\n| Type    | Route | Description |\n| ----------   | -------- | -------- | \n| `GET`    | `/api/supertypes/all` | Get all supertypes from database. |\n\n### Rarities\n| Type    | Route | Description |\n| ----------   | -------- | -------- | \n| `GET`    | `/api/rarities/all` | Get all rarities from database. |\n\n## Installation\n- Register for Pokemon TCG API key from [Pokemon TCG API](https://pokemontcg.io/)\n- Clone from github\n- Run `npm install` in `/src` and `/src/client` directory to install both frontend and backend.\n- Create `.env` file, put in root directory. Env file contents will be put below.\n- Install PostgreSQL on your local machine.\n- Create Postgres User \n- Run `sql/createDatabase.pgsql`\n- `\\connect poke-tcg-db`\n- Run `sql/createTables.pgsql`\n- Run `src/scripts/seed.py` \n- If seed sucessful, installation is complete.\n- Else, run `sql/cleanTables.pgsql` to reset database.\n- Repeat seeding database til sucessful.\n- Run both apps on seperate on the terminal by `npm run dev`\n- Go to http://localhost:5000, next app will be displayed\n\n## Env file contents\nCreate `.env` file, put in root directory. Contents:\n```\nPG_USER=\u003cyour postgres username\u003e\nPG_PASSWORD=\u003cyour postgres password\u003e\nPG_HOST=localhost\nPG_PORT=\u003cyour postgres port number\u003e\nPG_DATABASE=poke-tcg-db\n\nPOKE_API_TCG_KEY=\u003cyour Pokemon TCG API key\u003e\n\nNEXT_APP_URL_LOCAL=http://localhost:5000\nNEXT_APP_URL=\u003cyour Vercel domain if you decide to host\u003e\n```\n\n## Special thanks\n- [Pokemon TCG API](https://pokemontcg.io/)\n- [duiker101](https://github.com/duiker101/) - [Pokemon Type SVG Icons](https://github.com/duiker101/pokemon-type-svg-icons)\n- [jnovack](https://github.com/jnovack/) - [Pokemon SVG Icons](https://github.com/jnovack/pokemon-svg)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frawsashimi1604%2Fpoke_tcg_db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frawsashimi1604%2Fpoke_tcg_db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frawsashimi1604%2Fpoke_tcg_db/lists"}