Skip to content

zestic/asset-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zestic Asset Server

Zestic Asset Server is a modern, high-performance server for managing and delivering digital assets (such as images, documents, and other files). It is designed to serve uploaded assets efficiently, with built-in support for on-the-fly image manipulation via URL parameters.

Features

  • Asset Delivery: Serve uploaded files and images directly via HTTP endpoints.
  • Image Manipulation: Transform images (resize, crop, format, watermark, etc.) using simple URL parameters, powered by league/glide.
  • Secure Access: Optional support for signed URLs and access control.
  • Modern PHP Stack: Built with PHP 8.4, FrankenPHP, and Mezzio for performance and flexibility.
  • Dockerized Development: Consistent local development with Docker Compose.
  • Extensible: Easily add new asset types, storage backends, or processing features.

Quick Start

  1. Start the development environment:

    docker compose up -d
  2. Install dependencies:

    docker compose exec asset-server composer install
  3. Upload assets:

    • Use the provided upload endpoint or place files in the configured storage directory (see documentation or config).
  4. Access assets:

    • http://localhost:8188/{filename}
    • For images, you can manipulate them on-the-fly:
      • http://localhost:8188/{filename}?w=400&h=300&fit=cover
      • See Glide API docs for all supported parameters.

Example Usage

Original image:

http://localhost:8188//photo.jpg

Resized image (width 400px):

http://localhost:8188//photo.jpg?w=400

Cropped and converted to PNG:

http://localhost:8188//photo.jpg?w=200&h=200&fit=crop&fm=png

Configuration

  • Storage: Configure the asset storage location in config/autoload/glide.global.php or your environment variables.
  • Image Processing: All image manipulation is handled by league/glide, which supports resizing, cropping, format conversion, and more.
  • Security: Enable signed URLs for secure access if needed.

Development Tools

All development tools run inside the Docker container:

# Run code style, static analysis, and tests
docker compose exec asset-server composer check

# Individual tools
docker compose exec asset-server composer cs-check     # Code style check
docker compose exec asset-server composer cs-fix       # Code style fix
docker compose exec asset-server composer test         # Unit tests
docker compose exec asset-server composer static-analysis  # Static analysis

Troubleshooting

  1. Ensure Docker is running and containers are healthy:
    docker compose ps
  2. Check container logs:
    docker compose logs
  3. Try rebuilding the containers:
    docker compose down
    docker compose up -d --build
  4. Clear Composer's cache:
    docker compose exec asset-server composer clear-cache

About league/glide

This project uses league/glide for all image processing. Glide is a fast, easy, and open-source image manipulation library for PHP, designed to be secure and production-ready.

License

See LICENSE.md.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors