solenoid/simba
最新稳定版本:v1.0.0
Composer 安装命令:
composer create-project solenoid/simba
包简介
HTTP/CLI framework
关键字:
README 文档
README
Simba is a complete solution for building professional web-apps.
It uses php-core for backend, sveltekit for frontend and capacitor for building the mobile-app with the same codebase.
This app is an SPA (single-page application) with a multi-tenant users system.
System Requirements
This software is designed for Ubuntu Server 22.04
CLI
You can execute a specific task (CLI context)
Syntax: php x task {id} {method} ...{args}
Example: php x task OnDemand/Test print
Scheduler
You can schedule your tasks ( ./tasks/scheduler.json )
Scheduler is managed by the daemon
Daemon
You can use or extend the integrated daemon
Setup :
- Creating the service ->
sudo php x daemon register {name}( default-name is {app-id}.simba ) - Allowing run at boot ->
sudo simba service enable {name}
Start: sudo service {name} start
Stop: sudo service {name} stop
Restart: sudo service {name} restart
Setup
- Installing spm ->
bash <(wget -qO- "https://install.solenoid.it/spm@1.0.0/setup") - Installing simba ->
spm install simba - Creating a new app ->
simba app create {fqdn} -v {version} - Moving to the directory ->
cd {project-directory} - Creating the cert ->
simba vh make-cert {fqdn}* - Initializing the app ->
php x init - Configuring the file ->
{project-directory}/app.json - Configuring the files ->
{project-directory}/credentials/* - Building the sql ->
php x mysql build:make - Running the built sql ->
php x mysql build:run - Importing the DB models ->
php x mysql extract-models - Building the app (SPA) ->
php x build - Creating the user ->
php x task OnDemand/User create {tenant} {user} {email} {hierarchy-id}
Example ->php x task OnDemand/User create "simba" "admin" "email@sample.com" 1
* Server with private IP :
- Enabling "Self-Signed cert" ->
simba vh config {fqdn} - Restarting the web-server ->
sudo service apache2 restart
Note
Simba App is composed by separated fqdn for frontend and backend
Frontend-URL (for SPA realtime development) = https://front-dev.{app-id}:5173
Backend-URL (for APIs or server-side contents) = https://{app-id}
To reach these endpoints from your computer you have to set your local system hosts file (ex. /etc/hosts for linux) adding these two entries :
127.0.0.1 front-dev.{app-id}
{your-simba-server-ip} {app-id}
APIs
Simba uses sRPC (Solenoid-RPC) standard for APIs. APIs are handled by the ApiGateway controller class.
API-Calls can be invoked by the following HTTP request :
RPC /api HTTP/1.1
Action: My/Custom/Controller.method
Development
To start the dev-server for a frontend development session you have to digit :
php x dev
Access to https://front-dev.{app-id}:5173
If you are using VS Code for coding you should open the port 5173 to localhost ( localhost:5173 )
Now you can access the Frontend-URL from your computer
Build
To build the app (web + mobile) you have to digit :
php x build
Release
You can define your release logic inside a file ( ./release.php )
To release the app you have to digit :
php x release
Mode
You can develop your app component (store, service, model, task or controller) in two different modes :
Single Mode -> The component is available under one specific context (http or cli) -> Useful for specific implementations
Multi Mode -> The component is available for both of the contexts (http and cli) -> Useful for one-time coding
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-24