add-php-backend
v1.10.0
Published
Add [PHP](https://www.php.net/), [Composer](https://getcomposer.org/), [MySQL](https://mariadb.org/), [phpMyAdmin](https://www.phpmyadmin.net/) and [PHP CRUD API](https://github.com/mevdschee/php-crud-api) to your local development environment.
Downloads
39
Readme
Add PHP Backend
Add PHP, Composer, MySQL, phpMyAdmin and PHP CRUD API to your local development environment.
You might be interested in a simple Synchronization between local IndexedDB and MySQL Database.
Installation
Create a new app project:
npm create vite
Add a PHP backend:
npx add-php-backend
Usage
- Run
npm run backend
to start the backend - Open the PHP server at http://localhost:8000
- API endpoint at http://localhost:8000/api.php
- example: http://localhost:8000/api.php/records/tasks
- API endpoint at http://localhost:8000/api.php
- Open phpMyAdmin at http://localhost:8080
- Login with username
root
and passwordroot
- Login with username
- Use the PHP CRUD API in frontend with
/api.php
How it works
- no dependency will be added to the repository
- you have full control of all source files for fine tuning
- running
npx add-php-backend
will download the package in a cache folder - the package main script will create some files in the project folder if not exist:
docker/
folder with the Dockerfilespublic/api.php
initialization of the PHP CRUD APIpublic/credentials.template.php
to be renamed tocredentials.php
for productioncomposer.json
to configure Composerdocker-composer.yml
to configure the container setupschema.sql
contains the database schema and updates to ittestdata.sql
contains test data only for development
- the package main script will modify some files in your project folder:
- add a
backend
script to thepackage.json
file and prepend it todev
- add a proxy server config for PHP files to the Vite config file
- add
vendor/
andcredentials.php
to the.gitignore
file
- add a
Support
Report bugs in the issues list.
Maintainer
- Apply changes
- Run
npm run demo
to build and start thedemo-app
- Commit changes with an issue (closure) reference
- Run
npm version patch | minor | major
and push changes - Let the workflow manage the release to GitHub and NPM
Maintainer
- Apply changes to the code
- Run
npm run demo
to build and start thedemo-app
- Apply changes to the
README.md
file and screenshots - Commit changes with an issue (closure) reference
- Run
npm version patch | minor | major
and push changes - Let the workflow manage the release to GitHub and NPM