定制 rockhopsoft/survloop 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rockhopsoft/survloop

Composer 安装命令:

composer require rockhopsoft/survloop

包简介

Survloop is an open data engine for designing a database and creating a mobile-friendly user interfaces to fill it.

README 文档

README

Laravel License: GPL v3

Table of Contents

About

Code bytes measured as stored on Mac disk:

  • PHP Controllers ~ 1.9MB (44%)
  • Blade HTML Template Views ~ 1.56MB (36%)
  • Javascript/jQuery within Blade Templates ~ 201KB (5%)
  • CSS within Blade Templates ~ 143KB (3%)
  • Survloop-Generated PHP Eloquent Data Table Models ~ 221KB (5%)
  • Survloop-Generated PHP Laravel Database Migration & Seeders ~ 291KB (7%)

Survloop is a Laravel-based engine for websites dominated by the collection and publication of open data. This is a database design and survey generation system, though it will increasingly be a flexible tool to solve many web-based problems.

It is currently in continued, heavy development, with much happening here in 2021, almost ready to go live. I plan to provide more documentation in the coming weeks. Thank you for your interest and patience!

This software was originally developed to build the Open Police system. It began as an internal tool to design our database, then prototype survey generation. Then it was adapted to the Laravel framework, and has continued to grow towards a content-management system for data-focused websites.

The upcoming Open Police web app is the best live install of the engine, and feedback on that project and the Survloop user experience can be via the end of the submission process: https://openpolice.org/filing-your-police-complaint The resulting database designed using the engine, as well as the branching tree which specifies the user's experience: /db/OP /tree/complaint Among other methods, the resulting data can also be provided as XML included an automatically generated schema, eg. /complaint-xml-schema /complaint-xml-example /complaint-xml-all

Other projects running Survloop: Cannabis PowerScore (GitHub).

The installation used for Survloop.org is currently the best example of a bare-bones extension of Survloop:
github.com/rockhopsoft/survlooporg

Requirements

Getting Started

Install Laravel & Survloop on Homestead

Full install instructions also describe how to set up a development environment using VirutalBox, Vargrant, and Laravel's Homestead. For these instructions, the new project directory is 'survproject'.

% composer create-project laravel/laravel survproject "8.5.*"
% cd survproject

Edit these lines of the environment file to connect the default MYSQL database:

% nano .env
APP_NAME="My Survloop Project"
APP_URL=http://survproject.local

DB_HOST=localhost
DB_PORT=33060
DB_CONNECTION=mysql
DB_DATABASE=survproject
DB_USERNAME=homestead
DB_PASSWORD=secret

Next, install Laravel's out-of-the-box user authentication tools, and Survloop:

% php artisan key:generate
% php artisan cache:clear
% COMPOSER_MEMORY_LIMIT=-1 composer require rockhopsoft/survloop
% nano composer.json

From your Laravel installation's root directory, update composer.json to require and easily reference Survloop:

...
"autoload": {
    ...
    "psr-4": {
        ...
        "RockHopSoft\\Survloop\\": "vendor/rockhopsoft/survloop/src/",
        "Predis\\": "vendor/predis/predis/src/",
    }
    ...
}, ...

It seems we also still need to manually edit config/app.php:

% nano config/app.php
...
'providers' => [
    ...
    App\Providers\FortifyServiceProvider::class,
    RockHopSoft\Survloop\SurvloopServiceProvider::class,
    ...
],
...
'aliases' => [
    ...
    'Survloop' => 'RockHopSoft\Survloop\SurvloopFacade',
    ...
], ...

If installing on a server, you might also need to fix some permissions before the following steps...

% chown -R www-data:www-data storage bootstrap/cache resources/views database app/Models

Clear caches and publish the package migrations...

% php artisan config:clear
% php artisan route:clear
% php artisan view:clear
% echo "0" | php artisan vendor:publish --force
% composer dump-autoload
% curl http://survproject.local/css-reload

With certain databases (like some managed by DigitalOcean), you may need to tweak the Laravel migration:

% nano database/migrations/2014_10_12_100000_create_password_resets_table.php
% nano database/migrations/2019_08_19_000000_create_failed_jobs_table.php

Add this line before the "Schema::create" line in each file:

\Illuminate\Support\Facades\DB::statement('SET SESSION sql_require_primary_key=0');

Then initialize the database:

$ php artisan migrate
$ php artisan db:seed --class=SurvloopSeeder
$ php artisan db:seed --class=ZipCodeSeeder
$ php artisan db:seed --class=ZipCodeSeeder2
$ php artisan db:seed --class=ZipCodeSeeder3
$ php artisan db:seed --class=ZipCodeSeeder4

Initialize Survloop Installation

Then browsing to the home page should prompt you to create the first admin user account:
http://survloop.local

If everything looks janky, then manually load the style sheets, etc:
http://survloop.local/css-reload

After logging in as an admin, this link rebuilds many supporting files:
http://survloop.local/dashboard/settings?refresh=2

Other Package Installation

The Excel tools use maatwebsite/excel, and you might need this on Ubuntu:

$ sudo apt-get install php7.4-zip

...or this on Mac:

$ brew update
$ brew install php@7.4
$ brew link php@7.4 --force

If you plan to generate PDFs, then you should also download and install Ghostscript. This is for Ubuntu, it might already be installed:

$ sudo apt-get install ghostscript

This works in Homestead on Mac, with Homebrew:

$ brew install ghostscript

Documentation

About Survloop's Codebase and Database Design

Better documentation is juuust beginning to be created...
survloop.org/package-files-folders-classes

Once installed, documentation of this system's database design can be found at http://localhost/dashboard/db/all. This system's survey design can be found at http://localhost/dashboard/surv-1/map?all=1&alt=1 or publicly visible links like those above.
survloop.org/db/SL

Roadmap

Here's the TODO list for the next release (1.0). It's my first time building on Laravel, or GitHub. So sorry.

  • Correct all issues needed for minimum viable product, and launch Open Police Complaints.
  • Integrate options for MFA using Laravel-compatible package.
  • Upgrade database and graphic design for admin tools, thus far only used by the author.
  • Code commenting, learning and adopting more community norms.
  • Add decent levels of unit testing. Hopefully improve the organization of objects/classes.
  • Improve import/export work flow for copying/moving installations.
  • Generate all admin tools by Survloop itself.
  • Add multi-lingual support on the Node-level (surveys and web pages), for starters, then database design.
  • Multi-lingual support at every level.
  • Convert more Survloop (older) code to take advantage of more Laravel built-in icapabilities.

Contribution Guidelines

Please help educate me on best practices for sharing code in this community. Please report any issue you find in the issues page.

Reporting a Security Vulnerability

We want to ensure that Survloop is a secure HTTP open data platform for everyone. If you've discovered a security vulnerability in the Survloop software or Survloop.org, we appreciate your help in disclosing it to us in a responsible manner.

Publicly disclosing a vulnerability can put the entire community at risk. If you've discovered a security concern, please email us at rockhoppers at runbox.com. We'll work with you to make sure that we understand the scope of the issue, and that we fully address your concern. We consider correspondence sent to rockhoppers at runbox.com our highest priority, and work to address any issues that arise as quickly as possible.

After a security vulnerability has been corrected, a release will be deployed as soon as possible.

rockhopsoft/survloop 适用场景与选型建议

rockhopsoft/survloop 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 200 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 03 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「Forms」 「survey」 「Content management system」 「laravel」 「open source」 「nodes」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 rockhopsoft/survloop 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 rockhopsoft/survloop 我们能提供哪些服务?
定制开发 / 二次开发

基于 rockhopsoft/survloop 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 200
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 5
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2020-03-27