Updated 2020-03-20
The Third-Party API's have changed over time and several code changes were needed to run this project successfully. As of now, it should work out of the box with the additional install notes and the original install notes below.
Additional Install Notes
Elastisearch
The easiest way to run Elastisearch is with the docker image. Download Version 5.5.0
docker pull docker.elastic.co/elasticsearch/elasticsearch:5.5.0
and run it with
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "xpack.security.enabled=false" docker.elastic.co/elasticsearch/elasticsearch:5.5.0
Composer
If you run PHP > 7.2.0, then you have to run composer with
composer install --ignore-platform-reqs
From this point on, the original Readme text:
PrintABrick
Web catalogue of LEGO® parts for 3D printing
A Symfony project
Install
System requirements
- PHP needs to be a minimum version of PHP 7.0
- PHP Extensions
- FTP
- SOAP
- GD
- PDO
- Zip
- date.timezone setting set in php.ini
You can check if your system meets requirements by running $ bin/symfony_requirements
For full requirements see Symfony 3.3 docs.
Required
-
Elasticsearch >= 5
Instructions for installing and deploying Elasticsearch may be found here.
-
POV-Ray source.
-
stl2pov source.
-
ADMesh
-
LDView OSMesa >= 4.2.1 source.
Installing
Back-end
- Make sure your system meets the application requirements
- Install dependencies via Composer,
$ composer install
Front-end
- Install dependencies via npm,
$ npm install
- Install bower dependencies via bower,
$ bower install
- Compile assets by running Gulp,
$ gulp default [--env production]
Initialization
Setup database
- Set application parameters in app/config/parameters.yml
- Generate an empty database by running command (if it does not yet exist)
$ bin/console doctrine:database:create
- Create database tables/schema by running command
$ bin/console doctrine:schema:create
- Load database fixtures
$ bin/console doctrine:fixtures:load
Load data
You can load initial application data by running command $ bin/console app:init
This command consists of multiple subcommands that can be called separately:
- Load LDraw models into database by running commad
$ bin/console app:load:ldraw [--ldraw=PATH] [--all] [--file=FILE] [--update]
- Load Rebrickable data into database by running command
$ bin/console app:load:rebrickable
- Load relations between LDraw models and Rebrickable parts by running command
$ bin/console app:load:relations
- Download images of models from rebrickable.com
$ bin/console app:load:images [--color=INT] [--rebrickable] [--missing]
- Populate Elastisearch index
$ bin/console fos:elastica:populate
Adding part relation
Relations between LDraw models and Rebrickable parts are matched automatically by identical (or similar) id/name when executing command $ bin/console app:load:relation
.
Unmatched relations can be specified by adding relation of IDs to app/Resources/relations/part_model.yml
Testing
The test database must be created before the first test runs. You can create new one by running:
- Generate an empty database by running command (if it does not yet exist)
$ bin/console doctrine:database:create --env=test
- Create database tables/schema by running command
$ bin/console doctrine:schema:create --env=test
You can run complete system tests by $ phpunit
. These should cover the main system functions and the functionality of calling the third-party programs that are required are needed to seamlessly retrieve the necessary application data.