Usage instructions:
- Copy 'composer.json' file into project directory root
- Run 'composer update' in project directory to download dependencies
- Copy remaining ZSF files into root directory
- Change the name of the appropriate database migrations folder to simply be 'db' (vs 'db.sqlsrv', for example)
- Run 'vendor/bin/stoic-create --site' to create the missing configuration file
- Run 'vendor/bin/stoic-configure' to setup your configuration file
- Run 'vendor/bin/stoic-migrate' to initialize your database
- Create things
In order to run the UI's, you should use pnpm
, similar to the following:
cd ui/admin
pnpm install
pnpm dev
cd ui/front
pnpm install
pnpm dev
The first to be run will set itself up on port 5173, the second on port 5174 if both are running simultaneously.
Building either site for production is as simple as running pnpm zsf
inside the appropriate directory. When run, it will copy its compiled contents to the appropriate section of the ~/web
directory for you.
We now include a script to generate OpenAPI specs and have included them for the new v1.1 of the API. To see usage, execute the following command:
php scripts/generate-openapi.php -h
Once generated, you can place this inside of web
so that it can be utilized by things such as AXIOS.
Dependencies required for local development:
- Docker
- NodeJS (v >= 16)
To initialize the container and run the services:
./Exec.ps1 init
This will make the ~/web
folder accessible via http://localhost:8080/ and the MySQL 'adminer' interface available at http://localhost:8081/. To use the 'adminer' interface, use the following connection info:
host: db
user: root
pass: P@55word
name: zsf
To run the migration command and any other common 'update' procedures:
./Exec.ps1 update
To run custom commands on the container:
./Exec.ps1 php scripts/generate-openapi.php -v 1.1 -o ./web/sui/openapi.yaml -f yaml
To run an interactive script on the container:
./Exec.ps1 -i php scripts/add-user.php
To build the front-end and deploy it to the ~/web
folder:
./Exec.ps1 build
When deploying to webservers, the site will need some routing adjustments to function as a proper single-page application. Here are some sample configurations that might be helpful:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
location / {
try_files $uri $uri/ /index.html;
}