{"id":21311681,"url":"https://github.com/georgwittberger/t3-commerce-template","last_synced_at":"2025-08-03T09:05:14.888Z","repository":{"id":212841112,"uuid":"624457789","full_name":"georgwittberger/t3-commerce-template","owner":"georgwittberger","description":"Headless commerce template based on T3 stack","archived":false,"fork":false,"pushed_at":"2023-04-06T14:15:47.000Z","size":206,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-06T10:47:02.339Z","etag":null,"topics":["example-project","headless-commerce","medusajs","next-auth","nextjs","project-template","t3-stack","trpc"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/georgwittberger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-04-06T14:06:45.000Z","updated_at":"2025-02-01T11:21:23.000Z","dependencies_parsed_at":"2023-12-16T17:38:54.536Z","dependency_job_id":"e8d9e138-ac96-4845-84c6-33694b731a14","html_url":"https://github.com/georgwittberger/t3-commerce-template","commit_stats":null,"previous_names":["georgwittberger/t3-commerce-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/georgwittberger/t3-commerce-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgwittberger%2Ft3-commerce-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgwittberger%2Ft3-commerce-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgwittberger%2Ft3-commerce-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgwittberger%2Ft3-commerce-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/georgwittberger","download_url":"https://codeload.github.com/georgwittberger/t3-commerce-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgwittberger%2Ft3-commerce-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264914015,"owners_count":23682758,"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":["example-project","headless-commerce","medusajs","next-auth","nextjs","project-template","t3-stack","trpc"],"created_at":"2024-11-21T17:19:18.686Z","updated_at":"2025-07-11T23:32:43.029Z","avatar_url":"https://github.com/georgwittberger.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# T3 Commerce Template\n\nThis is a project template for headless commerce using [T3 stack](https://create.t3.gg/) for the storefront and [Medusa.js](https://medusajs.com/) for the backend.\n\n## Getting Started\n\n### Required Software\n\n- [Node.js](https://nodejs.org/) version 18.x (or higher)\n- [pnpm](https://pnpm.io/) version 8.x (or higher)\n\n### General Preparation\n\n1. Clone this repository.\n2. Open terminal in local repository.\n3. Install NPM dependencies.\n\n```bash\npnpm install\n```\n\n### Setting Up Medusa.js Backend\n\n1. Open terminal in `apps/backend` folder.\n2. Run seed script\n\n   ```bash\n   pnpm seed\n   ```\n\n3. Start server\n\n   ```bash\n   pnpm start\n   ```\n\n4. Create test customer\n\n   ```bash\n   curl --request POST \\\n     --url http://localhost:9000/store/customers \\\n     --header 'Accept: application/json' \\\n     --header 'Content-Type: application/json' \\\n     --data '{\"first_name\":\"John\",\"last_name\":\"Doe\",\"email\":\"john@medusa-test.com\",\"password\":\"supersecret\",\"phone\":\"+49 123 456789\"}'\n   ```\n\n_Hint: You can access Medusa.js Admin via \u003chttp://localhost:9000/app\u003e and sign in with email \"admin@medusa-test.com\" and password \"supersecret\"._\n\n### Setting Up Next.js Storefront\n\n1. Open terminal in `apps/storefront` folder.\n2. Create `.env` file from template.\n\n   ```bash\n   cp .env.example .env\n   ```\n\n3. Generate secret key for Next-Auth.\n\n   ```bash\n   openssl rand -base64 32\n   ```\n\n4. Open `.env` file and insert variable with secret key.\n\n   ```bash\n   # .env\n   NEXTAUTH_SECRET=\"your_secret_key\"\n   ```\n\n5. Start server\n\n   ```bash\n   pnpm dev\n   ```\n\n### Browse the Storefront\n\n1. Visit \u003chttp://localhost:3000/\u003e\n2. Sign in with test customer:\n   - Email: john@medusa-test.com\n   - Password: supersecret\n\n## Fundamental Concepts\n\n### Storefront Based on Create T3 App\n\nThe storefront app has been set up using [Create T3 App](https://create.t3.gg/). See its documentation for more details.\n\n### Authentication Using Medusa.js\n\nThe storefront uses [Next-Auth](https://next-auth.js.org/) as authentication library. A custom provider is implemented to support sign in via Medusa.js API. See `src/integrations/medusa/auth-provider.ts`\n\nMedusa.js session ID is stored inside the JWT managed by Next-Auth and is not exposed as part of client session data (e.g. `useSession`). Therefore, it can only be access on the server-side, i.e. in `getServerSideProps` or in API routes (including tRPC procedures). As a consequence, all queries and mutations requiring user authentication must be proxied to Medusa.js via tRPC procedures. See auth router for example: `src/features/auth/server/api/auth-router.ts`\n\n### Internationalization Using i18next\n\nThe storefront supports English and German. Internationalization is implemented using [next-i18next](https://github.com/i18next/next-i18next). Language files with translations are located in `public/locales` folder.\n\nKeep in mind that data coming from Medusa.js is not localized because there is no multi-language support yet.\n\n### Styling Using daisyUI\n\nThe storefront has some basic styling using [TailwindCSS](https://tailwindcss.com/) and [daisyUI](https://daisyui.com/).\n\n### Modularization and Abstraction\n\nTo keep things simple, there are only two guidelines for modularization and abstraction in the storefront project.\n\n1. Feature-specific code belongs into the corresponding folder inside `src/features` (e.g. React components dedicated to the catalog in `src/features/catalog/components`) while shared code goes into the top-level directories (e.g. general React components in `src/components`)\n2. Communication with vendor-specific backend APIs is performed via service functions which create a backend-agnostic facade. These functions build the bridge between the business domain model used in React components and the underlying vendor-specific APIs (like Medusa.js model). See cart services for example: `src/features/cart/services`\n\n## License\n\n[MIT](https://opensource.org/license/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgwittberger%2Ft3-commerce-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorgwittberger%2Ft3-commerce-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgwittberger%2Ft3-commerce-template/lists"}