{"id":13530498,"url":"https://github.com/KATT/shop","last_synced_at":"2025-04-01T18:31:52.208Z","repository":{"id":46662874,"uuid":"123173366","full_name":"KATT/shop","owner":"KATT","description":"🛍🛒 Full-stack React/Prisma/TS/GraphQL E-Commerce Example","archived":true,"fork":false,"pushed_at":"2021-06-09T08:18:30.000Z","size":5565,"stargazers_count":383,"open_issues_count":1,"forks_count":41,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-15T07:04:22.477Z","etag":null,"topics":["circleci","graphql","jest","nextjs","nightwatch","now","prisma","react","typescript"],"latest_commit_sha":null,"homepage":"https://shop.kattcorp.co.uk","language":"TypeScript","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/KATT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-27T18:51:51.000Z","updated_at":"2024-10-29T08:06:29.000Z","dependencies_parsed_at":"2022-08-28T19:40:57.525Z","dependency_job_id":null,"html_url":"https://github.com/KATT/shop","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KATT%2Fshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KATT%2Fshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KATT%2Fshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KATT%2Fshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KATT","download_url":"https://codeload.github.com/KATT/shop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246568999,"owners_count":20798341,"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":["circleci","graphql","jest","nextjs","nightwatch","now","prisma","react","typescript"],"created_at":"2024-08-01T07:00:50.844Z","updated_at":"2025-04-01T18:31:51.857Z","avatar_url":"https://github.com/KATT.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"\u003e **Archived:** This is using Prisma **1** which has been discontinued.\n\n# React/Prisma/TS/GraphQL E-Commerce Example\n\n[![Build Status](https://travis-ci.org/KATT/shop.svg?branch=master)](https://travis-ci.org/KATT/shop) [![Maintainability](https://api.codeclimate.com/v1/badges/073d5e009a2b0cd2d0b9/maintainability)](https://codeclimate.com/github/KATT/shop/maintainability)\n\nAttempt to create a great reference project with an amazing developer experience wherein a lot of common React/Prisma/GraphQL challenges are addressed.\n\n- [shop.kattcorp.co.uk](https://shop.kattcorp.co.uk)\n- [shop-api.kattcorp.co.uk](https://shop-api.kattcorp.co.uk)\n\n## Tech\n\n- [TypeScript](typescriptlang.org) (we have `*.js` in `.gitignore`!)\n- Monorepo setup with a few different projects\n  - `/api` - [GraphQL](http://graphql.org/) API Gateway in front of [Prisma](https://prismagraphql.com)\n  - `/web` - [Next.js](https://github.com/zeit/next.js/) [React](https://reactjs.org/) App with [Apollo Client](https://www.apollographql.com/)\n  - `/e2e` - [Nightwatch.js](http://nightwatchjs.org/) E2E testing\n- [Travis CI](https://travis-ci.org) with [Sauce Labs](http://saucelabs.com/) for cross-browser testing\n\n### `/web` features\n\n- Server-side rendered React app.\n- GraphQL using Apollo with optmistic updates.\n- Pessimistic™ updates - app works completely **without JS enabled** in the browser (and there's E2E tests for it).\n- Creates a shopping cart (`Order`) before page load, reference id saved to cookies\n- Add/edit products to/in cart\n- Product list from GraphQL\n- Open checkout route in modal\n- Discount code support (try code \"`first`\")\n\n## Setup\n\n1.  Install node 9\n1.  Install [Homebrew](https://brew.sh/)\n1.  Install Docker - `brew cask install docker`\n1.  Install yarn - `npm install -g yarn`\n1.  Start Docker\n1.  `yarn install`\n    - Installs deps for\n      - `/`\n      - `/api`\n      - `/web`\n      - `/e2e`\n1.  Start Prisma + seed DB `yarn setup:prisma`\n\n## Development\n\n```sh\nyarn dev\n```\n\nStarts the `/api` Gateway, the Next.js `/web`, and a TypeScript watcher for `/e2e` in parallell.\n\nIf you prefer separate output, navigate to `/api`, etc in separate shells and run `yarn dev`\n\nIf everything goes smoothly you should be able to access the below:\n\n- API Gateway: http://localhost:4000\n- Web App: http://localhost:5000\n\n## Tests\n\n### API Gateway\n\nUses [Jest](https://facebook.github.io/jest/).\n\n```sh\nyarn test:api\n```\n\n### Web\n\n`/web` has no tests _(yet)_.\n\n### E2E\n\n#### Install dependencies\n\n```sh\nbrew install selenium-server-standalone\nbrew install chromedriver\nbrew install geckodriver\nbrew cask install java\n```\n\n#### Run\n\n1.  Run selenium: `yarn selenium`\n1.  Setup + start apps: `yarn setup \u0026\u0026 yarn build \u0026\u0026 yarn dev`\n1.  Run tests: `yarn start:e2e`\n    - Will run E2E in Chrome with JS enabled\n    - To run without js: `yarn start:e2e -- --env chrome:nojs`\n    - See [nightwatch.ts](./e2e/src/nightwatch.ts) for all envs\n\n### Conventions, how to write etc\n\n#### `/web`\n\n- `/mutations` and `/queries` exposes render prop components for easy handling of data loading / rendering\n- .. _TBC_\n\n## What's next / questions\n\nThis is a bit of a playground for web tech for me. I'm still developing it \u0026 I gather a list of things I'd like to do in [issues](https://github.com/KATT/shop/issues).\n\nIf you have problems running it, ideas of things to add, things you want me to explain / elaborate on, or need help to build a product - [open an issue](https://github.com/KATT/shop/issues/new) or reach out to me [on Twitter](https://twitter.com/alexdotjs).\n\nFeel free to fork it and make a pull request of something cool!\n\n---\n\n```\n             / )\n / )__/ )___/ /\n( @ . @ )     )\n (           )\n //\"//\"\"//\"//\n\n KATTCORP LTD.\n```\n\nby [kattcorp.com](https://kattcorp.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKATT%2Fshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKATT%2Fshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKATT%2Fshop/lists"}