This repository was archived by the owner on Jun 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Onboarding for Developers
zoeyvf edited this page May 18, 2023
·
47 revisions
Note: It is beneficial to follow the back-end installation steps even if you only plan on working on the front-end as the front-end won't work without the back-end.
- macOS users
- Probably want to install Homebrew (it's good for everything) (After the completion of the installation on the terminal, it'll ask you to run 3 commands. If there's no output after running them, you're probably fine.)
- To verify that Homebrew is installed, you can run
$ brew -v
to see version information. - IF YOU HAVE AN M1 MAC and your computer inherited Homebrew from a non-M1 device, you'll probably need to uninstall and reinstall it.
- Use
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
in terminal to uninstall. - Then reinstall with
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- To verify that Homebrew is installed, you can run
- Make sure Xcode is installed from the app store.
- You might need to download the Xcode command line tools from developer.apple.com/
xcode-select --install
- Probably want to install Homebrew (it's good for everything) (After the completion of the installation on the terminal, it'll ask you to run 3 commands. If there's no output after running them, you're probably fine.)
- VS Code
- python 3.8 (not 3.9 or 3.10)
- as we are using an older version of python, it's useful to have a version manager such as asdf or pyenv
- Install asdf.
- node 16.8+ (but < 17), preferably via installed via nvm (Node Package Manager) or
- (on windows, which maybe happens automatically) chocolatey:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash exec $SHELL nvm install 16 nvm use 16
- on macOS
$ brew install nvm
- Add nvm to your ~/.zshrc using the instructions that brew gives you after the install.
export NVM_DIR="$HOME/.nvm" [ -s "$(brew --prefix)/opt/nvm/nvm.sh" ] && \. "$(brew --prefix)/opt/nvm/nvm.sh" # This loads nvm [ -s "$(brew --prefix)/opt/nvm/etc/bash_completion.d/nvm" ] && \. "$(brew --prefix)/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
-
$ nvm install 16.x
where x >= 8
-
Postgres
- keep note of the username and password you create in the installation process (or when you launch it for the first time)
- macOS:
$ brew install postgresql
and$ brew install --cask pgadmin4
if you want
-
git
- macOS:
brew install git
- macOS:
- GitHub Desktop
- Fork project repositories
- clone the forks onto your local machine
- usually
Documents/GitHub
or something (I usually consider putting them "side-by-side" in the filesystem)
- usually
- Download pgAdmin4 from the Homebrew website
- Once downloaded, open the app and create a master password of your choice (AND BE SURE TO NOT FORGET IT!)
- Click on create a server and fill out the required red text
- Create file called .env in project root (
/CPR-MUSIC-BACKEND/.env
) with this line:DATABASE_URL=postgres://user:pass@localhost/teleband
-
user
andpass
are the username and password of the postgres user you created
- Create Postgres Database in the pgAdmin program server with your created user
- open a terminal (git bash, Terminal, command prompt, powershell)
- For windows: press windows + R this should bring up the
Run Dialog
and typecmd
and press ctrl + shift + enter to open the command prompt
- For windows: press windows + R this should bring up the
- Navigate to the backend repo (clone)
cd <place where you cloned it>
- get the accompaniments files from a teammate and put them in
<place where you cloned backend>/teleband/media/accompaniments
-
dir
orls
to show the contents to make sure -
cd ..
back up so you are in the directory containing theCPR-Music-Backend
directory - create a venv with
python3 -m venv venv-musiccpr
- cd down into the cloned repo again
cd CPR-Music-Backend
- activate venv
- Windows -
..\venv-musiccpr\Scripts\activate.bat
- macOS -
../venv-musiccpr/bin/activate
- if this doesn't work and you have pyenv, perhaps try creating a venv that way
- Windows -
- install requirements
pip3 install -r requirements/local.txt
(this may take a while)- might need to run
pip3 install --upgrade pip
before
- might need to run
python3 manage.py migrate
-
python3 manage.py createsuperuser
- remember what you put here! Put it in a password manager or something.
- doesn't have to be a real email. (but it has to validate the form)
python3 manage.py runserver
- Fingers crossed everything worked!
- You need to login to http://127.0.0.1:8000/admin/ not http://127.0.0.1:8000/
- Use the username and password you made with your superuser
- cd into the
/CPR-Music/
-
npm i
(this will install the dependencies listed inpackage.json
(and any of their dependencies, and so on) - Create a file in the root of the frontend repository called
.env.local
(there should already be.env.production
and.env.development
). In this file, have contents like:SECRET=anythingyouwantexceptImNotSureWhatSymbolsAreOKInHere NEXTAUTH_URL="http://localhost:3000"
npm run dev
- Go to http://localhost:3000
- Everything (hopefully) should be peachy!
choco install nodejs.install --version 16.13.0 --allow-downgrade
from slack
- Form opinion about usefulness of WSL
v0 login for testing (back over in https://tele.band)
- student:
860f629b
- teacher:
[email protected]
J66aXbDYq7wHp6Ln2!VeF2CKrVGpwCV3N_NihpV_sApZ8kv2rok8cuLiZHrnAPmF