Software installations necessary for the basics of web development.
Following tools:
- Homebrew
- Xcode
- VS Code
- Git
- Node.js
- PostgreSQL
- MongoDB
- Python
- Django
- flywheel (for wordpress)
Homebrew is a package manager that we will use to install various command line tools.
Open up terminal, and paste the following command to install Homebrew. You might be prompted to install XCode Command Line Tools during the install process.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
If you are prompted to install the XCode CLI, say yes and your homebrew installation will continue.
After the installation process, run the command brew doctor
. If any warnings or errors are displayed, we will need to resolve them before proceeding with the rest of the install fest.
Lastly, make sure to run brew update
to make sure you have the latest lists of available software.
Normally, all you need is the Xcode CLI which should have already been installed when you installed Homebrew. If it didn't get installed, you can use this command:
xcode-select --install
If you need to, you can install Xcode through the App Store. (You probably don't need to.) Link here
Text editors are a personal choice. One of the most popular open source text editors these days, for good reason, is Visual Studio Code.
Note: VS Code's keyboard shortcuts are different than the shortcuts used by the Sublime or Atom editors. If you already know Sublime's shortcuts and don't want to learn those of VS Code, it's possible to configure VS Code to use Sublime's.
Download and install VS Code from https://code.visualstudio.com/.
Important: Be sure that VS Code is in your Mac's Applications
folder.
- Launch VS Code using spotlight (
command + space
- then start typingvs c
until you see the app, then press enter). - Type
shift + command + P
to open the command palette. - Start typing
shell command
and when you theShell Command: Install 'code' command in PATH
command - click it! - Quit VS Code and Terminal.
- Relaunch Terminal
- You should now be able to open a folder to edit by typing
code .
Check this link for troubleshooting if you run into issues.
Git is a version control software - it's extremely popular.
If it's not installed, we can use Homebrew to install it:
brew install git
Note: This is IMPORTANT
Everyone should have a global git ignore file so that you don’t have to worry about making the appropriate entries in a project’s git ignore.
First, create the file: touch ~/.gitignore_global
Next, configure git to use this file: git config --global core.excludesfile ~/.gitignore_global
Finally, lets put some good stuff in there (.gitignore_global
):
To open and edit file cd ~
to get to your root directory, then open .gitignore_global
. Paste the following contents:
# This is a list of rules for ignoring files in every Git repositories on your computer.
# See https://help.github.com/articles/ignoring-files
# Compiled source #
###################
*.class
*.com
*.dll
*.exe
*.o
*.so
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
# OS generated files #
######################
._*
.DS_Store
.DS_Store?
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# Testing #
###########
.rspec
capybara-*.html
coverage
pickle-email-*.html
rerun.txt
spec/reports
spec/tmp
test/tmp
test/version_tmp
# node #
########
node_modules
# Rails #
#########
**.orig
*.rbc
*.sassc
.project
.rvmrc
.sass-cache
/.bundle
/db/*.sqlite3
/log/*
/public/system/*
/tmp/*
/vendor/bundle
# Ruby #
########
*.gem
*.rbc
.bundle
.config
.yardoc
_yardoc
doc/
InstalledFiles
lib/bundler/man
pkg
rdoc
tmp
# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
# .ruby-version
# .ruby-gemset
# CTags #
#########
tags
# Env #
#######
.env
# Python #
#######
*.pyc
__pycache__/
Node is a JavaScript engine for the backend. We use it to power our web servers and connect to our databases.
brew install node
Verify the installation afterwards by running:
node -v
npm -v
The above commands should display versions without any errors. To verify that all the required permissions are set correctly, try to install a package such as the useful nodemon globally:
npm install -g nodemon
Install the PostgreSQL database management system (DBMS) using Homebrew with this command:
brew install postgresql
After Postgres is installed run this command:
brew services start postgresql
Followed by this command to test the install by creating a new database named the same as the current system user:
createdb
Install MongoDB using Homebrew using the following commands:
brew tap mongodb/brew
The above command might take a moment or two to complete. When finished, install MongoDB with:
brew install mongodb-community
You start the Mongo database server with the following command:
brew services start mongodb-community
The above command also ensures that the MongoDB engine runs after restarting your computer.
More info about installing MongoDB using Homebrew can be found here.
Note: Due to time constraints and for simplicity, we will not be using Python "virtual environments" during SEI. If you are familiar with using virtual environments, you may continue to use them. If you decide to continue to develop using Python beyond SEI, your next step would be to learn about using virtual environments.
Brew is also used to install Python 3. (Python 2 is already installed on your Mac.)
Install Python using Homebrew with this command: brew install python
.
You can test the installation by running python3 --version
.
Python 3's package manager, pip3
should have automatically been installed with Python 3. Test that it was installed by running pip3 --version
.
We will use pip3
to install Django, a robust web framework for Python. We will be installing the latest version (3.x.x):
pip3 install Django
Flywheel provides you with all the tools you need to run WordPress on your desktop PC for testing or development purposes. You can easily test your projects on mobile devices