{"id":24548134,"url":"https://github.com/mvreisg/gamebase-backend","last_synced_at":"2026-04-08T21:32:01.241Z","repository":{"id":273279854,"uuid":"918785072","full_name":"mvreisg/gamebase-backend","owner":"mvreisg","description":"RESTful backend for managing a game database, built with modern PHP practices and a DDD-inspired structure.","archived":false,"fork":false,"pushed_at":"2026-04-04T16:35:35.000Z","size":1315,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2026-04-04T19:26:57.263Z","etag":null,"topics":["apache","api","aws","composer","defuse","docker","jwt","nginx","phinx","php","php-di","phpunit","predis","psr","restful","slim-framework","sodium","web"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mvreisg.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-18T21:05:23.000Z","updated_at":"2026-03-28T18:58:15.000Z","dependencies_parsed_at":"2025-01-20T00:25:04.211Z","dependency_job_id":"81de6f92-efe6-4b1e-869d-a5ee8367c6e2","html_url":"https://github.com/mvreisg/gamebase-backend","commit_stats":null,"previous_names":["mvreisg/gamebase-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mvreisg/gamebase-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvreisg%2Fgamebase-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvreisg%2Fgamebase-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvreisg%2Fgamebase-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvreisg%2Fgamebase-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvreisg","download_url":"https://codeload.github.com/mvreisg/gamebase-backend/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvreisg%2Fgamebase-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31575484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","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":["apache","api","aws","composer","defuse","docker","jwt","nginx","phinx","php","php-di","phpunit","predis","psr","restful","slim-framework","sodium","web"],"created_at":"2025-01-22T23:16:08.760Z","updated_at":"2026-04-08T21:32:01.236Z","avatar_url":"https://github.com/mvreisg.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gamebase-Backend\r\n\r\nRESTful backend for managing a game database, built with modern PHP practices and a DDD-inspired structure.\r\n\r\nThis project is designed as a study and portfolio application focusing on:\r\n\r\n- Layered architecture\r\n- Secure authentication and encryption\r\n- Containerized development\r\n- Scalable environment configuration\r\n\r\n---\r\n\r\n## Features\r\n\r\n- REST API\r\n- JWT Authentication\r\n- Redis caching\r\n- Database migrations with Phinx\r\n- Encryption (Sodium / Defuse)\r\n- Docker-first development\r\n- Unit testing with PHPUnit\r\n- Environment variables with Dotenv\r\n\r\n---\r\n\r\n## Tech Stack\r\n\r\n- PHP 8.4\r\n- Nginx\r\n- Slim Framework\r\n- PHP-DI\r\n- MariaDB\r\n- Redis\r\n- Docker\r\n- Composer\r\n- PHPUnit\r\n- Phinx\r\n- Dotenv\r\n\r\n---\r\n\r\n## Project Architecture\r\n\r\nThe project loosely follows DDD principles:\r\n\r\n- **Domain**\r\n- **Application**\r\n- **Infrastructure**\r\n- **Presentation**\r\n\r\n---\r\n\r\n## Project Status\r\n\r\n🚧 Active development.\r\n\r\n---\r\n\r\n## License\r\n\r\nGPL-3.0\r\n\r\n---\r\n\r\n### Documentation\r\n\r\n🚧 *In the future with Swagger*\r\n\r\n---\r\n\r\n## Running the project\r\n\r\n### 1. Environment Configuration\r\n\r\nThe project uses layered environment files:\r\n\r\n```\r\n.env\r\n.env.{environment}.{machine}\r\n```\r\n\r\nExample `.env` to run with `Docker` under `development` environment:\r\n\r\n```\r\n.env.development.docker\r\n```\r\n\r\nCopy all keys from `.env.example` into your environment file and fill in the values.\r\n\r\n*The `docker-compose.development.up` and `docker-compose.development.down` scripts are available to ease the `Docker` setup.*\r\n\r\n---\r\n\r\n### 2. Environment Variables\r\n\r\n#### Timezone\r\n\r\n```\r\nTIME_ZONE=\"America/Sao_Paulo\"\r\n```\r\n\r\n#### Nginx\r\n\r\n```\r\nNGINX_PORT=\"80\"\r\nNGINX_EXPOSE_PORT=\"8081\"\r\n```\r\n\r\n`NGINX_PORT`: internal container port\r\n\r\n`NGINX_EXPOSE_PORT`: host port mapped to container\r\n\r\n#### API Consumers\r\n\r\n```\r\nAPI_CONSUMERS_ADDRESSES=\"http://localhost:8082,http://localhost:8083\"\r\nAPI_CONSUMERS_ADDRESSES_SEPARATOR=\",\"\r\n```\r\n\r\n#### Repository (Database)\r\n\r\n```\r\nREPOSITORY_ROOT_USERNAME=\"backend_root\"\r\nREPOSITORY_ROOT_PASSWORD=\"secret\"\r\n\r\nREPOSITORY_HOST=\"database\"\r\nREPOSITORY_DATABASE=\"gamebase\"\r\nREPOSITORY_USERNAME=\"user\"\r\nREPOSITORY_PASSWORD=\"password\"\r\nREPOSITORY_PORT=\"3306\"\r\nREPOSITORY_CHARSET=\"utf8mb4\"\r\nREPOSITORY_EXPOSE_PORT=\"3307\"\r\n```\r\n\r\n#### Encryption Keys\r\n\r\nYou may keep the default values, but generating your own keys is recommended.\r\n\r\nAccess:\r\n\r\n```\r\nhttp://localhost:${NGINX_EXPOSE_PORT}/pages/index.php\r\n```\r\n\r\nThen click on:\r\n\r\n- `Get PHP Defuse Encryption Key`\r\n- `Get Sodium Encryption Key`\r\n\r\nCopy the values into:\r\n\r\n```\r\nDEFUSE_PHP_ENCRYPTION_KEY=\r\nSODIUM_CRYPTO_SECRETBOX_KEY=\r\n```\r\n\r\n⚠️ Keep both values secret (even if unused).\r\n\r\n#### JWT Secret\r\n\r\n```\r\nJWT_SECRET=\"your-secret-key\"\r\n```\r\n\r\n#### Redis\r\n\r\n```\r\nREDIS_SCHEME=redis\r\nREDIS_HOST=redis\r\nREDIS_PORT=6379\r\nREDIS_EXPOSE_PORT=6380\r\n```\r\n\r\n---\r\n\r\n### 3. Create the Database\r\n\r\nAccess\r\n\r\n```\r\nhttp://localhost:{$NGINX_EXPOSE_PORT}/pages/index.php\r\n```\r\n\r\nSteps:\r\n\r\n1. Click on **PDO Database → Create**\r\n2. Verify the database was created\r\n3. Click on **Phinx Startup**\r\n4. Ensure the status is **OK**\r\n\r\n---\r\n\r\n### Composer Commands\r\n\r\nAll commands are defined in the `scripts` section of `composer.json`.\r\n\r\n---\r\n\r\n*Made with ❤️ by Marcus Vinicius Reis Gonçalves*","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvreisg%2Fgamebase-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvreisg%2Fgamebase-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvreisg%2Fgamebase-backend/lists"}