{"id":28744760,"url":"https://github.com/netologist/placebo","last_synced_at":"2025-06-16T12:05:22.718Z","repository":{"id":293224228,"uuid":"983351836","full_name":"netologist/placebo","owner":"netologist","description":"placeholder image generator server","archived":false,"fork":false,"pushed_at":"2025-05-14T09:45:51.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-14T09:50:50.729Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/netologist.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}},"created_at":"2025-05-14T08:55:35.000Z","updated_at":"2025-05-14T09:45:55.000Z","dependencies_parsed_at":"2025-05-14T09:50:52.793Z","dependency_job_id":"cd52c9fe-3cf4-4b18-af84-210a6063d3e6","html_url":"https://github.com/netologist/placebo","commit_stats":null,"previous_names":["netologist/placebo"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/netologist/placebo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netologist%2Fplacebo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netologist%2Fplacebo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netologist%2Fplacebo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netologist%2Fplacebo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netologist","download_url":"https://codeload.github.com/netologist/placebo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netologist%2Fplacebo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260158326,"owners_count":22967226,"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":[],"created_at":"2025-06-16T12:05:22.074Z","updated_at":"2025-06-16T12:05:22.697Z","avatar_url":"https://github.com/netologist.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Placebo - placeholder image generator\n\nA lightweight, fast placeholder image generator server built with Node.js. Generate customizable SVG placeholders on the fly for your web projects.\n\nIf you need to client-side a solution, I strongly recommend the [holder.js](https://holderjs.com/).\n\n## Features\n\n- **Fast \u0026 Lightweight**: Generates SVG placeholders with minimal overhead\n- **Customizable**: Control dimensions, background colors, and text colors\n- **Simple API**: Easy-to-use URL-based API for image generation\n- **Dockerized**: Ready to deploy anywhere with Docker support\n- **No Dependencies**: Pure Node.js implementation with no external libraries\n\n## Quick Start\n\n### Option 1: Run with Node.js\n\n```bash\n# Clone the repository\ngit clone https://github.com/netologist/placebo.git\ncd placebo\n\n# Run the server\nnode placeholder-server.js\n```\n\n### Option 2: Build \u0026 Run with Docker\n\n```bash\n# Build the Docker image\ndocker build -t placebo .\n\n# Run the container\ndocker run -p 3000:3000 placebo\n```\n\n### Option 3: Run with Docker\n\n```bash\n# Run the container from registry\ndocker run run -p 3000:3000 ghcr.io/netologist/placebo:latest\n```\n\nThe server will be available at http://localhost:3000\n\n## Usage\n\n### API Endpoints\n\n#### Generate a placeholder image\n\n```\nGET /placeholder/{width}/{height}?bg={background}\u0026text={textColor}\n```\n\nParameters:\n\n- `width`: Width in pixels (default: 300, max: 3000)\n- `height`: Height in pixels (default: 150, max: 3000)\n- `bg`: Background color in hex format without # (default: 888888)\n- `text`: Text color in hex format without # (default: ffffff)\n\n### Examples\n\n```\n# Default gray placeholder (300x150)\nhttp://localhost:3000/placeholder/300/150\n\n# Custom size (500x200)\nhttp://localhost:3000/placeholder/500/200\n\n# Custom colors (orange background with black text)\nhttp://localhost:3000/placeholder/400/300?bg=ff9900\u0026text=000000\n\n# Blue placeholder for a banner\nhttp://localhost:3000/placeholder/1200/300?bg=0078D7\n```\n\n## Implementation Details\n\nPlacebo generates SVG images on demand using Node.js's built-in HTTP server. The implementation:\n\n- Sanitizes all input parameters to prevent injection attacks\n- Implements sensible defaults and boundaries for dimensions\n- Uses SVG format for crisp rendering at any resolution\n- Includes cache headers for optimal performance\n\n## Deployment\n\n### Environment Variables\n\n- `PORT`: Server port (default: 3000)\n\n### Production Considerations\n\nFor production deployment, consider:\n\n- Using a reverse proxy like Nginx for SSL termination and caching\n- Setting up container orchestration (Kubernetes, Docker Swarm)\n- Implementing rate limiting for public-facing instances\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetologist%2Fplacebo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetologist%2Fplacebo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetologist%2Fplacebo/lists"}