Hyperf-based headless permission management system

Hyperf-based headless permission management system

2022-09-14 0 1,262
Resource Number 38415 Last Updated 2025-02-24
¥ 0HKD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

In this issue, we recommend a front-end and back-end separation permission management system developed based on the Hyperf framework and SCUI (Element UI) – MineAdmin.

 

Hyperf-based headless permission management system插图

MineAdmin is developed based on the Hyperf framework, the front-end uses Vue3.0 + SCUI (based on Element UI), supports PC and mobile terminals, and the system can be used for website management background, CMS, CRM, OA, ERP, etc. MineAdmin is a back-end permission management system, which provides a complete permission system, so that developers can focus on specific businesses, reduce development costs, and improve project efficiency.

Built-in features
User management, complete the configuration of user addition, modification, and deletion, and support different users to log in to the background to see different home pages
Department management, departmental organization (company, department, group), tree structure to display support data permissions
Post management, which can be assigned to the position held by the user
Role management, role menu permission assignment, role data permission assignment
Menu management, configuration of system menus and buttons, etc
Dictionary management, which can be reused and maintained for frequently used and fixed data in the system
System configuration, management of some common settings of the system
Operation logs, which are queries made by users about some normal operations of the system
Login logs, which are logged in to the system by users
Online Users, to view the currently logged-in users
Service monitoring to view information such as the current server status and PHP environment
Dependency monitoring to view the library information and versions that the current program depends on
Attachment management: Manage information such as files and pictures uploaded by the current system
Data table maintenance, the data table of the system can be cleaned up and optimized
Module management, all current modules of the management system
Data table designer, simple version of database designer, with code generator to do more with less
Scheduled tasks: Online (add, modify, and delete) task scheduling includes execution result logs
Code generation, front-end and back-end code generation (php, vue, js, sql), support download and generation to modules
Cache monitoring to view Redis information and key information used by the system
API management, application and interface management, interface authorization, and other functions. Automatic generation of interface documents, input and output parameter checking, etc

Hyperf-based headless permission management system插图1

Install and deploy

1 Server Requirements

MineAdmin has some requirements for the system environment, when you use the Swoole network engine driver, it can only run in Linux and Mac environments, but due to the development of Docker virtualization technology, Docker for Windows can also be used as the runtime environment under Windows.

2 Environmental requirements

Swoole >= 4.5.x and turn off Short Name
PHP >= 7.4 and enable the following extensions: mbstring, json, pdo, openssl, redis, pcntl
Mysql >= 5.7
Redis >= 4.0

3 Download the project

MineAdmin does not use SQL file to import and install, the system uses Migrates migration file to install and populate data, please be aware.

To download your project, make sure you have Composer installed:

git clone https://gitee.com/xmo/MineAdmin && cd MineAdmin
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
composer install

4 Back-end installation

To install a project, you need to open two terminals, one to start the project and the other to execute the installation command.

Open the startup terminal and start the project:

php bin/hyperf.php start

Switch to the installation terminal, run the installation command, and complete the configuration of the .env file:

php bin/hyperf.php mine:install

After the following information is prompted, switch to the startup terminal, restart the project, and load the .env configuration information:

Reset the “.env” file. Please restart the service before running
the installation command to continue the installation.

Switch to the installation terminal, run the installation command again, and execute the Migrates data migration file and SQL data filling to complete the installation.

php bin/hyperf.php mine:install

5 Front-end mounting

Please make sure that you have installed node.js, yarn or npm tools, yarn is recommended.

cd mine-ui && yarn
or
cd mine-ui && npm install

Initiate:

yarn dev
or
npm run dev

In actual development, you can use php watch -c to start the project, which can listen for file changes and hot restart in real time to improve development efficiency.

6 Project Deployment

When the project needs to be deployed or tested in the online environment, and the local and online environments are inconsistent or the front-end and back-end are not on the same server, you need to perform Nginx reverse proxy and modify some configurations of the front-end.

Back-end agents
# At least one Hyperf node is required, multiple configurations and multiple rows
upstream hyperf {
# IP and port of Hyperf HTTP Server
server 127.0.0.1:9501;
}

server {
# Ports
listen 80;
# Domain name
server_name demo.mineadmin.com;
# Logs
access_log /data/wwwlogs/demo.mineadmin.com_nginx_access.log combined;
error_log /data/wwwlogs/demo.mineadmin.com_nginx_error.log debug;

# Deploy the front-end code of the same domain root directory, note:
location / {
root /data/wwwroot/demo.mineadmin.com;
try_files $uri $uri/ /index.html;
index index.html;
}

# Custom underscore parameters can be transmitted through headers
# underscores_in_headers on;

# PHP code
location /api/ {
# Forward the host and IP information of the client to the corresponding node
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Forward the protocol schema to the corresponding node, if you use non-https, please change it to http
proxy_set_header X-scheme https;

# Execute an agent to access the real server
proxy_pass http://hyperf/;
}
}
Required front-end configurations

The front-end also uses a proxy to request the back-end interface

Find the following configuration in mine-ui/vue.config.js and modify it according to your own situation

Base URL
const base_url = ‘http://127.0.0.1:9501’

Proxy API prefix
const proxy_api = ‘/api’

7 Extensions with compatibility issues

Since Hyperf is based on Swoole coroutines, the coroutines brought by Swoole 4 still have compatibility issues with many extensions. The following extensions, including but not limited to, cause certain compatibility issues and cannot be used or co-existed with:

xhprof
xdebug
blackfire
trace
uopz
Demo images

Hyperf-based headless permission management system插图2 Hyperf-based headless permission management system插图3 Hyperf-based headless permission management system插图4 Hyperf-based headless permission management system插图5 Hyperf-based headless permission management system插图6 Hyperf-based headless permission management system插图7 Hyperf-based headless permission management system插图8 Hyperf-based headless permission management system插图9 Hyperf-based headless permission management system插图10 Hyperf-based headless permission management system插图11 Hyperf-based headless permission management system插图12

Development documentation

Backend Documentation: Backend Documentation | MineAdmin

Front-end documentation: Development Specs | MineAdmin

This project uses the Apache 2.0 open source license, and you can read more content by yourself.

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free Source Code Hyperf-based headless permission management system https://ictcoder.com/hyperf-based-headless-permission-management-system/

Share free open-source source code

Q&A
  • 1. Automatic: After making an online payment, click the (Download) link to download the source code; 2. Manual: Contact the seller or the official to check if the template is consistent. Then, place an order and make payment online. The seller ships the goods, and both parties inspect and confirm that there are no issues. ICTcoder will then settle the payment for the seller. Note: Please ensure to place your order and make payment through ICTcoder. If you do not place your order and make payment through ICTcoder, and the seller sends fake source code or encounters any issues, ICTcoder will not assist in resolving them, nor can we guarantee your funds!
View details
  • 1. Default transaction cycle for source code: The seller manually ships the goods within 1-3 days. The amount paid by the user will be held in escrow by ICTcoder until 7 days after the transaction is completed and both parties confirm that there are no issues. ICTcoder will then settle with the seller. In case of any disputes, ICTcoder will have staff to assist in handling until the dispute is resolved or a refund is made! If the buyer places an order and makes payment not through ICTcoder, any issues and disputes have nothing to do with ICTcoder, and ICTcoder will not be responsible for any liabilities!
View details
  • 1. ICTcoder will permanently archive the transaction process between both parties and snapshots of the traded goods to ensure the authenticity, validity, and security of the transaction! 2. ICTcoder cannot guarantee services such as "permanent package updates" and "permanent technical support" after the merchant's commitment. Buyers are advised to identify these services on their own. If necessary, they can contact ICTcoder for assistance; 3. When both website demonstration and image demonstration exist in the source code, and the text descriptions of the website and images are inconsistent, the text description of the image shall prevail as the basis for dispute resolution (excluding special statements or agreements); 4. If there is no statement such as "no legal basis for refund" or similar content, any indication on the product that "once sold, no refunds will be supported" or other similar declarations shall be deemed invalid; 5. Before the buyer places an order and makes payment, the transaction details agreed upon by both parties via WhatsApp or email can also serve as the basis for dispute resolution (in case of any inconsistency between the agreement and the description of the conflict, the agreement shall prevail); 6. Since chat records and email records can serve as the basis for dispute resolution, both parties should only communicate with each other through the contact information left on the system when contacting each other, in order to prevent the other party from denying their own commitments. 7. Although the probability of disputes is low, it is essential to retain important information such as chat records, text messages, and email records, in case a dispute arises, so that ICTcoder can intervene quickly.
View details
  • 1. As a third-party intermediary platform, ICTcoder solely protects transaction security and the rights and interests of both buyers and sellers based on the transaction contract (product description, agreed content before the transaction); 2. For online trading projects not on the ICTcoder platform, any consequences are unrelated to this platform; regardless of the reason why the seller requests an offline transaction, please contact the administrator to report.
View details

Related Source code

ICTcoder Customer Service

24-hour online professional services