From 104eca996f2d4a544a6e4e339da953f941e6ddd6 Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Thu, 20 May 2021 14:35:00 -0600 Subject: [PATCH] docs: corrected initial setup instructions (#5095) --- .github/PULL_REQUEST_TEMPLATE.md | 1 - .tool-versions | 2 ++ CONTRIBUTORS | 1 + docs/contribute/readme.md | 37 ++++++++++++++++++++++---------- 4 files changed, 29 insertions(+), 12 deletions(-) create mode 100644 .tool-versions diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e82c8d6d2..ef4efd7c3 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -30,7 +30,6 @@ Please read the list below. Feel free to delete this text after but we need you - [ ] Make sure account reset and deletion still work. #### Other tasks -- [ ] [CHANGELOG](https://github.com/monicahq/monica/blob/master/CHANGELOG.md) entry added, if necessary, under `UNRELEASED`. - [ ] [CONTRIBUTORS](https://github.com/monicahq/monica/blob/master/CONTRIBUTORS) entry added, if necessary. - [ ] If it's relevant and worth mentioning, create a changelog entry for this change. The changelog entry will appear inside the UI for all users to see. To know if your change is worth the creation of a changelog entry, [read the documentation](https://github.com/monicahq/monica/blob/master/docs/administrators/tips.md#when-is-it-relevant-to-create-a-changelog-entry). - [ ] Don't forget to [ask for a free account](mailto:regis@monicahq.com) on https://monicahq.com as anyone who contributes can request a free account. diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 000000000..5f05c8267 --- /dev/null +++ b/.tool-versions @@ -0,0 +1,2 @@ +php 8.0.6 +nodejs 15.14.0 diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 8a4f41153..d7218c318 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -50,3 +50,4 @@ Russell Ault @RussellAult Martijn van der Ven @Zegnat Matthew Fitzgerald @mfitzgerald2 Simon Van Accoleyen @SimonVanacco +Michael Bianco diff --git a/docs/contribute/readme.md b/docs/contribute/readme.md index 280a2a220..e854d6b49 100644 --- a/docs/contribute/readme.md +++ b/docs/contribute/readme.md @@ -5,6 +5,7 @@ - [Install Monica locally](#install-monica-locally) - [Homestead (macOS, Linux, Windows)](#homestead-macos-linux-windows) - [Valet (macOS)](#valet-macos) + - [asdf (macOS)](#asdf-macos) - [Instructions](#instructions) - [Testing environment](#testing-environment) - [Setup](#setup) @@ -75,6 +76,20 @@ Note: the official Monica installation uses mySQL as the database system. While We've installed the development version with [Valet](https://laravel.com/docs/valet), which is a Laravel development environment for Mac minimalists. It works really well and is extremely fast, much faster than Homestead. + +### asdf (macOS) + +You can use [asdf](https://asdf-vm.com/#/) to install a version of php for monica: + +```bash +asdf install +asdf reshim + +pecl install redis +echo "extension=redis.so" > $(asdf where php)/conf.d/php.ini +``` + +You'll need to run the installation instructions below and setup a local mysql installation. After completing the application installation process you can run `php artisan serve` to get a local development server. ### Instructions **Prerequisites**: @@ -89,22 +104,22 @@ We've installed the development version with [Valet](https://laravel.com/docs/va Once the above softwares are installed (or if you've finished the installation of Homestead/Valet): 1. Create a database called `monica` in your mySQL instance. - 1. From Homestead directory: `sudo scripts/create-mysql.sh monica` or `mysql -e "CREATE DATABASE 'monica'";` inside mySQL. - 1. If you use Homestead (which uses Vagrant under the hood), `vagrant ssh` will let you login as root inside your VM. -1. Run `make install` in the folder the repository has been cloned. This will run : - 1. `cp .env.example .env` to create your own version of all the environment variables needed for the project to work. + 1. `mysql -e "CREATE DATABASE monica";` inside mySQL. + 2. If you use Homestead (which uses Vagrant under the hood), `vagrant ssh` will let you login as root inside your VM. +2. Setup the application environment: 1. `composer install --no-interaction` to install all packages. - Due to an issue with VirtualBox, you may encounter an error at this step due to a plug-in called `package-versions`. If this happens, delete the /vendor folder that was created and run `composer install --no-interaction --no-plugins --no-scripts` instead. - See this [GitHub Issue](https://github.com/laravel/homestead/issues/1240) for more information. - 1. `yarn install` to install all the front-end dependencies and tools needed to compile assets. + - Run `cp .env.example .env` to create your own version of all the environment variables needed for the project to work. + 2. `yarn install` to install all the front-end dependencies and tools needed to compile assets. - If you experience an error related to `EPROTO: protocol error, symlink`, see [here](https://github.com/yarnpkg/yarn/issues/4908). - 1. `yarn run dev` to compile js and css assets. - 1. `php artisan key:generate` to generate an application key. This will set `APP_KEY` with the right value automatically. - 1. `php artisan setup:test` to setup the database. + 3. `yarn run dev` to compile js and css assets. + 4. `php artisan key:generate` to generate an application key. This will set `APP_KEY` with the right value automatically. + 5. `php artisan setup:test` to setup the database. - By default this command will also populate the database with fake data. - Use the `--skipSeed` option to skip the process of adding fake data in your dev environment. - 1. `php artisan passport:install` to create the access tokens required for the API (Optional). -1. Update `.env` to your specific needs. + 6. `php artisan passport:install` to create the access tokens required for the API (Optional). +3. Update `.env` to your specific needs. If you haven't skipped the seeding of fake data, two accounts are created by default: @@ -127,7 +142,7 @@ We try to cover most features and new methods with unit and functional tests. An To setup the test environment: -* Create a database called `monica_test` +* Create a database `mysql -e "CREATE DATABASE monica_test;"` * `php artisan migrate --database testing` - If this fails due to the `oauth_auth_codes_table` already existing, edit `config/passport.php` to update the storage driver so `'connection' => 'testing'`, then run `php artisan migrate --database testing` again. - For more information, see this [GitHub Issue](https://github.com/laravel/passport/issues/1370).