{"id":23201588,"url":"https://github.com/mitodl/unified-ecommerce-frontend","last_synced_at":"2025-10-09T21:04:12.100Z","repository":{"id":264657626,"uuid":"893949605","full_name":"mitodl/unified-ecommerce-frontend","owner":"mitodl","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-08T12:40:52.000Z","size":2173,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-10-08T14:38:58.473Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mitodl.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-25T13:45:11.000Z","updated_at":"2025-09-25T14:16:55.000Z","dependencies_parsed_at":"2024-12-09T22:28:17.428Z","dependency_job_id":"3b0c22a6-7bae-430f-8d92-863ee46baa9e","html_url":"https://github.com/mitodl/unified-ecommerce-frontend","commit_stats":null,"previous_names":["mitodl/unified-ecommerce-frontend"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mitodl/unified-ecommerce-frontend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitodl%2Funified-ecommerce-frontend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitodl%2Funified-ecommerce-frontend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitodl%2Funified-ecommerce-frontend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitodl%2Funified-ecommerce-frontend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitodl","download_url":"https://codeload.github.com/mitodl/unified-ecommerce-frontend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitodl%2Funified-ecommerce-frontend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002071,"owners_count":26083285,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-18T15:15:58.091Z","updated_at":"2025-10-09T21:04:12.085Z","avatar_url":"https://github.com/mitodl.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unified Ecommerce Frontend\n\nThis is a frontend for the [Unified Ecommerce](https://github.com/mitodl/unified-ecommerce) project built with React and NextJS.\n\n## Initial Setup\n\nFirst, ensure that you have the [Unified Ecommerce Backend](https://github.com/mitodl/unified-ecommerce) up and running locally.\n\n### Configure Required Environment Variables\n\nEnvironment variables are described in detail in `env/env.defaults`; all env vars should have functional defaults. However, a few dependencies to note:\n\n- In the Unified Ecommerce backend, `MITOL_UE_PAYMENT_BASKET_ROOT` and `MITOL_UE_PAYMENT_BASKET_CHOOSER` should point to the this repo's frontend. (e.g., `https://ue.odl.local:8072`)\n\n_It's easiest if the React app and the backend use the same hostname._ Otherwise, you may run into some CORS and CSRF errors.\n\n### Run the app\n\n#### With Docker\n\nWith `docker compose up`, you should be up and running. Visit the application at http://ue.odl.local:8072\n\n#### Without Docker\n\nYou can run the app outside of docker. This may be faster and more convenient. Two things are needed:\n\n1. Some way to load environment variables. [direnv](https://direnv.net/) is a great tool for this; a sample `.envrc` file is committed in the repo.\n2. A NodeJS runtime; [`nvm`](https://github.com/nvm-sh/nvm) is a simple tool for managing NodeJS versions.\n\nWith that done, `yarn start`, `yarn install`, and visit http://ue.odl.local:8072\n\n### Testing the Build\n\nYou can test the build using the Docker Compose environment.\n\nRun the app: `docker compose --profile build up`\n\nThis will run a container that will produce a build of the app, and then start an nginx container configured to serve it on port 7777. You can then go to http://ue.odl.local:7777 to test. This won't hot-reload, and you'll need to restart both `build` and `nginx` to see changes come through.\n\n\u003e [!IMPORTANT]\n\u003e This _also_ runs the `watch` container. You can use it too if you want - just _wait for `build` to finish doing its thing first_. (Otherwise, they step on each other.)\n\n## Accessing the Application\n\nThe Unified Ecommerce backend uses same-site cookies for authentication. Therefore, the frontend client must run on the \"same site\" as the backend. Therefore, if the backend runs on `ue.odl.local:8073`, you **must** access the frontend on at a hostname such as `ue.odl.local` (or `*.odl.local`), _not_ `localhost`.\n\nTo prevent CORS and CSRF errors, set the frontend and backend URLs to be either the same hostname (`ue.odl.local`) or set the backend to be a subdomain of the frontend (`api.ue.odl.local` and `ue.odl.local` - this is closer to the actual deployment).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitodl%2Funified-ecommerce-frontend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitodl%2Funified-ecommerce-frontend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitodl%2Funified-ecommerce-frontend/lists"}