A basic real-time chat platform (think Rocket.Chat or Discord) built on Laravel and React.
This project is built to work exclusively with containerization. Compatible with Docker and Podman.
The dev environment includes a "cli" container to development tools (PHP, Composer, etc.).
Two scripts help interact with this.
compose.shwraps eitherpodman composeordocker compose(control engine executable with CONTAINER_ENGINE env var) injecting environment specific compose configuration. Usage:./compose.sh {dev|prod} ....dev-cliis a shortcut for./compose.sh dev exec cli bash
The laravel directory is the one mounted into the containers. All container configuration files are inaccessible within the containers.
NOTE: prod environment has not been prepared yet. Non-functional.
-
Clone the repo
-
Prepare secrets
The containers feed secrets from three files,
db_password,db_root_password, andlaravel_app_key, withincontainers/<env>/secrets. Set appropriate passwords, and create an emptylaravel_app_keymkdir containers/dev/secrets echo -n "secretpassword" > containers/dev/secrets/db_password echo -n "othersecretpassword" > containers/dev/secrets/db_root_password touch containers/dev/secrets/laravel_app_key -
Start the containers:
./compose.sh dev up --build -d -
Drop into the dev-cli shell:
./dev-cli -
Run
composer install -
Run the DB migrations:
php artisan migrate -
While still in the dev-cli, generate a new
laravel_app_keyinto a file, exit thedev-cli, move it into place, and restart the containersphp artisan key:generate --show > laravel_app_key exit mv laravel/laravel_app_key containers/dev/secrets ./compose.sh dev stop ./compose.sh dev start -
Navigate to http://localhost:8080
- Laravel-powered REST API backend
- MariaDB for persistent storage
- Docker compatible containerization
- Helper scripts
compose.shanddev-clito simplify use
- Helper scripts
- Authentication w/ Laravel Sanctum
- SPA front-end built with React and Vite(?)
- Tailwind CSS
- Real-time communication
- Redis(?) for transient state
- Laravel Echo & Reverb
- Flesh out "prod" container config