This repository contains the Verwerkingsregister. This project has 2 main components:
CMS
The CMS is built using Laravel. This is where all the data for the processing records (verwerkingen) are kept and maintained.
Directory: /src/cms/
Public website
This contains the configuration for generating a static website using Hugo. It uses JSON and markdown data as its input to generate static html files.
Directory: /src/public-website/
- See docs/environment_variables.md for an overview of all environment variables that can be set in the
.env
file. - See docs/roles_and_permissions.md for an overview of all roles and permissions and the location where they are configured.
- An up-to-date Docker (Desktop) installation
-
Open a new terminal at
/src/cms
-
Create an
.env
file by copying the./.env.template
to./.env
and optionally set theSESSION_DRIVER
tofile
-
Setup docker using laravel/sail by running:
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-reqs
For more information see: https://laravel.com/docs/10.x/sail#installing-composer-dependencies-for-existing-projects
(The steps below assume you have an alias for
./vendor/bin/sail
) -
Start the container by running
sail up -d
-
Run
sail artisan key:generate
to generate a new application key -
Run
sail artisan migrate:fresh --seed
to (re)run all migrations and default seeder
As a result of these steps, you have created your local docker working directory, a database and seeded it with a user.
We now need the Public website script to build the static files within your container.
- Open the shell with
sail shell
- Run
npm ci
(NPM clean install) to install the required dependencies. If you visit your local website (in your browser) you should see a warning that says something likeVite manifest not found at: /var/www/html/public/build/manifest.json
. - Run
npm run build
(within the shell) to build the static files. This will generate the static files in thepublic
folder.
As a result of these steps, you have created the static files for the public website and in your browser you can see the Login page.
- Visit the project in your browser
- Login with the following credentials:
- Email:
[email protected]
(this user is added with the TestDataSeeder)
- Email:
- Open your local Mailpit instance to see the email that is send
- Click on the link in the email to login
- Add the 2FA code which you do not have
To be able to login, you have three options:
A. Set ENV variable ONE_TIME_PASSWORD_DRIVER
to fake
in your .env
file
- Open the
.env
file - Add
ONE_TIME_PASSWORD_DRIVER=fake
to the file - Visit your local default project url again and use a random 6-digit code for 2FA
B. Disable 2FA for the added user
sail shell
to enter the Shellphp artisan app:user-disable-otp
- add the email again and press Enter
- Visit your local default project url again and you are now logged in
C. Create a new admin user with 2FA disabled
sail shell
to enter the Shellphp artisan make:admin-user
- add the name and desired (fake) email you want to use to login
- Visit your local default project url again and login (with the email you just added)
Note: to actually use the CMS, you must have 2FA activated.
The current CI workflow consists of static code analysis and automated tests. The latter requires a local 'testing' database. You can use the testing database (which is available by default), which requires to run the migrations there:
- Bash into the sail-container:
php artisan sail
- Run
DB_DATABASE=testing php artisan migrate:fresh --seed
to (re)run all migrations and default seeders - Run the test:
php artisan test
(optionally with the--coverage
parameter)
Execute the following bin script to run all CI checks: ./bin/ci-local
- rdo-package.yml
- Build the zip file (used by iRealisatie) for the dataprocessing register