If available, Docker is the easiest way to run 3dassets.one locally for development purposes.
- Clone the repository and open a terminal in it.
- Review the provided
.env.templatefile and create a.envfile in the same directory. - Fetch the needed PHP composer dependencies:
docker run -it --rm -v $pwd/:/app composer composer install- Build and start the Docker containers:
docker compose up --force-recreate --build -d- Go to
http://localhost:5000to access the site. - To use the CLI tools, open a terminal in the running web container:
docker exec -it 3d1-web /bin/bashand navigate to the location where the source code is mounted.
In the cli/ subdirectory you can find the available CLI tools and run them with php <tool.php>.
- 3Dassets.one uses
- PHP 8.4
- Apache with
public/as document root - SQLite and GDimage extensions for PHP
- GD needs
.webpsupport for some creator thumbnails
The main form of contribution to 3dassets.one is to write an indexer for a new creator.
In include/creator/Creator.php add a new enum value for the creator and add cases in the necessary functions:
slug()title()description()baseUrl()licenseUrl()- Add the creator to
regularREfreshList()if it should be indexed regularly.
In include/creator/logic/ create a new class for the creator.
The CreatorLogic<Name> class needs to extend the CreatorLogic abstract class and implement the method:
scrapeAssets(StoredAssetCollection $existingAssets): ScrapedAssetCollection
This method is called during indexing. It receives all existing assets from this creator and returns a collection of newly scraped assets (if any were found).