Publishing platform for legal commentaries
- Install Docker Desktop
- Clone this repository:
git clone [email protected]:textandbytes/onlinekommentar.git
- cd into the project directory:
cd onlinekommentar
- Copy the
.env.example
file insources/webapp
and name it.env
, update it with application-specific configuration variables - cd into the webapp directory:
cd sources/webapp
- Run the following command to install Laravel Sail:
docker run --rm \ -u "$(id -u):$(id -g)" \ -v "$(pwd):/var/www/html" \ -w /var/www/html \ laravelsail/php81-composer:latest \ composer install --ignore-platform-reqs
- Start the application using Docker with Laravel Sail:
sail up
- Install dependencies with composer:
sail composer install
- Install frontend dependencies:
sail npm install
- Go to http://localhost:8001 and click on "GENERATE APP KEY" (the key will be stored in your
.env
file)
By default, Statamic stores the application configuration and data in several places. It uses flat files (YAML and Markdown) for both the configuration (e.g. "blueprints" that define the model of a content type) and the data (e.g. an item of a certain type).
In order to separate the application source code and the user-generated content, this application stores the following data in a dedicated folder under sources/webapp/data
:
- content
- revisions
- resources
- storage
- revisions
- users
The content of this folder is not tracked in this repository. In order to retrieve the application data from the production server (or staging server), developers are expected to use the dedicated repository where this data is stored. The repository where the data is: https://github.com/textandbytes/onlinekommentar-data. Access to this repository is restricted to users with appropriate permissions.
- Clone the onlinekommentar-data repository into sources/webapp:
[email protected]:onlinekommentar/onlinekommentar-data.git
- Rename the onlinekommentar-data folder to
data
The blueprints and users roles definitions are stored in the default location (resources
), and are tracked in this repository.
- Run
sail artisan storage:link
to create a symbolic link to the storage folder
- cd into the webapp directory :
cd sources/webapp
and runcomposer
,npm
andartisan
commands via Sail. See examples below. - Depending on your use case, clone the remote git repository containing the application data (https://github.com/textandbytes/onlinekommentar-data) under
sources/webapp/data
.⚠️ The application data should always be pulled from the production/staging server, not the other way around.
cd sources/webapp/data
git pull
- Log in to the CP and clear all caches under "Utilities > Cache Manager"
- Watch local file changes (JS, CSS):
sail npm run watch
sail npm <command>
, e.g.sail npm install
sail artisan <command>
, e.g.sail artisan config:clear
sail composer require <dependency>
, e.g.sail composer require statamic/cms
- To test sending and receiving mails from the application locally, go to http://localhost:8026
- The master branch is manually deployed to production using Ploi (ploi.io). Note: to enable auto deploy, go to Github > Settings > Webhooks and click "Active" on the Ploi webhook. Please leave disabled unless you know what you are doing.