Community center manager web application based on Laravel PHP MVC framework with a VueJS-based frontend.
This program is open-sourced software licensed under the AGPL license.
- PHP >= 8.2
- OpenSSL PHP Extension
- PDO PHP Extension
- Mbstring PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
- Intl Extension
- Imagick Extension (ImageMagick)
- PHP Composer
- MySQL/MariaDB/PostgreSQL Database
- Node.js 16.x
- Google OAuth for login using a OAuth service provider
- Sentry for application monitoring
- Symfony Mailer-compatible mail service
- Monolog-compatible logging service for log collection and analysis
Copy .env.example to .env and adapt database credentials and other settings accordingly.
Install PHP dependencies:
composer installGenerate application key:
php artisan key:generateCreate symlink for public storage disk:
php artisan storage:linkCreate/migrate database tables:
php artisan migrateYou have to compile the frontend assets (see below) in order for Javascript and CSS files to be available in the public web folder using npm run build or npm run dev (for development).
Configure the desired virtual host / domain your webserver to point to the public directory.
For more information see Laravel Docs
In order to run schedule commands, configure your cron service with the following cron job:
* * * * * cd PATH/TO/YOUR/APP/ROOT && php artisan schedule:run >> /dev/null 2>&1Obtain OAuth 2.0 credentials from the Google API Console. For more info see [https://developers.google.com/identity/protocols/oauth2](Google OAuth doc)
In your .env file, set the values of the following variables according to the information from Google.
- GOOGLE_CLIENT_ID
- GOOGLE_CLIENT_SECRET
- GOOGLE_REDIRECT
- GOOGLE_ORGANIZATION_DOMAIN (optional)
Once set, a new "Google Login" button should appear on the login view.
Run tests:
php artisan testCreate assets (CSS/JavaScript) using npm:
npm install
php artisan vue-i18n:generate
php artisan ziggy:generate
npm run devThe following list provides links to the documentation pages of the most common frontend libraries used in this project:
- Ensure tests, code style and static code analysis on
masterbranch run without errors - Update
Changelog.mdfile - Commit into Git
- Merge
masterbranch intoproductionbranch. - On the
productionbranch, create Git tag of the formvX.Y.Z, where X is the major version, Y is the minor version and Z is the patch version. Example: , e.gv1.0.0 - Push Git changes, including tags, to origin repository
It is recommended to execute a production deployment / upgrade as follows:
php artisan down --retry=60
php composer install --optimize-autoloader --no-dev
php artisan optimize
php artisan migrate --force
php artisan upRun:
./vendor/bin/pintor when using Laravel Sail:
sail pintMore information here: Laravel Pint
Run:
./vendor/bin/phpstan analyseor when using Laravel Sail:
sail php ./vendor/bin/phpstan analyseMore information here: Larastan
The following section assumes you are using Xampp on Windows and your custom virtualhost is ohf.test.
In this example, Xampp is located at c:\devel\xampp, and the document root is located at C:\devel\web.
The configuration of the file C:\devel\xampp\apache\conf\extra\httpd-vhosts.conf should look as follows:
<VirtualHost *:80>
DocumentRoot "C:/devel/web/ohf.test/public"
ServerName ohf.test
<Directory "C:/devel/web/ohf.test/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "C:/devel/web/ohf.test/public"
ServerName ohf.test
SSLEngine on
SSLCertificateFile "conf/ssl.crt/ohf.test.crt"
SSLCertificateKeyFile "conf/ssl.key/ohf.test.key"
<Directory "C:/devel/web/ohf.test/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>The following commands create a custom self-signed TLS certificate:
cd c:\devel\xampp\apache
bin\openssl.exe req -newkey rsa:2048 -sha256 -nodes -keyout conf\ssl.key\ohf.test.key -x509 -days 365 -out conf\ssl.crt\ohf.test.crt -config conf\openssl.cnfLaravel Sail is a light-weight command-line interface for interacting with Laravel's default Docker development environment.
Run the following command to install the composer dependencies:
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
laravelsail/php82-composer:latest \
composer install --ignore-platform-reqsConfigure a Shell alias for sail:
alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail'Copy the .env.example file to .env and set DB_HOST=mysql
Start the application:
sail up -dCreate app key and run migrations
sail artisan key:generate
sail artisan migrate
sail artisan storage:linkInstall NPM packages and build javascript assets
sail npm install
sail npm run devAccess the database via http://localhost:8080
Stop the application:
sail down