ottlinger / hornherzogen

Project to manage Aikidō seminar registrations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project hornherzogen

Logo

Pet project to manage seminar registration for Herzogenhorn ... started in January 2017. Proved to be useful in 2017 :-) Ready to be used for any consecutive year.

At the moment there seem to be some problem with recent PHP versions.

Update 2021-07

This project is archived as its PHP nature doesn't help making it runnable in varous cloud environments. If there's time a Java rewrite may happen ;) In order to get a visual impression of the app have a look at some screenshots.

Project Status

https://github.com/users/ottlinger/projects/5

Average time to resolve an issue Percentage of issues still open

Join the chat at https://gitter.im/hornherzogen

GPL v3.0

Github integrations

In order to just play around with it I've integrated the project into various freely available services.

Travis / CI

Build Status

Code coverage

codecov

Codacy - code quality and static analysis

Codacy Badge

Style CI - code style

StyleCI

Snyk - dependency management

Known Vulnerabilities

Releases

An overview of existing releases can be found here.

Local installation

Prerequisites

  • PHP >=7.3
    • with XML module installed
    • with MBString extension installed
    • with MySQL extension installed
    • with intl/i18n extension installed
    • (with php-xdebug in case you want local code coverage)
    • (with SQLite extension installed (for tests only)
  • Configured Mail server so that PHP may send mails
  • Webserver (Apache2)
  • MySQL database with tables initialized, see herzogenhorn.sql for details

What to change if you want to deploy the application

  • Clone the project into your webserver's root directory or download it as ZIP if you do not have a Git properly set up
  • Bootstrap the database with the help of herzogenhorn.sql and your favourite database admin tool
  • Copy and adapt the configuration template as inc/config.ini.php with all your credentials
  • Adapt the admin area credentials setup and path to AuthUserFile in .htaccess and .htpasswd
  • Use the project and verify with the help of the test scripts under admin that everything works fine :-)
  • Check your logs:
$ tail -f /var/log/apache2/*.log

PHP stuff

Local installations work fine with PHP7, while some hosters have trouble because of

  • UTF-8 issues
  • missing modules such as intl for l10n

Ubuntu

You need to install php and add some libraries to your local Webserver:

$ sudo apt-get install php7.4-xml php7.4-mbstring php7.4-mysql php7.4-intl
or in case you want to run tests or develop on the project
$ sudo apt-get install php7.4-xml php7.4-mbstring php7.4-mysql php7.4-intl php7.4-sqlite3 php-xdebug sqlite3
$ sudo /etc/init.d/apache2 restart

PHPUnit will be installed via composer, see section about development for further details.

MacOS

The equivalent installation via homebrew is

$ brew install php@7.4 sqlite3
(deprecated: $ brew install php70 php70-intl php70-xdebug sqlite3)

to make the tests run locally. The PHP extension for sqlite seems to be enabled by default.

Database Management

Create an individual database

If you are using MySQL you may setup your databases locally for easier development:

$ sudo apt install mysql
...
You will be asked for the MySQL root password - remember to remember that password!
...
$ mysqladmin create hornherzogen -u root -p
Enter password: // use above freshly created root user

$ mysql -u root -p

// if you want to connect from local
mysql> grant usage on *.* to dbuser@localhost identified by 'yourpasswordhere';
Query OK, 0 rows affected, 1 warning (0,00 sec)

mysql> grant all privileges on hornherzogen.* to dbuser@localhost;
Query OK, 0 rows affected (0,00 sec)

mysql> exit

$ mysql -u dbuser -p'yourpasswordhere' hornherzogen
// successful if you see:
mysql>

Do not forget to put above credentials into your inc/config.ini.php file.

Graphical database Management

In case you do not have a phpMyAdmin installed, you might want to give

$ sudo apt install mysql-workbench

a try.

Database Bootstrap

You may now use the bootstrap script herzogenhorn.sql

If you need to remove all tables, use herzogenhorn_remove.sql with GREAT CAUTION!

Composer / Dependency Management

In case you want to develop the dependency manager can be installed via:

$ curl -s https://getcomposer.org/installer | php
$ php composer.phar install

You should regularly perform an:

$ ./composer.phar self-update
$ ./composer.phar update

to get updates.

Unittests / PHPUnit

In order to run tests locally you need to run PHPUnit:

$ phpunit
or
$ phpunit -c phpunit.xml
Local run

In order to run tests locally (apart from Travis) you may want to configure a handy alias in your .bashrc:

# PHP aliases
alias phpunit='./vendor/bin/phpunit'

This is necessary if you've installed composer project-locally and have no phpunit installed on the system that is in your $PATH!

Testdocs

In order to see a nicer test output, launch:

$ phpunit --testdox tests

Configuration

The configuration file needs to be created in order to set certain application parameters. The file needs to reside in inc/config.ini.php and is not checked in!

Configuration parameter Comment
mail Complete email address, may contain a subject line as well
pdf Complete link to the seminar announcement (PDF)
registrationmail Email address that all registrations are send to
sendregistrationmails Boolean, whether to send registration mails to customers
sendinternalregistrationmails Boolean, whether to send mails internally upon registration via web form
submissionend Date string after which the application is not possible anymore, format: YYYY-mm-dd
dbhost Database hostname with port if necessary
dbname Database name
dbuser Database username
dbpassword Database password
iban Target account IBAN information
bic Target account BIC information
accountholder Target account holder name
superuser List of superusers with special permissions in the admin area (comma-separated list as one string)

See example configurations in configuration example of this project

Links and tutorials

This a collection of related links that helped working on and with this application:

Docker

Docker Build

$ docker build -t hornherzogen .
.....
Successfully tagged hornherzogen:latest

Docker compose

After building the local last version you may run:

$ docker-compose up

and the see the app under http://localhost:8080

License

Copyright © 2017-2021 P. Ottlinger, licensed as GPLv3 GPLv3

About

Project to manage Aikidō seminar registrations

License:GNU General Public License v3.0


Languages

Language:PHP 88.9%Language:CSS 6.3%Language:JavaScript 4.7%Language:Dockerfile 0.0%