{"id":15504620,"url":"https://github.com/alanbsmith/pizza-api","last_synced_at":"2025-03-28T18:43:39.474Z","repository":{"id":78448048,"uuid":"124697649","full_name":"alanbsmith/pizza-api","owner":"alanbsmith","description":"A GraphQL API for 🍕","archived":false,"fork":false,"pushed_at":"2018-03-15T23:17:46.000Z","size":49,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-02T19:28:55.191Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alanbsmith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-10T20:54:02.000Z","updated_at":"2021-11-15T09:47:56.000Z","dependencies_parsed_at":"2023-04-25T04:49:23.543Z","dependency_job_id":null,"html_url":"https://github.com/alanbsmith/pizza-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/alanbsmith%2Fpizza-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanbsmith%2Fpizza-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanbsmith%2Fpizza-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanbsmith%2Fpizza-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alanbsmith","download_url":"https://codeload.github.com/alanbsmith/pizza-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246083018,"owners_count":20720895,"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":[],"created_at":"2024-10-02T09:19:15.488Z","updated_at":"2025-03-28T18:43:39.455Z","avatar_url":"https://github.com/alanbsmith.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pizza GraphQL API 🍕\n\n## OVERVIEW\n\nThis is an example GraphQL API for finding the best pizza around the world. The seed data comes from GeoJSON data\n\n### Tech Stack\n\n* PostgreSQL / Knex (DB layer)\n* Node / Express (Server layer)\n* Nodemon (to auto-restart the server)\n* GraphQL / Express GraphQL (API layer)\n\n## UP \u0026 RUNNING\n\n### Install Dependencies\n\n```\n$ npm install\n```\n\n_or_\n\n```\n$ yarn\n```\n\n### Database Setup\n\n_**NOTE:** This assumes you have the Knex CLI installed. If not, first run:_\n\n```\n$ npm install -g knex\n```\n\n#### Creating your Database\n\nChange the database name on line 7 of `knexfile.js` from `react-graphql-starter` to whatever you'd like. Then in your terminal run:\n\n```\n$ createdb your-db-name\n```\n\nYou'll also need to create a `.env` file at the root of your project and add a username and password for your database. This file is already added to the `.gitignore`. You can follow the example in `.env.sample` to see how to set it up.\n\n```\n$ touch .env\n```\n\n```\n//.env\nDB_USER=\"your-username\"\nDB_PASSWORD=\"your-secret-password\"\n```\n\n#### Updating Migrations\n\nCurrently, there is a single migration file in `db/migrations` for creating Pizzerias. You're welcome to change it to whatever you'd like by running:\n\n```\n$ knex migrate:make your-migration-name\n```\n\nTo run the migrations:\n\n```\nknex migrate:latest\n```\n\n#### Using Seeds\n\nCurrently, there is a single seed file in `seeds/pizzerias` to generate some initial data. You're welcome to change it to whatever you'd like by running:\n\n```\n$ knex seed:make your-seed-file-name\n```\n\nTo run the seed file:\n\n```\n$ knex seed:run\n```\n\n### Fire Up Your Server\n\n```\n$ npm start\n```\n\nYou can view the GraphiQL UI at `http://localhost:8080/graphql`.\n\nIf you'd like more information on using `express-graphql`, you can find great docs [here](http://graphql.org/graphql-js/running-an-express-graphql-server/) and [here](https://github.com/graphql/express-graphql).\n\n#### Example Requests\n\n**FETCH PIZZERIAS**\n\n```\n{\n  fetchPizzerias {\n    id\n    name\n\t\twebsite\n    city\n    address\n    lat\n    lng\n  }\n}\n```\n\n**FETCH PIZZERIA**\n\n```\n{\n  fetchPizzeria(id: 1) {\n    id\n    name\n\t\twebsite\n    city\n    address\n    lat\n    lng\n  }\n}\n```\n\n**CREATE PIZZERIA**\n\n```\nmutation {\n  createPizzeria(input: {\n    text: \"get groceries\",\n  }) {\n    id\n    name\n\t\twebsite\n    city\n    address\n    lat\n    lng\n  }\n}\n```\n\n**UPDATE PIZZERIA**\n\n```\nmutation {\n  updatePizzeria(input: {\n    id: 1\n    website: \"https://brooklyn-pizza.com\"\n  }) {\n    id\n    name\n\t\twebsite\n    city\n    address\n    lat\n    lng\n  }\n}\n```\n\n**DESTROY PIZZERIA**\n\n_This is currently disabled, because why would you destroy a pizzeria, you monster??_\n\n```js\nmutation {\n  destroyPizzeria(id: 4) {\n    id\n  }\n}\n```\n\n**Note:** _This is only setup for development at the moment. Nodemon is set to restart the server and GraphiQL UI is running by default._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanbsmith%2Fpizza-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falanbsmith%2Fpizza-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanbsmith%2Fpizza-api/lists"}