ASP.NET Core asset storage service for the Mockup Workflow Platform, providing secure file management, shared workflow storage, and a browser-based asset explorer.
PNGAPI is an ASP.NET Core service that provides centralized storage and retrieval of workflow assets for the Mockup Workflow Platform.
The service exposes REST endpoints for uploading, downloading, browsing, and managing workflow assets while storing files within a shared Docker volume. In addition to its REST API, it includes a built-in Blazor interface for browsing workflow folders and previewing generated assets during development and testing.
PNGAPI was created to provide a lightweight, secure asset storage service for the Mockup Workflow Platform, enabling workflow components to exchange generated artwork through a shared storage layer.
- Overview
- Features
- Technologies
- Platform Architecture
- REST API
- Storage Layout
- Running Locally
- Docker
- Screenshots
- Project Status
- Related Repositories
- License
- Upload workflow assets through a REST API
- Download generated assets
- Browse files and folders using a built-in Blazor interface
- Preview generated PNG assets
- Create workflow folders through the API
- Delete workflow assets
- Safe path validation to prevent directory traversal
- Shared Docker volume storage
- Swagger/OpenAPI documentation
- Language: C#
- Framework: ASP.NET Core (.NET 10)
- UI: Blazor Interactive Server
- API: Minimal APIs
- Documentation: Swagger / OpenAPI
- Containerization: Docker
- Storage: Shared Docker volume
PNGAPI serves as the shared asset storage service for the Mockup Workflow Platform. It provides a centralized location where workflow assets are uploaded, retrieved, and managed throughout the mockup generation pipeline.
Mockup Workflow Platform
BuildUploader
│
▼
PhotoshopAutomation.Api
│
Coordinates workflow execution
│
▼
Photoshop UXP Batch Plugin
│
Downloads input assets / Uploads mockups
│
▼
PNGAPI
│
Shared Build Storage Volume
│
┌────────────┴────────────┐
▼ ▼
MockupWorkflow.Admin Other Platform Services
Browse workflow assets Consume generated files
PNGAPI is responsible for:
- Storing workflow assets within the shared build storage.
- Providing REST endpoints for uploading and downloading files.
- Managing workflow folder structures.
- Browsing stored assets through a built-in Blazor interface.
- Protecting the storage volume through safe path validation.
PNGAPI exposes REST endpoints for managing workflow assets stored within the shared build storage.
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/files |
Lists every file stored under the configured build root. |
GET |
/api/files/{path} |
Downloads a file from the shared storage. |
POST |
/api/files/{path} |
Uploads a file to the specified path, creating parent directories if necessary. |
DELETE |
/api/files/{path} |
Deletes the specified file. |
GET |
/api/files/list/{path} |
Lists the folders and files within a specific directory. |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/folders |
Lists every folder beneath the configured build root. |
POST |
/api/folders/{path} |
Creates a folder within the shared storage. |
POST /api/files/1783449343700/tshirt/input_folders/example/design.png
Content-Type: image/pngUploads a PNG into the specified workflow folder.
GET /api/files/1783449343700/tshirt/mockup_folders/example/design-Group.1.pngReturns the requested image.
POST /api/folders/1783449343700/tshirt/input_folders/exampleCreates the folder if it does not already exist.
All file and folder operations are validated before accessing the file system.
PNGAPI resolves every requested path relative to the configured storage root and rejects requests that attempt to access locations outside the shared workflow directory. This prevents directory traversal attacks while allowing clients to work with relative workflow paths.
PNGAPI stores workflow assets beneath a configurable build root.
By default:
/data/builds
Each workflow batch is organized by batch identifier and product type, providing a predictable structure that all platform services can share.
/data/builds/
└── 1783449343700/
└── tshirt/
├── input_folders/
│ ├── Awaiting.Further.Instructions/
│ │ └── duck-design.png
│ └── Coffee.Until.Further.Notice/
│ └── coffee-design.png
│
└── mockup_folders/
├── Awaiting.Further.Instructions/
│ ├── duck-design-Group.1.png
│ ├── duck-design-Group.2.png
│ └── ...
│
└── Coffee.Until.Further.Notice/
├── coffee-design-Group.1.png
├── coffee-design-Group.2.png
└── ...
The storage root is configured through appsettings.json:
{
"Storage": {
"BuildRoot": "/data/builds"
}
}The location can be overridden for different environments using standard ASP.NET Core configuration providers, making the application suitable for local development, Docker deployments, and production environments.
- .NET 10 SDK
- Docker Desktop (recommended for containerized development)
git clone https://github.com/swisherman/PNGAPI.git
cd PNGAPIOpen:
PNGAPI.slnx
Then start the PNGAPI project.
From the repository root:
dotnet run --project src/PNGAPI/PNGAPI.csprojThe application will start using the URLs defined in your launch profile.
Once running, open:
| Page | Purpose |
|---|---|
/ |
Project home page |
/files |
Browse and preview workflow assets |
/swagger |
Explore and test the REST API |
The storage location is configured in appsettings.json:
{
"Storage": {
"BuildRoot": "/data/builds"
}
}The configured storage directory is automatically created during application startup if it does not already exist.
PNGAPI includes Docker support for running the service in a Linux container with access to shared workflow storage.
From the repository root:
docker compose up --buildTo run the containers in the background:
docker compose up --build -dTo stop the application:
docker compose downInside the container, PNGAPI uses the configured build root:
/data/builds
The Docker configuration mounts shared storage at this location so PNGAPI and other Mockup Workflow Platform services can access the same workflow assets.
PNGAPI container
│
▼
/data/builds
│
▼
Shared Docker volume
│
├── input_folders
└── mockup_folders
This shared-volume design allows:
MockupWorkflow.BuildUploaderto upload prepared input assets.- The Photoshop UXP plug-in to download source artwork.
- The Photoshop UXP plug-in to upload generated mockups.
MockupWorkflow.Adminand other services to browse or consume workflow output.
The storage root can be overridden through ASP.NET Core configuration.
For example:
environment:
Storage__BuildRoot: /data/buildsASP.NET Core uses double underscores to represent nested configuration keys, so:
Storage__BuildRoot
maps to:
{
"Storage": {
"BuildRoot": "/data/builds"
}
}After changing application code or the Dockerfile, rebuild the image:
docker compose up --buildSwagger and the Blazor interface are available through the host port configured in docker-compose.override.yml.
Screenshot coming soon
PNGAPI is under active development as part of the Mockup Workflow Platform.
Current capabilities include:
- REST API for workflow asset management
- Browser-based asset explorer
- Safe file and folder operations
- Shared Docker volume storage
- Swagger/OpenAPI documentation
Future enhancements include:
- Asset metadata support
- Improved file search and filtering
- Thumbnail generation
- Additional administrative tooling
PNGAPI is one component of the Mockup Workflow Platform.
| Repository | Purpose |
|---|---|
| MockupWorkflow.Platform | Platform overview and architecture |
| PhotoshopAutomation.Api | Workflow orchestration and batch processing |
| photoshop-uxp-batch-mockup-plugin | Photoshop workflow execution |
| MockupWorkflow.Admin | Administrative dashboard |
| FolderCreator.API | Creates standardized workflow folder structures |
| MockupWorkflow.BuildUploader | Uploads prepared workflow assets |
| MockupWorkflow.Shared | Shared domain models and contracts |
This project is licensed under the MIT License.
See the LICENSE file for details.


