iccm-africa / iccm-backend

The International Conference on Computing and Mission (ICCM) Backend System
https://iccm.africa
GNU Affero General Public License v3.0
2 stars 4 forks source link

ICCM Backend

Purpose

This tool should help with the registration for the ICCM conferences.

Architecture

This software is written in Laravel. The long-term goal is to have a client written separately, that communicates with this backend.

API (new)

Endpoints and Authentication

A basic API is now availble providing the following endpoints:

The API is protected by a token, which is generated on login after the user has been authenticated using /api/auth.

A new user can be registered by sending a POST request to /api/users/register.

OpenAPI Documentation

A full documentation with examples and test UI of the API can be found at /api/documentation. It was created with the help of L5 Swagger using the OpenAPI 3.0 standard. Documentation is generated automatically from the code using annotations.

Run php artisan l5-swagger:generate or composer generate-docs to generate or update the documentation.

Setup of Development Environment

Requirements

Setup

To setup a local development environment with sample data, run these commands:

git clone https://github.com/iccm-africa/iccm-backend.git
cd iccm-backend
composer install --no-dev
cp .env.example .env
# TODO: edit .env and set your database credentials etc.
# set unique application key
php artisan key:generate
# initialise the database
php artisan migrate
# load sample data
mysql -u <username> <dbname> -p < database/database-example.sql
mysql -u <username> <dbname> -p < database/payment-methods.sql
# update the admin user with email address and valid password
php artisan tinker --execute="\$user = User::where('name', 'admin')->first();\$user->password = Hash::make('NOT_TopSecret1234');\$user->email = 'admin@example.org';\$user->save();"
php artisan serve

Setup with Docker and DDEV

Prerequisites: Docker and ddev installed (see: https://ddev.readthedocs.io/en/latest/users/install/ddev-installation/).

ddev start
ddev composer install --no-dev
cp .env.example .env
# TODO: edit .env and set your database to use ddev default config.
ddev artisan key:generate
ddev artisan migrate
ddev mysql < database/database-example.sql
ddev mysql < database/payment-methods.sql
ddev artisan tinker --execute="\$user = User::where('name', 'admin')->first();\$user->password = Hash::make('NOT_TopSecret1234');\$user->email = 'admin@example.org';\$user->save();"

Upgrade Laravel version

Follow the instructions at eg. https://laravel.com/docs/9.x/upgrade

Update the composer dependencies in composer.json, according to the upgrade instructions.

Then run:

composer update
composer install

Hints for Developers

License

This software is licensed under the GNU AGPLv3.