Home

Awesome

Community Service

A Laravel web app for registering for service opportunities.

Installation

Make sure the following are installed on your system:

  1. Node.js, NPM, and Grunt for build script.
  2. Composer for PHP dependencies.

Then:

  1. Create an app database starting with "l_". For example, "l_commsvc". Create a user who can access the database. For local, it's good to name the user and password the same name as the database. If you like, you can use /app/database/scripts/create-database.sql as a starting point.
  2. Duplicate .env.example.json as .env.json and enter configuration options:
    • Database info, matching the above
    • CDN info, for where logo uploads are stored. By default, it will upload them to a server via FTP, and you can just enter the FTP connection info here. If you need to upload them via another protocol, you can make changes in app/config/packages/graham-campbell/flysystem/config.php.
    • Payment connection info, if your system will be accepting payment. This uses the npmweb/payment library, which currently only supports Braintree as a payment provider. Enter your Braintree account info here.
  3. Run npm install to install the grunt packages for this project.
    • Note: on some OSes you may get this error: Error: /usr/lib64/libstdc++.so.6: version CXXABI_1.3.5' not found`. If so, check this GitHub issue for help. The short version is that you may be able to run the following:
      • sudo wget -O /etc/yum.repos.d/slc6-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo
      • sudo rpm --import http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/51/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern
      • sudo yum install devtoolset-2-gcc.x86_64 devtoolset-2-binutils.x86_64 devtoolset-2-gcc-c++
      • Then, instead of running a plain “npm install” within your project, run this: SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=1 CC=/opt/rh/devtoolset-2/root/usr/bin/gcc CXX=/opt/rh/devtoolset-2/root/usr/bin/g++ npm install
  4. Run grunt. This:
    • Installs PHP dependencies with composer install.

    • Creates symlinks for web assets with symlink.

    • Makes sure temp folders are writable with chmod.

    • Generates CSS from Sass.

    • Creates and populates the local database using

        php artisan migrate
        php artisan db:seed
        
      
    • Runs automated tests with phpunit

  5. This application allows the frontend and backend to run on different domains, if you like. Set your web server to point endpoints/frontend and backend to the web address you want them at. For example, you could point http://myorganization.com/service to endpoints/frontend and http://intranet.myorganization.com/service to endpoints/backend.
  6. Edit endpoints/[backend and frontend]/.htaccess, changing the RewriteBase line to the path your app is at
  7. Make sure both the frontend and backend come up. You can log in to the backend with the default user superadmin / password
  8. If you want the system to notify you if a registration closes without anyone being signed up for it, set up a cron to execute php artisan occurrence:notifyCancelled

Initial Setup

Once the app is up and running, you'll want to do some customization for your installation:

Usage

Data Model

The Community Service system uses the following data model:

General Steps

To use the system:

  1. Create beneficiaries
  2. Create or import service opportunities and occurrences of them.
  3. Send users to the frontend to register for your service opportunities.
  4. As users register, depending on your settings, either the churches and/or the beneficiaries may receive emails notifying them of registrations.
  5. You can log in to the system to run reports for yourself or for the beneficiaries, to inform them about participants who will be coming.

Conventions and Gotchas

If you need to make changes to the code, these are things that are different in our usage of Laravel from the typical stuff you'll see online.

Open Items

The following are issues and limitations we're aware of:

Contribute!

Like our software and want to help out? You can do any of the following:

License

This application is open-sourced under the MIT license. See the LICENSE file for more details.