### Start the application Source: https://www.strichliste.org/docs/migrate-from-strichliste2 Launch the production environment to trigger the automatic database migration. ```bash make prod ``` -------------------------------- ### Back up the database Source: https://www.strichliste.org/docs/migrate-from-strichliste2 Create a backup of the existing database before starting the migration process. ```bash mysqldump -u strichliste -p strichliste > strichliste2-backup.sql # MariaDB/MySQL pg_dump -U strichliste strichliste > strichliste2-backup.sql # Postgres # SQLite: copy the database file ``` -------------------------------- ### Start strichliste services Source: https://www.strichliste.org/docs/getting-started Commands to clone the repository and initialize the backend environment. ```bash git clone https://github.com/strichliste/strichliste-backend.git cd strichliste-backend make up ``` -------------------------------- ### Alternative start command Source: https://www.strichliste.org/docs/getting-started Use this command if the make utility is not available on your system. ```bash docker compose up -d --build --wait --wait-timeout 300 ``` -------------------------------- ### Configure LDAP import Source: https://www.strichliste.org/docs/commands Installs the required LDAP dependency and executes the import command. Note that this requires the PHP LDAP extension. ```bash composer require symfony/ldap ``` ```bash php bin/console app:ldapimport --host=ldap.company.tld \ --bindDn="cn=reader,ou=ldapuser,dc=company" \ --password="yourpass" --baseDn="ou=employee,dc=company" ``` -------------------------------- ### GET /api/user Source: https://www.strichliste.org/docs/api Retrieves a list of all enabled users, with optional filtering by activity. ```APIDOC ## GET /api/user ### Description Returns a list of all enabled (non-disabled) users. ### Method GET ### Endpoint /api/user ### Parameters #### Query Parameters - **active** (boolean) - Optional - Filters users by recent activity. ``` -------------------------------- ### GET /api/article Source: https://www.strichliste.org/docs/api Retrieves a list of articles, optionally filtered by barcode or activity status. ```APIDOC ## GET /api/article ### Description Retrieves a list of articles. Supports filtering by barcode and activity status. ### Method GET ### Endpoint /api/article ### Parameters #### Query Parameters - **barcode** (string) - Optional - Filter articles by barcode. - **active** (boolean) - Optional - Filter articles by active status. - **limit** (integer) - Optional - Number of results to return. - **offset** (integer) - Optional - Number of results to skip. ``` -------------------------------- ### Error Response Format Source: https://www.strichliste.org/docs/api Example of the JSON error envelope returned by the API when a request fails. ```json {"error": {"class": "App\\Exception\\TransactionBoundaryException", "code": 400, "message": "Transaction boundary reached"}} ``` -------------------------------- ### Configure database connection Source: https://www.strichliste.org/docs/migrate-from-strichliste2 Set the DATABASE_URL in the .env file to point to the existing database instance. ```bash DATABASE_URL="mysql://strichliste:secret@192.168.1.10:3306/strichliste?serverVersion=10.11.2-MariaDB&charset=utf8mb4" COMPOSE_PROFILES= ``` ```bash DATABASE_URL="sqlite:////app/var/data.db" COMPOSE_PROFILES= ``` -------------------------------- ### Import Strichliste 1 database Source: https://www.strichliste.org/docs/commands Migrates data from a legacy SQLite database. Requires --force if the target database is not empty. ```bash php bin/console app:import database.sqlite ``` ```bash docker compose cp database.sqlite app:/tmp/old.sqlite docker compose exec app php bin/console app:import /tmp/old.sqlite ``` -------------------------------- ### Manage backend lifecycle Source: https://www.strichliste.org/docs/getting-started Commands to stop the services or perform a full cleanup of data. ```bash docker compose down ``` ```bash docker compose down -v ``` -------------------------------- ### Restore SQLite database file Source: https://www.strichliste.org/docs/migrate-from-strichliste2 Replace the newly created SQLite database with the existing data file and adjust permissions. ```bash docker compose cp ./your-old-data.db app:/app/var/data.db docker compose exec -u root app chown www-data /app/var/data.db docker compose restart app ``` -------------------------------- ### Execute console commands in Docker Source: https://www.strichliste.org/docs/commands Standard pattern for running console commands within the application container. ```bash docker compose exec app php bin/console … ``` -------------------------------- ### Configure Chromium in Kiosk Mode Source: https://www.strichliste.org/docs/screen Run Chromium in a fullscreen, control-free environment suitable for a dedicated terminal. The flags disable error dialogs, pinch-to-zoom, and ensure audio autoplay for feedback sounds. ```bash chromium --kiosk --noerrdialogs --disable-pinch \ --autoplay-policy=no-user-gesture-required \ https://your-server/user/active ``` -------------------------------- ### Perform Transactions via cURL Source: https://www.strichliste.org/docs/api Common integration patterns for depositing funds or purchasing articles using the transaction endpoint. ```bash # deposit 1.00 € with a comment curl -X POST http://server/api/user/4/transaction \ -H 'Content-Type: application/json' \ -d '{"amount": 100, "comment": "cash box"}' # buy an article (server computes the price; amount must be omitted # or negative — sending a positive amount with articleId is rejected) curl -X POST http://server/api/user/4/transaction \ -H 'Content-Type: application/json' \ -d '{"articleId": 3, "quantity": 1}' # → {"transaction": {"id": …, "amount": -150, "article": {…}, …}} ``` -------------------------------- ### Cleanup inactive accounts Source: https://www.strichliste.org/docs/commands Bulk-disables accounts based on inactivity duration and balance thresholds. ```bash php bin/console app:user:cleanup --days=3 --months=10 --maxBalance=300 --confirm ``` -------------------------------- ### POST /api/user/{id}/transaction Source: https://www.strichliste.org/docs/api Creates a new transaction for a specific user, such as a deposit or an article purchase. ```APIDOC ## POST /api/user/{id}/transaction ### Description Creates a new transaction for a user. This can be used to deposit funds or purchase an article. ### Method POST ### Endpoint /api/user/{id}/transaction ### Parameters #### Path Parameters - **id** (string/integer) - Required - The numeric ID or exact name of the user. #### Request Body - **amount** (integer) - Optional - The amount in cents (for deposits). - **comment** (string) - Optional - A comment for the transaction. - **articleId** (integer) - Optional - The ID of the article being purchased. - **quantity** (integer) - Optional - The quantity of the article being purchased. ### Response #### Success Response (200) - **transaction** (object) - The created transaction object. ``` -------------------------------- ### Manage user account status Source: https://www.strichliste.org/docs/commands Updates the active status of a user. The second argument is inverted: true disables the account. ```bash php bin/console app:user:status ``` -------------------------------- ### Retire old transaction data Source: https://www.strichliste.org/docs/commands Deletes transactions older than the specified interval for data privacy compliance. ```bash php bin/console app:retire-data --days=3 --months=10 --confirm ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.