/godot-asset-library-laravel

[WIP] Godot Asset Library rewrite using the Laravel framework

Primary LanguagePHPMIT LicenseMIT

Godot Asset Library

codecov

Installation

If you wish to contribute code to the Godot Asset Library, you'll need to install a local copy so you can test your changes.

To run it locally, you need to install and build both the backend and frontend.

Backend

The backend uses the Laravel PHP framework.

  1. Install dependencies as described on the Laravel 7.x installation page.
  2. Set up a MySQL or MariaDB database.
  3. Copy the .env.example file as .env and edit the DB_* variables to add database credentials.
  4. Run the following commands in order:
# Install composer dependencies
composer install

# Create a database (credentials must be set in `.env` first)
php artisan db:create

# Run migrations and seed test data into the database
php artisan migrate --seed

# Create application key
php artisan key:generate

# Create an user with administrator privileges
# (you will be prompted for username/email/password)
php artisan admin:create

# Run a local Web server for development
php artisan serve

You can run php artisan migrate:refresh --seed to run all migrations and seed test data again.

Code quality tools

  • Feature tests are available. They use a secondary MySQL database configured in .env.testing. You need to create this database before running them.
  • This project follows the Laravel code style, applied using PHP CS Fixer.
  • Code is analysed with PHPStan thanks to Larastan.

Use the commands below:

# Run unit and feature tests
vendor/bin/phpunit

# Check PHP code for possible errors
vendor/bin/phpstan analyse

# Try to fix code style violations automatically
vendor/bin/php-cs-fixer fix

Frontend

The frontend uses the Tailwind CSS framework and TypeScript.

  1. Install Node.js (10.x or later) and Yarn (recommended over npm).
  2. Run the following commands in the project folder depending on your needs:
# Install dependencies (must be done before other Yarn commands)
yarn

# Build frontend files and watch for changes
yarn watch

# Build optimized frontend files for production
yarn prod

# Lint CSS and TypeScript files for code style violations
yarn lint

# Try to fix code style violations automatically
yarn lint:css --fix
yarn lint:ts --fix

License

Copyright © 2019-2020 Hugo Locurcio and contributors

Unless otherwise specified, files in this repository are licensed under the MIT license; see LICENSE.md for more information.