This is assuming you've already cloned the repository on your laptop. If you haven't just Slack me lol, I'm too lazy to write that up rn. The first 4 steps are for when you're setting this up for the first time. After the intial setup you shouldn't have to do all this again. Just reactivating your venv and running the website.
An env file holds something called environment variables. Basically you can store sensitive information in the file and then call on that sensistive info throughout our code, without it being displayed in the repository on github (i.e. no one can see it).
Setup
First time you clone the repository create two files both exactly named .env
. One should go in the root folder of the repository, and the other in the website folder. Make sure it is exactly named .env
. Message me for the information that should go in that file, and make sure you never upload it to github. If you name it .env
then you dont have to worry about it.
A venv stands for a virtual environment. If you want you can learn more about them here. if not, just know they're useful lol.
Setup
- In your repository, in the terminal, run
pip install virtualenv
- Now create the virtual environment
python -m venv .venv
- Next you have to activate the environment (do this every time you see it has closed)
# Mac Activation
source .venv/bin/activate
# Windows Activation
.venv/Scripts/Activate
A reason why we set up the virtual environment is it's like we're cacooning ourselves in a little space with only the imports we actually need for our code.
To install these requirements do:
pip install -r requirements.txt
This step is a little more complicated. The only reason we are using node (and some other stuff) is so that we can setup something called 'linters'. They basically ensure that your code is following the correct style rules and format. Then with these linters we setup something called GitHub actions, so every time you push code to your branch, or make a pull request with main, it will block you unless the linters say your code is fine. #GoodCodeSavesLives
-
First go ahead and install a comand called
nvm
using this installation guide--it will also installNode.js
and thenpm
command. make sure you install the latest version (ignore all the parts where you can specify a version to install) -
Now install the
yarn
command by typingnpm install --global yarn
in your terminal- Check that it actually installed by doing
yarn --version
- Check that it actually installed by doing
-
Now in the root folder of the project type
npm install
in your terminal. If that doesn't work, doyarn install
After that you should be all set unless I forgot a step lol--message me.
Almost forgot about this step so disregard my previous sentence haha. Anywho, for this step do the following.
-
In the root folder of the repository, make a folder exactly titled
databases
-
Communicate with me to get the mock files to put in this folder
You should now be all set and can run the website by doing:
python main.py
The terminal will tell you what link to open to see the website.