MacOS 1 - Setup Working Environment for Web Development

By Sheldon L Published at 2020-07-26 Updated at 2020-07-26


References

https://bitfumes.com/courses/tool/configuring-macos-for-laravel

Basics

Homebrew and XCode

Git and Githubs

Vim

VSCode

Terminal

git clone https://github.com/zsh-users/zsh-syntax-highlighting

vim ~/.zshrc # add 'source path/to/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh'
git clone https://github.com/zsh-users/zsh-autosuggestions

vim ~/.zshrc # add 'source path/to/zsh-autosuggestions/zsh-autosuggestions.zsh'

Node.js and npm

brew install node

For PHP-Mysql-Laravel

PHP, Mysql, Sequel Pro

brew install php
php -v

brew install mysql
mysql.service start
mysql -v
mysql -uroot  # open as root

> update mysql.user set plugin="mysql_native_password"; # give semicolon
> exit

mysql.service restart

Composer and Laravel Valet

brew install composer

# for China
composer global require slince/composer-registry-manager
composer repo:ls
composer repo:use aliyun

composer global require laravel/valet

export PATH=$PATH:~/.composer/vendor/bin

valet install  # will install nginx and dnsmasq
valet start
touch index.php
<?php
echo "hello";
cd projectName
valet link projectName
valet links
valet unlink projectName

valet tld # check the top level domain
valet tld test # change the tld
valet secure # use https

# shareing
composer global require beyondcode/expose
expose token [YOUR-AUTH-TOKEN]  # https://beyondco.de/login get token
expose  # in project dir

For Python

# anaconda graphic installation for Mac
# add /opt/anaconda3/bin to path