Setup
Local development setup
First steps for local development setup:
- Clone the repository
- Copy the file
.env.exampleto.envand customize it for your local environment- Set
USER_IDto the UID owning the local files (echo $UID) - Add your
TMDB_API_KEY
- Set
- Run
make build_developmentto create your local development environment- Build and start the development stage of the docker image from scratch
- Mount project files in to the docker container (changes to files affect application in realtime)
- Install composer dependencies
- Create the database (sqlite on default)
- Run database migrations
- Create the storage symlink
The application should be up-to-date and running locally now.
Use the following cli commands to manage your local environment:
make upto start the application in production stage using SQLite (using docker volumes)make up_mysqlto start the application in production stage using MySQL (using docker volumes)make up_developmentto start the application in development stage using SQLite (mounting local files)make up_development_myqslto start the application in development stage using MySQL (mounting local files)make downto stop all containersmake app_database_migrateexecute the database migrationsmake app_jobs_processprocess the next job from the queue (see database tablejob_queue)
Xdebug
You can change XDEBUG_MODE to debug in the .env file to enable debugging using Xdebug in the development docker container.
For example, in VSCode or VSCodium, the following debug configuration would allow you to set breakpoints and debug the PHP code:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/app": "${workspaceRoot}"
}
}
]
}
IDE recommendation: PhpStorm
We recommend to use PhpStorm and to import the Movary code style scheme (found at settings/phpstorm.xml).
For import instructions see the official docs.
To apply the code style rules use at least the following features:
Notes:
- Please apply the code style rules for every file you changed
- To find the default shortcuts for the features and/or customize search for them in Settings -> Keymap
- If you use the PhpStorm UI for git you can execute the features automatically before every commit (Settings -> Version Control -> Commit -> Commit Checks)
Documentation
General
Description
We use Material for MkDocs for the documentation.
This is part of the default development docker compose setup and can be reached via http://127.0.0.1:8000.
To adjust the documentation files look into the docs directory and the configuration of MkDocs is in mkdocs.yml.
Setup
Run make up_docs to start MkDocs. Set environment variable HTTP_PORT_DOCS to adjust host port.
REST-Api
Checkout the API docs via the url http://127.0.0.1/docs/api.
This uses the schema defined in the file /docs/openapi.json. Please adjust openapi schema if you change the API.