README.md 2.84 KB
Newer Older
1 2
# LQDN soutien

3 4 5 6 7
This is a php application based on Fat-Free-Framework and a MySQL database that handles donations and presents offered to donors to La Quadrature du Net

It's used as our primary donation platform, and uses our bank's payment system (cheaper) to get one-time or recurring payments recorded into the donation platform.

## Installation (quick)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

In order to install this project, run `make doctor` to check that everything is fine.

Then you can run `make install` to install the project. Follow instructions if needed.
To install the DB, you need to run `make reset-db` (it will remove your local DB if it exists).

Once everything if fine, you can run a simple PHP server with `make server-start`

You have those accounts to test:

* alice@example.org / password
* bob@example.org / password

To access to the admin (`/admin`) use `admin`/`password`

## Contributing

Before submitting a PR, makes sure tests are OK: `make test`
26 27 28 29 30 31 32

# Detailed dependencies, installation ...

## Dependencies

This software depends on a few software :

33 34 35 36 37
* **composer** (to install php dependencies) see https://getcomposer.org/
* a **mysql client** (to inject the database schema)
* a **mysql server** (no need for it to be local)
* **pdftk** to generate pi-plomes (pdf with pi's decimals offered to our donors)
* **texlive-latex-base** for the `pdflatex` binary for the piplomes (only required in production or for people debugging the piplomes code)
38 39 40

and for developers you may also need :

41 42 43
* **xgettext** to manage translations, use:
  * `make messages.pot` to update PO files from source code.
  * `make translations` to compile MO files from PO files when translations are ready.
44 45 46

This software uses:

47 48 49 50 51
* **PHP5.6** currently (migration to PHP7.x is in the pipe)
* **phinx** to inject database schema and initial data / accounts into MySQL see https://phinx.org/ 
* **php-cs-fixer** to check php code for errors and fix coding standard issues, see https://github.com/FriendsOfPHP/PHP-CS-Fixer
* **doctrine/dbal** as ORM see https://github.com/doctrine/dbal 
* **f3 framework** as main view / controller framework. see https://fatfreeframework.com/
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

Look at `app/` folder for most Controllers, and `app/routes.ini` for the application routes (the URLs)

# Production deployment (not finished)

* `app/env` must contains the proper values : database connection, bank visa payment codes, and ENV=production at the bottom.
* point your Nginx or Apache with PHP5.6 to the `www/` folder, and either allow Rewrite Rules (a2enmod rewrite) or point every URL not being a file to index.php (see below for an nginx sample)
* use AND FORCE https usage, it's 2018, people ;) 

Nginx configuration sample:

```
location ~ \.php$ {
    include fastcgi_params;
    fastcgi_pass unix:/run/php5.sock;
}
location / {
   # try to serve file directly, fallback to index.php
   try_files $uri /index.php$is_args$args;
}
```