Py2Json26 is an app to convert Python dictionaries to JSON format. Py2Json26 is built with...
- Laravel 12
- TailwindCSS v4
- Livewire 4
- PestPHP 4 for testing
- FluxUi components
- Requirements
- Paid Dependencies
- Environment Variables
- Get started with Docker (locally)
- Getting started locally (without Docker)
- GitHub Actions
- Testing
- Useful notes and commands
- PHP 8.3+
- Composer
- NodeJS 20+
- Docker (optional, for building images)
Py2Json uses FluxUi pro components for the user interface. This is a paid package and a license is required to install the components from their private repository.
If you have a license you can create an auth.json file with your credentials. See Flux documentation for more details.
use the following command to generate an empty auth.json file:
php artisan flux:activateif you have already setup an auth.json file you can install the flux pro components with:
composer require livewire/flux-proLaravel uses environment variables to configure various aspects of the application. Most of the defaults are set in the
.env.example file. You can copy this file to .env and modify it as needed.
To disable stack traces in browser set APP_DEBUG=false in your .env file.
Licence: Ensure you have an
auth.jsonfile with a valid license to install paid dependencies see Paid Dependencies
The following command will build and start the application using Docker Compose:
DOCKER_BUILDKIT=1 docker compose up --buildVisit http://127.0.0.1:8000 in your web browser to access the application.
This will use a sqlite in memory database, so any data will be lost when the container is stopped. To avoid this modify
the docker-compose.yml file to use a persistent database.
-
Install PHP dependencies using Composer
Licence: Some dependencies require a valid license and auth.json file to install correctly see Paid Dependencies
composer install
-
Install JavaScript dependencies using npm, or Bun
npm install # or bun install -
Copy the example environment file and configure your environment variables
cp .env.example .env
-
Generate an application key (APP_KEY) (if not already done)
php artisan key:generate
-
Run database migrations
php artisan migrate
-
Start Vite development server
npm run dev # or bun run dev -
Start the Laravel development server
php artisan serve
The project includes two Github Actions workflows for CI/CD.
This workflow runs on every pull request to the main branch. It will...
- Check you have updated the project version in
composer.json - Run all the Pest tests (excluding screenshot diff tests)
Playwright: If you need to install the Playwright browsers uncomment the lines in the
ci.yamlfile.
This workflow expects the following secrets to be set in the Testing environment of your repository settings:
FLUX_USERNAME- The email address associated with your FluxUi accountFLUX_LICENSE_KEY- Your FluxUi license key
This workflow runs on every push to the main branch. It will...
- Build and push a Docker image to GitHub Container Registry
- Deploy the app to a CapRover server
This workflow expects the following secrets to be set in the Production environment of your repository settings:
COMPOSER_AUTH- The contents of yourauth.jsonfile for installing paid dependencies, note this secret MUST be a single line JSON string otherwise the workflow will fail.CAP_SERVER_URL- The base URL of your CapRover server e.ghttps://captain.yourdomain.comCAP_APP_NAME- The name of the app on your CapRover server e.gpy2jsonCAP_APP_TOKEN- The token for your CapRover app
Py2Json uses PestPHP for testing. Tests are split into Feature and Unit tests located in the tests/Feature and
tests/Unit directories respectively.
php artisan test --parallelBuild the docker image with secret auth.json manually ...
DOCKER_BUILDKIT=1
docker build \
--secret id=composer_auth,src=auth.json \
-t py2json .Py2Json is currently configured to trust all proxies by default. If you need to restrict this, you can modify the
bootstrap/app.php trustProxies method.
- Install python in Docker image