The primary development environments for most backends is linux. MacOS are similar to Linux (both track their origins from Unix). Macs will be able to run many of the commands that linux uses.
Install the Ubuntu sub system see here: https://docs.microsoft.com/en-us/windows/wsl/install-win10\
ls
Lists all files/folders in your current folder
cd <Folder that exists in your current folder>
"Change Directory" Changes current folder to another folder in your current folder
nano
Simple commandline based text editor
python <filename>
runs basic python files, without a filename it will open a python shell where you can run python code directly in terminal
man
get the manual for any command
On Ubuntu your package manager will be the pre-installed apt-get
command
For macs follow this to install the package manger brew
:
https://brew.sh/
pip is a package manager for python that allows you to install useful libraries to make your life easier
First check if pip is already installed, and if so skip this part of setup. To check if pip is installed run:
pip -V
If there is an error the follow the below steps:
Follow this tutorial to download and run the install script https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py
To install pip on Ubuntu run:
sudo apt-get install python-pip
Virtual Environments are a sub version of your python install. It allows you to install and use packages without worrying about conflics with your root environment.
python3 -m venv <Name of environment you want to create>
source <Name of environment>/bin/activate
Flask is the web server framework we will be using to run web servers using python
pip install flask
export FLASK_APP=<Server file name> && flask run
Database we will use for persistent storage of data
brew tap mongodb/brew
brew install mongodb-community
If you are using windows sub system this will be added later once issues are resolved But you can try this: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
mongod
Launches a mongoDB server using the default configuration only accessable on your machine
mongo
Opens a shell to run mongoDB commands on the server you are running with mongod
pip install pymongo