{"id":22731293,"url":"https://github.com/uffizzicloud/medusajs-previews","last_synced_at":"2025-09-08T00:35:12.332Z","repository":{"id":104847695,"uuid":"602092578","full_name":"UffizziCloud/medusajs-previews","owner":"UffizziCloud","description":"Uffizzi ephemeral environments for MedusaJS","archived":false,"fork":false,"pushed_at":"2023-04-27T23:22:24.000Z","size":39553,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"uffizzi","last_synced_at":"2025-05-25T12:02:05.839Z","etag":null,"topics":["ecommerce","ephemeral-environments","previews"],"latest_commit_sha":null,"homepage":"https://uffizzi.com","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/UffizziCloud.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}},"created_at":"2023-02-15T13:35:55.000Z","updated_at":"2023-11-16T23:54:57.000Z","dependencies_parsed_at":"2023-07-04T22:30:47.437Z","dependency_job_id":null,"html_url":"https://github.com/UffizziCloud/medusajs-previews","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/UffizziCloud/medusajs-previews","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UffizziCloud%2Fmedusajs-previews","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UffizziCloud%2Fmedusajs-previews/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UffizziCloud%2Fmedusajs-previews/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UffizziCloud%2Fmedusajs-previews/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UffizziCloud","download_url":"https://codeload.github.com/UffizziCloud/medusajs-previews/tar.gz/refs/heads/uffizzi","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UffizziCloud%2Fmedusajs-previews/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274117268,"owners_count":25225101,"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-09-07T02:00:09.463Z","response_time":67,"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":["ecommerce","ephemeral-environments","previews"],"created_at":"2024-12-10T19:21:15.064Z","updated_at":"2025-09-08T00:35:12.299Z","avatar_url":"https://github.com/UffizziCloud.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e \n  \u003ca href=\"https://www.medusa-commerce.com\"\u003e\n    \u003cimg alt=\"Medusa\" src=\"https://i.imgur.com/USubGVY.png\" width=\"100\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://uffizzi.com\"\u003e\n    \u003cimg alt=\"Uffizzi\" src=\"https://avatars.githubusercontent.com/u/68303350?s=200\u0026v=4\" width=\"100\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003e\n Uffizzi Ephemeral Environments for MedusaJS\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\nThis repo provides the skeleton to get you started with using \u003ca href=\"https://github.com/UffizziCloud/uffizzi\"\u003eUffizzi\u003c/a\u003e to create ephemeral environments for \u003ca href=\"https://github.com/medusajs/medusa\"\u003eMedusa\u003c/a\u003e. To better understand the whole system check out our blog on Medusa applications here. Follow the steps below to try out the previews for Medusa and better understand how the previews are build.\n\u003c/p\u003e\n\n## Try out Uffizzi\n\n1. Fork the repo\n2. Create a small change anywhere in the repo\n3. Create a pull requests with the change commit against the `uffizzi` branch to trigger the Github action workflows to see Uffizzi in action !\n\nThe following section provides information on how the ephemeral environments work.\n\n## Ephemeral environment builds for MedusaJS applications\n\n### Application architecture \n\nThe following is the architecutre of the Medusa application we will be building and previewing in Uffizzi in this repo. \n\n\n![alt text](public/architecture.png?raw=true \"NextJS + MedusaJS Application\")\n\n\nThe above is the architecture of the medusajs + nextjs application where medusajs is the backend and nextjs is the frontend. Considering we can have only one final ingress for the ephemeral environments as of now; we are going to set frontend as the ingress service. Frontend uses the backend which uses the other database and cache services so it will help us get a better idea if the application is working well or not.\n\n\nLet's look at what the Uffizzi configuration looks like and what configuration we need to add to make the above possible. \n\n\n### The Uffizzi configuration\n\nThe `docker-compose.uffizzi.yml` in the root of the repo is the main configuration file for Uffizzi. It is an everyday docker-compose file with the following changes made to it :-\n\n1. The `x-uffizzi` configuration. \n\n```yaml\nx-uffizzi:\n  ingress:\n    service: frontend\n    port: 8000\n```\n\nThe above configuration let's the Uffizzi engine know that this docker-compose file has been configured for Uffizzi. Here we define the ingress which points to the frontend of the application. The final Uffizzi URL for the ephemeral environment is created routes requests directly to the frontend service in this case.\n\n2. Values for the `image` parameter for the services which need to be built on every change.\n\nThe values for these are are updated to use ${MEDUSA_IMAGE} and the ${STOREFRONT_IMAGE} placeholders instead of local build contexts so that we can replace these placeholders with the image tags from the github action builds.\n\nConsidering that the frontend has been configured to consume the backend service, let's see how the medusajs backend consumes the postgres and the redis services.\n\n###  The MedusaJS configuration\n\nThe medusa.config.js projectConfig object below gives a better idea of how the medusa backend connects to other services : \n\n```js\nmodule.exports = {\n projectConfig: {\n   redis_url: REDIS_URL,\n   database_url: DATABASE_URL,\n   database_type: \"postgres\"\n },\n plugins,\n};\n```\n\nIn the above configuration the values for REDIS_URL and DATABASE_URL are pointing to the sockets exposed by the redis and postgres services. Check out https://docs.medusajs.com/ for any other configuration you would like to add.\n\n## Next steps\n\nTo learn more above creating epehemral environments for MedusaJS applications, check out our blog here and if you have any issues setting up Uffizzi or configuring MedusaJS, follow the links below.\n\nVisit [docs.uffizzi.com](https://docs.uffizzi.com) for more information on epehemeral environments.\nVisit [docs.medusa-commerce.com](https://docs.medusa-commerce.com) for further guides.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuffizzicloud%2Fmedusajs-previews","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuffizzicloud%2Fmedusajs-previews","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuffizzicloud%2Fmedusajs-previews/lists"}