You need the following software installed to run this project:
- PHP (>= 8.2) with the following extensions
- bcmath
- curl
- mbstring
- mysql
- redis (optional)
- xml
- Composer
- Node (tested with 18 and 20)
In addition, a database is required. Currently, only MariaDB is supported (others have not been tested).
On Ubuntu:
sudo apt install php php-{curl,xml,mysql,mbstring,bcmath}
See https://getcomposer.org/download/
With Volta:
curl https://get.volta.sh | bash
volta install node@lts
See https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/
Install MariaDB on Ubuntu:
sudo apt install mariadb-server
Create the database:
sudo mariadb
CREATE DATABASE roomz;
GRANT ALL PRIVILEGES ON roomz.* TO roomz@localhost identified by 's*3*c*r*3*t';
FLUSH PRIVILEGES;
exit
- Clone the git repository
- Install php dependencies
composer install
- Install node dependencies
npm install
- Create a dotenv file
cp .env.example .env
- Adjust the dotenv file
- Create an app key
php artisan key:generate
- Create database tables
php artisan migrate
- Create necessary data
php artisan db:seed
- Create a routes file
php artisan ziggy:generate
- Compile the frontend
- Development:
npm run dev
- Production:
npm run build
- Development:
- Start the websockets server
php artisan reverb:start
- Set up a reverse proxy (optional)
- Set up redis (optional)
- Run queue workers
- Run the scheduler
Three test accounts exist which you can configure in the .env
file.
Initially these accounts are:
- Regular user 1:
- Username: test1
- Password: test1
- Regular user 2:
- Username: test2
- Password: test2
- Admin user:
- Username: admin
- Password: admin
IMPORTANT: You must change these passwords in production.
When using on a production server, you probably want to proxy the websockets connections (since you may not have full control over the firewall). Here's how to do it.
See https://stackoverflow.com/a/43592531
Module rewrite
must be enabled.
Module proxy_wstunnel
must be enabled.
We assume that the app is deployed under /srv/git/roomz/
.
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin [email protected]
ServerName roomz.example.org
DocumentRoot "/srv/git/roomz/public"
<Directory "/srv/git/roomz/public">
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
# ---- Important for websockets! ------
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://localhost:6001/$1 [P,L]
[...]
</VirtualHost>
</IfModule>
Recompile the frontend:
npm run build
If routes have changed:
php artisan route:clear
php artisan route:cache
php artisan ziggy:generate
npm run build
If events/listeners have changed:
php artisan event:clear
php artisan event:cache
If environment variables or config files have changed:
php artisan config:clear
php artisan config:cache
If blade templates have changed:
php artisan view:clear
php artisan view:cache
If database migrations have been added:
php artisan migrate
Restart the schedule worker via your process supervisor.