{"id":21681594,"url":"https://github.com/mnsami/content-api","last_synced_at":"2026-05-05T13:33:10.961Z","repository":{"id":38157386,"uuid":"192783776","full_name":"mnsami/content-api","owner":"mnsami","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-19T19:35:29.000Z","size":276,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T10:51:13.845Z","etag":null,"topics":["anti-corruption-layer","ddd","docker","php","rest-api","restapi","symfony"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/mnsami.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-19T18:22:39.000Z","updated_at":"2024-07-06T20:04:34.000Z","dependencies_parsed_at":"2024-11-25T15:43:35.951Z","dependency_job_id":null,"html_url":"https://github.com/mnsami/content-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mnsami/content-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnsami%2Fcontent-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnsami%2Fcontent-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnsami%2Fcontent-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnsami%2Fcontent-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnsami","download_url":"https://codeload.github.com/mnsami/content-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnsami%2Fcontent-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32651339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["anti-corruption-layer","ddd","docker","php","rest-api","restapi","symfony"],"created_at":"2024-11-25T15:29:40.263Z","updated_at":"2026-05-05T13:33:10.943Z","avatar_url":"https://github.com/mnsami.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Content API\n\nThis API is an exercise to apply anti-corruption pattern along with practicing DDD.\n\n### 1. Frameworks and bundles used\n    \n1. `Symfony: 3.4`\n2. For caching, memcached is used.\n3. Nginx\n4. php-fpm\n    \n#### 1.1. Architecture\n\nMemcached is used to cache responses using the request information as cache key.\nCaching keys are being cached for 1 day only.\n\nI used the default Symfony Memcached adapter.\nhttps://symfony.com/doc/3.4/components/cache/adapters/memcached_adapter.html\n\nCache keys are generated like using this formula `sourceId_year_limit`, from the request.\n    \n### 2. Installations\n\n1. Setup project and containers:\n\n    1.1 checkout the project\n    \n        git clone git@github.com:mnsami/content-api.git\n        cd content-api\n        \n    1.2. copy `parameters.yml`\n    \n        make\n    \n    1.3. Start the containers and install dependencies\n\n        make all\n\n### 3. API Available routes\n\nTo make api request use `http://localhost/v1/` as base url.\ni.e. `http://localhost/v1/items` \n\n\n|  Name|                 Method|   Scheme|   Host|   Path|\n|--------------------|--------|--------|------|---------------------|\n|  get_items|       GET|     ANY|      ANY|    /v1/items|\n|  alive|                GET|      ANY|      ANY|    /v1/_healthCheck|\n\n#### 3.1 Api Documentation\n\n#### 3.1.1`GET /v1/items`\n- **Description:** Get items.\n- **method**: `GET`\n- **Response**: Items list. Request meta information.\n- **Url Params**:\n  - **sourceId:** Data source, **type:** string, **required:** true\n  - **year:** year, **type:** integer, **required:** false\n  - **limit:** limit, **type:** integer, **required:** false\n\n### 4. Helper Make commands\n\nI like to use `make` for my projects, hence below are some helper `make` commands\n\n- `make all`: Start up the container services and install project dependencies.\n- `make composer`: Install composer dependencies.\n- `make cc`: Remove symfony caches.\n- `make clear`: Delete vendor. cache, logs and library binaries.\n- `make lint`: Lint all php, yml, json and composer.\n- `make phpcs`: Run code sniffer to check styles.\n- `make phpcbf`: fix styles.\n- `make tests`: Run tests\n- `make coverage`: Generate coverage report\n- `make tear-down`: Stop all containers and down.\n- `make container-up`: Start all container services\n- `make container-stop`: Stop all containers services.\n- `make container-down`: down all containers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnsami%2Fcontent-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnsami%2Fcontent-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnsami%2Fcontent-api/lists"}