{"id":30716963,"url":"https://github.com/dlzer/ripchat","last_synced_at":"2025-10-08T21:55:45.144Z","repository":{"id":114045111,"uuid":"316851825","full_name":"DLzer/ripchat","owner":"DLzer","description":null,"archived":false,"fork":false,"pushed_at":"2020-11-30T13:20:19.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-03T08:43:04.078Z","etag":null,"topics":[],"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/DLzer.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":"2020-11-29T01:08:24.000Z","updated_at":"2020-11-30T13:20:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c9a7552-71e3-47c6-bc05-40384a98a948","html_url":"https://github.com/DLzer/ripchat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DLzer/ripchat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLzer%2Fripchat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLzer%2Fripchat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLzer%2Fripchat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLzer%2Fripchat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DLzer","download_url":"https://codeload.github.com/DLzer/ripchat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLzer%2Fripchat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000688,"owners_count":26082837,"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-08T02:00:06.501Z","response_time":56,"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":"2025-09-03T08:29:47.654Z","updated_at":"2025-10-08T21:55:45.139Z","avatar_url":"https://github.com/DLzer.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"RIPCHAT\n==========\n\nRIPCHAT is meant to be a safe and temporary message solution. Channels are created instantly with a unique identifier that can be shared between parties.\nThe liftime of a channel is 60 seconds. However, for every message sent the life-span of the channel is extended another 60 seconds. \nIf a user wishes they can delete the channel on demand, destroying it instantly and permanently.\n\n\nConfiguration\n-------------\n\nThe directory for all configuration files is: `config/`\nIn this file are the core files for running the application.\n- `settings.php`: Manages all core settings and environment variables for the application\n- `bootstrap.php`: Loads the Container, Routes, Middleware and Settings.\n- `middleware.php`: Contains middleware for the application.\n- `routes.php`: Contains defined routes for the application.\n- `container.php`: Houses the ContainerInterface utilizing PHP-DI for injection into the application.\n\nFrontController\n---------------\n\nThe front controller is just the `index.php` file and entry point to the application. This handles all requests through the application by channeling requests through a single handler object.\n\nContainer\n---------\n\nTraditionally the style of fetching dependencies was to inject the whole container into your class which is considered an **anti-pattern**. We switch up the method in this application by using modern tools like [PHP-DI](http://php-di.org/).\n\nThe DI used in this application is housed in a **Depedency Injection Container** ( DIC ). The method we use in this application is [composition over inheritance](https://en.wikipedia.org/wiki/Composition_over_inheritance) and (constructor) DI.\n\nDomain\n------\n\nThe domain in this application houses the complex **business logic**.\nInstead of putting together business logic into massive fat \"Models\", they are separated into specialized *Services* aka an **Application Service**\n\nEach service can have multiple clients, e.g Action (request), CLI (console), Data (logic), Unit Testing (phpunit). This way each service manages only one responsibility and not more by separating data from behavior.\n\nRedis\n--------\n\nIn this project REDIS is used as a quick-access key-value data store. All access to REDIS can be managed through the redis factory located in `src/factory`.\nThe factory is part of the Dependency Injection Container and can be passed by reference directly into the class constructor of whatever you're building like so:\n````php\n\u003c?php\n\nnamespace App\\Domain\\MyClass\\Service\\MyClassService;\n\nuse App\\Factory\\RedisFactory;\n\nfinal class MyClass\n{\n    private $redis;\n\n    public function __construct(RedisFactory $redis)\n    {\n        $this-\u003eredis = $redis;\n    }\n\n    public function storeSomething(): void\n    {\n        $this-\u003eredis-\u003eset('Key', 'Value');\n    }\n\n    public function getSomething(): array\n    {\n        $result = $this-\u003eredis-\u003eget('key');\n        return $result // ['Key' =\u003e 'Value']\n    }\n}\n````\n\nDeployment\n----------\n\nDeployment is best served through a **build pipeline** however if manual deployment is necessary it's as simple as running:\n````shell\ncomposer install --no-dev --optimize-autoloader\n````\nThis will remove dev-dependencies as well as optimize the composer autoloader for better performance.\n\nFor security reasons it's also best practice to turn of output of error details:\n````php\n$settings['error_handler_middleware'] = [\n    'display_error_details' =\u003e false,\n];\n````\n\nEndpoints\n----------\n\nThe current endpoints in use are: \n- `POST`:`/channel/create` - `{\"channel_name\": \"\u003cname\u003e\"}`\n- `POST`:`/channel/get` - `{\"channel_hash\": \"\u003cchannelHash\u003e}`\n- `POST`:`/channel/delete` - `{\"channel_hash\": \"\u003cchannelHash\u003e}`\n- `POST`:`/message/send` - `{\"channel_hash\": \"\u003cchannelHash\u003e\", \"message_body\": \"\u003cmessage_body\u003e\"}`\n\nTesting\n----------\n\nTo avoid any global dependency issue between developer, all testing should be completed\nwithin the project using the composer sciprt:\n````shell\ncomposer test\n````\nThe tests should be built and ran before making a push to the repository. A github action for CI\nis in place that will run all tests on trigger-push.\n\nTesting configuration is handled by the `phpunit.xml` file in the `test/` directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlzer%2Fripchat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlzer%2Fripchat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlzer%2Fripchat/lists"}