{"id":15288734,"url":"https://github.com/domexx/ares","last_synced_at":"2025-04-13T08:10:11.894Z","repository":{"id":56970833,"uuid":"313410354","full_name":"Domexx/ares","owner":"Domexx","description":"Base project for creating fast and convenient web apis build on slim micro-framework","archived":false,"fork":false,"pushed_at":"2020-11-18T13:23:24.000Z","size":30,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T08:09:53.950Z","etag":null,"topics":["api","cache","fastapi","php","php8","slim-framework","slim4","slim4-skeleton"],"latest_commit_sha":null,"homepage":"","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/Domexx.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}},"created_at":"2020-11-16T19:48:26.000Z","updated_at":"2022-03-21T19:11:48.000Z","dependencies_parsed_at":"2022-08-21T10:50:58.781Z","dependency_job_id":null,"html_url":"https://github.com/Domexx/ares","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domexx%2Fares","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domexx%2Fares/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domexx%2Fares/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domexx%2Fares/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Domexx","download_url":"https://codeload.github.com/Domexx/ares/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681491,"owners_count":21144700,"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","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","cache","fastapi","php","php8","slim-framework","slim4","slim4-skeleton"],"created_at":"2024-09-30T15:52:29.550Z","updated_at":"2025-04-13T08:10:11.872Z","avatar_url":"https://github.com/Domexx.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Ares\n\n[![CodeFactor](https://www.codefactor.io/repository/github/domexx/ares/badge/master)](https://www.codefactor.io/repository/github/domexx/ares/overview/master) [![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/Domexx/aresd/blob/master/LICENSE) \n==========================\n\n## Introduction\nThis project is based on the micro framework slim.\nIt can be used for creating and expanding fast apis.\n\n## Base Features:\n- Responses\n- Exceptions\n- Validation\n- Authentication\n- Locales \u0026 Translations\n- Cache\n- Request Throttle\n- Database\n- Illuminate QueryBuilder\n- Slugs\n- Configs\n- Dotenv\n- Logging\n- DI Container\n- Routing (Slim)\n\n## Installation\n\n##### 1. Clone / Require project. \n```console\n$ git clone https://github.com/Domexx/ares.git\nor\n$ composer require domexx/ares\n```\n##### 2. Change directory to project.\n```console\n$ cd ares\n```\n##### 3. Copy dotenv config.\n```console\n$ cp .env.example .env \n```\n##### 4. Install composer dependencies.\n```console\n$ composer install \n```\n##### 5. Give rights to the folder.\n```console\n$ chmod -R 775 {dir name} \n```\n\n## Configuration\n##### Configure your .env:\n\n```text\n# Database Credentials\nDB_HOST=db\nDB_PORT=db\nDB_NAME=\"ares\"\nDB_USER=\"ares\"\nDB_PASSWORD=\"your_password\"\n\n# development / production\nAPI_DEBUG=\"production\"\n\nWEB_NAME=\"Ares\"\n# Defines the link to your frontend application // For CORS purpose (*) to allow all\nWEB_FRONTEND_LINK=\"*\"\n\n# 1 = Enabled, 0 = Disabled\nCACHE_ENABLED=1\n# \"Files\" for Filecache, \"Predis\" for Redis\nCACHE_TYPE=\"Files\"\n# Defines the cache alive time in seconds\nCACHE_TTL=950\n\n# Redis Host\nCACHE_REDIS_HOST=127.0.0.1\n# Redis Port, standard Port is 6379\nCACHE_REDIS_PORT=6379\n\n# Only works with Redis // Enables Throttling // Enables that people only can call the endpoint certain times in a short period\nTHROTTLE_ENABLED=0\n\nTOKEN_ISSUER=\"Ares-Issuer\"\nTOKEN_DURATION=86400\n\n# The secret must be at least 12 characters in length; contain numbers; upper and lowercase letters; and one of the following special characters *\u0026!@%^#$\nTOKEN_SECRET=\"Secret123!456$\"\n```\n\n## Expand project\n\n### Create custom Module:\n\n##### 1. Create controller class which extends BaseController\nIn the controller class you can define functions that are called by calling a route,\nwhich can be defined in the app/routes/routes.php.\nAuth protected routes can be used with setting middleware 'AuthMiddleware',\nbetween route path and route action call.\n \n```php\n\u003c?php\n\nnamespace Ares\\CustomModule\\Controller;\n\nuse Ares\\Framework\\Controller\\BaseController;\nuse Psr\\Http\\Message\\ResponseInterface as Response;\nuse Psr\\Http\\Message\\ServerRequestInterface as Request;\n\n/**\n * Class Controller\n *\n * @package Ares\\CustomModule\\Controller\n */\nclass Controller extends BaseController\n{\n    /**\n     * Reveals a custom response to the user\n     *\n     * @param Request  $request  The current incoming Request\n     * @param Response $response The current Response\n     *\n     * @return Response Returns a Response with the given Data\n     */\n    public function customResponse(Request $request, Response $response): Response\n    {\n        /** @var string $customResponse */\n        $customResponse = 'your custom response';\n\n        return $this-\u003erespond(\n            $response,\n            response()\n                -\u003esetData($customResponse)\n        );\n    }\n}\n```\n\n##### 2. Register your custom route in app/routes.php that calls a controller function\n```php\nreturn function (App $app) {\n    // Registers our custom routes that calls the customResponse function in our custom controller\n    $app-\u003eget('/custom', \\Ares\\CustomModule\\Controller\\Controller::class . ':customResponse');\n};\n```\n\n### Create custom Service Provider:\n\n##### 1. Create new Service Provider with extending AbstractServiceProvider\n```php\n\u003c?php\n\nnamespace Ares\\CustomModule\\Provider;\n\nuse Ares\\CustomModule\\Model\\Custom;\nuse League\\Container\\ServiceProvider\\AbstractServiceProvider;\n\n/**\n * Class CustomServiceProvider\n *\n * @package Ares\\CustomModule\\Provider\n */\nclass CustomServiceProvider extends AbstractServiceProvider\n{\n    /**\n     * @var array\n     */\n    protected $provides = [\n        Custom::class\n    ];\n\n    /**\n     * Registers new service.\n     */\n    public function register()\n    {\n        $container = $this-\u003egetContainer();\n\n        $container-\u003eadd(Custom::class, function () {\n            return new Custom();\n        });\n    }\n}\n```\n\n##### 2. Register the new created Service Provider in app/etc/providers.php\n```php\n    // Adds our CustomProvider to add Customs\n    $container-\u003eaddServiceProvider(\n        new \\Ares\\CustomModule\\Provider\\CustomServiceProvider()\n    );\n```\n\n## Credits\nIf you got questions or feedback feel free to contact us.\n\n- Discord: Dome#9999\n- Mail: dominik-forschner@web.de\n----------------------------------\n- Discord: s1njar#0066\n- Mail: s1njar.mail@gmail.com\n\n## Links\n\n- [Slim Framework](https://www.slimframework.com/)\n- [Ares Core Module](https://github.com/Domexx/Ares-Core.git)\n\n## License\n\nThe MIT License (MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomexx%2Fares","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdomexx%2Fares","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomexx%2Fares/lists"}