{"id":18633182,"url":"https://github.com/marydn/star-wars","last_synced_at":"2026-05-01T06:34:01.732Z","repository":{"id":44004372,"uuid":"237827587","full_name":"marydn/star-wars","owner":"marydn","description":"Guzzle Middleware to send third-party API responses to Redis cache","archived":false,"fork":false,"pushed_at":"2023-01-07T14:23:38.000Z","size":822,"stargazers_count":1,"open_issues_count":14,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-17T11:36:21.675Z","etag":null,"topics":["api","api-client","api-rest","guzzle","guzzle-middleware","guzzlehttp","middleware","php","php7","redis"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/marydn.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":"2020-02-02T19:54:01.000Z","updated_at":"2021-08-31T20:18:44.000Z","dependencies_parsed_at":"2023-02-07T10:00:34.666Z","dependency_job_id":null,"html_url":"https://github.com/marydn/star-wars","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marydn/star-wars","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marydn%2Fstar-wars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marydn%2Fstar-wars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marydn%2Fstar-wars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marydn%2Fstar-wars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marydn","download_url":"https://codeload.github.com/marydn/star-wars/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marydn%2Fstar-wars/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32487569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["api","api-client","api-rest","guzzle","guzzle-middleware","guzzlehttp","middleware","php","php7","redis"],"created_at":"2024-11-07T05:14:32.355Z","updated_at":"2026-05-01T06:34:01.704Z","avatar_url":"https://github.com/marydn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 🚀 Environment setup using Docker\n\n### 🐳 Needed tools\n\n1. [Install Docker](https://www.docker.com/get-started)\n2. [Install npm](https://www.npmjs.com/get-npm)\n3. [Install yarn](https://classic.yarnpkg.com/en/docs/install)\n4. Clone this project: `$ git clone https://github.com/marydn/star-wars`\n5. Move to the project folder: `$ cd star-wars`\n6. Generate assets: `$ yarn install \u0026\u0026 yarn build`\n\n### 🛠️ Environment configuration\n\n1. By default, Redis TTL is set to 300 seconds. \n    \n   To override this parameter: \n    \n    ```bash\n    $ touch .env.local\n    $ echo 'REDIS_TTL=XXX' \u003e\u003e .env.local # where XXX is the desired int value\n    ```\n\n### 🌍 Application execution\n\n1. Start the project: `$ make build`\n   \n    This will install PHP dependencies and bring up the project Docker containers with Docker Compose.\n\n2. Check everything's up: `$ docker-composer ps`\n\n    It should show nginx and php services up.\n\n3. Go to `http:://localhost:8000` in your browser\n\n### Some Docker commands\n\n- Bringing up the project using Docker: `$ make`\n- Bringing down the project: `$ make destroy`\n- Rebuild Docker images forcing latest versions and ignoring cache: `$ make rebuild`\n\n### ✅ Tests execution\n\n1. Install PHP dependencies if you haven't done so: `$ make deps`\n2. Execute PHP Unit tests: `$ make test`\n\n## 🤔 Project explanation\n\nIt's a simple form that let you query an endpoint and print the result into a table using XMLHttRequest.\nEvery request made is cached in Redis using a Middleware (`src/Service/Middleware/CachedMiddleware.php`)\n\n```bash\n$ tree -L 4 src\nsrc\n├── Controller\n│   ├── HomeController.php\n│   └── JsonController.php\n├── Public\n│   ├── js\n│   │   └── entry.js # This is for webpack\n│   └── vue\n│       └── ApiFetcher.vue # Javascript component for front\n└── Service\n    ├── ApiConsumer.php # Service to wrap third-party requests\n    ├── Middleware\n    │   └── CachedMiddleware.php # Middleware that allows to call a cache wrapper per API call\n    ├── Normalizer\n    │   └── GuzzleResponseNormalizer.php # Normalize Guzzle Response Objects to save and retrieve to/from Redis\n    └── RedisCache.php # Some methods to handle Redis transactions\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarydn%2Fstar-wars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarydn%2Fstar-wars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarydn%2Fstar-wars/lists"}