{"id":26848964,"url":"https://github.com/1dev-hridoy/slimapitemplate","last_synced_at":"2025-03-30T21:23:58.010Z","repository":{"id":285127116,"uuid":"957146251","full_name":"1dev-hridoy/SlimApiTemplate","owner":"1dev-hridoy","description":"A robust and feature-rich API template built with PHP Slim Framework, providing ready-to-use implementations for weather data, QR code generation, and more.","archived":false,"fork":false,"pushed_at":"2025-03-29T17:47:22.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T18:20:13.500Z","etag":null,"topics":["php-api","php-slim-framework","php7","slim-framework"],"latest_commit_sha":null,"homepage":"","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/1dev-hridoy.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}},"created_at":"2025-03-29T17:01:34.000Z","updated_at":"2025-03-29T17:48:32.000Z","dependencies_parsed_at":"2025-03-29T18:20:24.518Z","dependency_job_id":"d8273815-9e30-411c-a465-8b69b395d97f","html_url":"https://github.com/1dev-hridoy/SlimApiTemplate","commit_stats":null,"previous_names":["1dev-hridoy/slimapitemplate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1dev-hridoy%2FSlimApiTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1dev-hridoy%2FSlimApiTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1dev-hridoy%2FSlimApiTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1dev-hridoy%2FSlimApiTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1dev-hridoy","download_url":"https://codeload.github.com/1dev-hridoy/SlimApiTemplate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246380875,"owners_count":20767927,"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":["php-api","php-slim-framework","php7","slim-framework"],"created_at":"2025-03-30T21:23:57.202Z","updated_at":"2025-03-30T21:23:58.003Z","avatar_url":"https://github.com/1dev-hridoy.png","language":"PHP","readme":"# Slim API Template\n\nA robust and feature-rich API template built with PHP Slim Framework, providing ready-to-use implementations for weather data, QR code generation, and more.\n\n## Features\n\n- 🚀 Built with Slim 4 Framework\n- 🌤️ Weather API Integration with OpenWeatherMap\n- 📱 QR Code Generation API\n- 🔐 Proper Error Handling\n- 📁 Well-organized Project Structure\n- 🛠️ Easy to Extend and Customize\n\n## Project Structure\n\n```plaintext\napi-project/\n├── composer.json\n├── .htaccess\n├── public/\n│   ├── index.php\n│   └── .htaccess\n├── src/\n│   ├── Config/\n│   │   └── settings.php\n│   ├── Controllers/\n│   │   ├── HelloController.php\n│   │   ├── WeatherController.php\n│   │   └── QRCodeController.php\n│   ├── Routes/\n│   │   └── api.php\n│   └── bootstrap.php\n└── vendor/\n```\n\n## Requirements\n\n- PHP \u003e= 7.4\n- Composer\n- Apache/Nginx Web Server\n- GD extension (for QR code generation)\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/1dev-hridoy/SlimApiTemplate.git\n```\n\n2. Install dependencies:\n```bash\ncomposer install\n```\n\n3. Configure your web server to point to the `public` directory\n\n4. Copy `.htaccess` files to their respective locations\n\n## Available APIs\n\n### 1. Hello World Endpoint\n```http\nGET /api/hello\n```\n\n### 2. Weather API Endpoints\n```http\n# Get current weather\nGET /api/weather?city={cityName}\n\n# Get weather forecast\nGET /api/weather/forecast?city={cityName}\n```\n\nParameters:\n- `city`: Name of the city (required)\n\n### 3. QR Code Generation Endpoints\n```http\n# Generate QR code as image\nGET /api/qr/generate?text={text}\u0026size={size}\u0026label={label}\n\n# Generate QR code as base64\nGET /api/qr/base64?text={text}\n```\n\nParameters:\n- `text`: Content to encode in QR code (required)\n- `size`: Size of QR code in pixels (optional, default: 300)\n- `label`: Text label below QR code (optional)\n\n## Example Usage\n\n### Weather API\n```javascript\nfetch('http://your-domain/api/weather?city=London')\n  .then(response =\u003e response.json())\n  .then(data =\u003e console.log(data));\n```\n\n### QR Code Generation\n```html\n\u003c!-- Display QR code directly --\u003e\n\u003cimg src=\"http://your-domain/api/qr/generate?text=Hello World\" alt=\"QR Code\"\u003e\n\n\u003c!-- With custom size --\u003e\n\u003cimg src=\"http://your-domain/api/qr/generate?text=Hello World\u0026size=200\" alt=\"QR Code\"\u003e\n```\n\n## Configuration\n\n### Weather API\nUpdate the OpenWeather API key in `src/Controllers/WeatherController.php`:\n```php\nprivate $apiKey = 'your-api-key';\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a new branch (`git checkout -b feature/improvement`)\n3. Commit your changes (`git commit -am 'Add new feature'`)\n4. Push to the branch (`git push origin feature/improvement`)\n5. Create a Pull Request\n\n## Author\n\n- **Hridoy** - [GitHub Profile](https://github.com/1dev-hridoy)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n## Support\n\nIf you find this template helpful, please consider giving it a ⭐️ on GitHub!\n\n## Last Updated\n\n2025-03-29 17:26:17 UTC by @hridoy09bg","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1dev-hridoy%2Fslimapitemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1dev-hridoy%2Fslimapitemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1dev-hridoy%2Fslimapitemplate/lists"}