### Start Development Server Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-local-development.md Start the development server and open the browser to play with Monica. ```bash yarn dev ``` -------------------------------- ### Copy Environment File Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-local-development.md Copy the example environment file to create your local .env configuration. ```bash cp .env.example .env ``` -------------------------------- ### Run Queue Listener Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-local-development.md Optional: Start a queue listener for the high, low, and default queues. ```bash php artisan queue:listen --queue=high,low,default ``` -------------------------------- ### Install Composer Dependencies Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-local-development.md Run this command to install PHP dependencies with Composer, optimized for production. ```bash composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader ``` -------------------------------- ### Install Yarn Dependencies Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-local-development.md Install JavaScript dependencies with a frozen lockfile to ensure reproducibility. ```bash yarn install --frozen-lockfile ``` -------------------------------- ### Build Frontend Assets Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-local-development.md Build the JavaScript and CSS files for production. ```bash yarn build ``` -------------------------------- ### Example setWebhook URL Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-telegram.md Example setWebhook URL using the token and webhook URL from the .env variables above. Copy and paste into your browser to register the webhook. ```text https://api.telegram.org/bot393828013:AAEaw8ewefwhKIdkW2EIy23ksVY51XQqsV7o_3M/setWebhook?url=https://app.monicahq.com/telegram/webhook/lkjl2kjl2k323oIOWEJFkek ``` -------------------------------- ### Run Monica Setup Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-local-development.md Run the Monica setup command with force and verbose output. ```bash php artisan monica:setup --force -vvv ``` -------------------------------- ### Example webhook URL Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-telegram.md Example webhook URL using the public URL https://app.monicahq.com and the .env variables set above. ```text https://app.monicahq.com/telegram/webhook/lkjl2kjl2k323oIOWEJFkek ``` -------------------------------- ### Generate Dummy Data Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-local-development.md Optional: Generate dummy data for development. ```bash php artisan monica:dummy --force -vvv ``` -------------------------------- ### Create SQLite Database File Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-local-development.md Create an empty SQLite database file if you choose to use SQLite. ```bash touch monica.db ``` -------------------------------- ### Generate Application Key Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-local-development.md Generate the APP_KEY for your Laravel application. ```bash php artisan key:generate --no-interaction ``` -------------------------------- ### Webhook URL structure Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-telegram.md The webhook URL structure for Telegram. Replace [PUBLIC URL] with your instance's public URL (e.g., from ngrok or Expose for local development) and [TELEGRAM_BOT_WEBHOOK_URL] with the random string from your .env. ```bash https://[PUBLIC URL].'/telegram/webhook/'.[TELEGRAM_BOT_WEBHOOK_URL] ``` -------------------------------- ### Telegram webhook set response Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-telegram.md JSON response from Telegram when the webhook is successfully set. This confirms the URL is registered. ```json {"ok":true,"result":true,"description":"Webhook was set"} ``` -------------------------------- ### Telegram setWebhook URL structure Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-telegram.md Structure to inform Telegram of the webhook URL. Replace [TELEGRAM_BOT_TOKEN] and the URL parameter with your values. ```text https://api.telegram.org/bot[TELEGRAM_BOT_TOKEN]/setWebhook?url=[https://[PUBLIC URL].'/telegram/webhook/'.[TELEGRAM_BOT_WEBHOOK_URL]] ``` -------------------------------- ### Telegram .env variables Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/setup-telegram.md Fill these three variables in the .env file to configure Telegram. The bot token is provided by Telegram after bot creation; the bot URL is derived from the bot's username prefixed by https://t.me/; the webhook URL is a random string you define for signing webhooks. ```shell TELEGRAM_BOT_TOKEN=393828013:AAEaw8ewefwhKIdkW2E TELEGRAM_BOT_URL=https://t.me/monicahq_bot TELEGRAM_BOT_WEBHOOK_URL=lkjl2kjl2k3232IOWEJFkek ``` -------------------------------- ### Run Monica Next with log mailer Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/docker.md Sets the MAIL_MAILER environment variable to 'log' to enable user registration without a real mail server. Useful for local testing. ```sh docker run -p 8080:80 -e MAIL_MAILER=log ghcr.io/monicahq/monica-next:main ``` -------------------------------- ### Run Monica Next Docker image on port 8080 Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/docker.md Runs the ghcr.io/monicahq/monica-next:main image locally on port 8080 using SQLite. Access the application at http://localhost:8080. ```sh docker run -p 8080:80 ghcr.io/monicahq/monica-next:main ``` -------------------------------- ### Extract and auto-translate strings with monica:localize Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/translation.md Run this artisan command to extract translation strings from views and add them to the translation files. It also automatically translates all empty strings in all supported locales using Google Translate. ```sh php artisan monica:localize ``` -------------------------------- ### Update language files with artisan lang:update Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/translation.md Run this command to update the default Laravel language files for the new language. It is part of the workflow after adding a new language. ```sh php artisan lang:update ``` -------------------------------- ### Add a new language with artisan lang:add Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/translation.md Run this command to add a new language to the app, replacing 'fr' with the two-letter language code. After running, you need to translate the default Laravel language files. ```sh php artisan lang:add fr ``` -------------------------------- ### Add translated strings to JSON translation files Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/translation.md Each string to translate must be added to the translation files (e.g., fr.json, de.json) in this JSON format. The key is the original string and the value is the translation. ```json { "This is a string to translate": "C'est une chaîne de caractères à traduire", } ``` -------------------------------- ### Translate strings in Vue with laravel-vue-i18n Source: https://github.com/monicahq/docs-gitbook/blob/main/developers/translation.md Import the i18n library and use the trans() function or the $t() helper to translate strings in Vue files. The trans() function is used in methods, while $t() is used inside HTML templates. ```javascript import { trans } from 'laravel-vue-i18n'; // in a method trans('Are you sure? This action cannot be undone.') // inside the actual HTML {{ $t('This is a string to translate') }} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.