3D Print manager, Bluesmith (https://bluesmith.oit.duke.edu)
by Duke University OIT
(CodeIgniter 4 port of https://gitlab.oit.duke.edu/msg8/bluesmith)
Bluesmith is built on version 4 the CodeIgniter PHP framework. You will need to be sure your environment meets all of the framework's system requirements. Framework requirements may change but here is a good start:
- PHP 8.0 or newer
- PHP extensions (
php -m
): intl, json, mbstring, mysqlnd, xml, curl - A database with one of the framework's supported drivers
Some additional requirements may depend on your choice of web host. See "Hosting with ..." in the CodeIgniter User Guide.
- Clone or download the repository
- Configure your environment
- Run installation scripts
- In the root directory, copy env to .env and edit the new file:
- Set
app.baseURL
to your site (with trailing slash), e.g. 'https://bluesmith.example.edu/' - Set all variables in the
DATABASE
section for thedefault
group forceGlobalSecureRequests
is recommended but requires a valid HTTPS configuration
- Set
- Set your web host to serve the public/ directory
Run the provided install.sh script which will do the following:
- Install all packages and dependencies with the following command in the root directory:
composer install
- Migrate the database:
php spark migrate -all
- Seed the database with the necessary initial values:
php spark db:seed InitialSeeder
- Publish asset files to the web root:
php spark assets
- Locate and cache handlers:
php spark handlers:cache
Bluesmith comes with generic branding and a basic UI, but relishes being customized with
your institution's flair. You should leverage the included
Themes Library to add your own
themes or even replace the default theme (hint: ./spark themes:add
).
There are a number of places where branding can be changed centrally from the Preferences Library, and a built-in CMS that allows for customized text in various places.
Bluesmith is built off a handful of CodeIgniter 4 libraries that support modular loading. This means it is easy to make your own extensions of existing features without deviating from the master branch. Create your own directory with whatever modules you wish to extend and add it to the list of autoloaded namespaces in app/Config/Autoload.php.
For the bold, jobs are processed through a series of modular actions that can be added/changed/removed with the Workflows Library.
Likewise, the included reports are all generated from modules that can be added to easily via the Reports Library.
Bluesmith comes bundled with its own unit tests. If you are planning on modifying or extending the application you likely will want to run these tests or even add your own. To run the tests...
-
Make sure you have
phpunit
installed (included automatically if you followed the Composer installation above) and a code coverage -
Install a code coverage driver like Xdebug
-
Rename phpunit.xml.dist to phpunit.xml and modify the database settings to match your environment
-
Run the tests with the following command in the application root:
composer test
-
Results are output to the CLI and in the build/ directory
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0, and is "Incompatible With Secondary Licenses". Complete license information is available in LICENSE.
The original source code and license are hosted by Duke University on a private GitLab instance here, and mirrored to GitHub here.
This file is part of a subsequent fork on GitHub hosted here and maintained by the original author under different copyright status since August 2, 2022.