Skip to content

Onboarding for Devs (Windows)

Dhanshree Atre edited this page Jun 14, 2025 · 2 revisions

Note: unless otherwise specified, commands listed in this guide are to be run in Powershell, run as administrator.

Requirements

  1. Get C++ Build Tools from this site

    1. Click the Download Build Tools button
    2. Run the installer, and then select C++ build tools in the window that comes up
    3. Start the installation
      • Note: the download can take rather long depending on network
    4. Restart your computer
  2. CMake

    1. You'll want the Windows x64 Installer (unless your machine is not 64 bit) listed in the binaries section on this page
  3. Windows 11 Only: Zlib

    1. Run cmd.exe (Command Prompt) as an administrator
    2. Run the following command: powershell -Command "(Invoke-WebRequest -Uri https://git.io/JnHTY -OutFile install_zlib.bat)"; ./install_zlib.bat; del install_zlib.bat
      • ignore warnings about environment variables
  4. winget

    • winget is a package manager for Windows, and is included by default with Windows 10 (May 2020 update and later), and all Windows 11 installations
    • To check if you have winget, open PowerShell as an administrator, and just run winget.
      • If it's installed, you'll get information about the command, and you can proceed.
      • If it's not, you'll get an error message, naturally. I'm not sure at the moment if there is a reliable way to resolve if your Windows version is pre May 2020. Let me know if you don't have it installed and we can try a few different techniques.
  5. Python 3.12, via winget

    1. run winget install Python.Python.3.12
      • if the download progress in the console is very slow, install manually using the proper installer for your OS (most likely "Windows Installer (64-bit)) listed in the files section here
    2. Relaunch Powershell, then run python --version. If you see the Python 3.12.4 proceed to the next step.
  6. VSCode

  7. Git

  8. Make forks of the MusicCPR Repositories.

    • Frontend
    • Backend
      1. In the "Owner" dropdown, select Lab-Lab-Lab.
      2. In the "Repository name" textbox, append -<your username>, e.g., I would name my backend fork CPR-Music-Backend-mfwolffe
      3. Uncheck "Copy the main branch only
      4. "Create fork"
  9. Clone your forks to your machine.

    • This guide from the VSCode folks should help you get everything running smoothly
      • Note: for the purposes of this setup you only need to read up to and including the section titled, "Clone a repository locally"
    • I recommend making a folder to contain the two clones
    • Once you have your clones, as a smoke test run git remote -v in a Powershell inside the clones' directories (can use VSCode integrated terminal, just ensure it is a powershell and not cmd or git bash), and ensure that your output looks like the following (backend shown here; you may not have upstreams listed and that's okay for now):
      origin  https://github.com/Lab-Lab-Lab/CPR-Music-Backend-<your username>.git (fetch)
      origin  https://github.com/Lab-Lab-Lab/CPR-Music-Backend-<your username>.git (push) 
      upstream        https://github.com/Lab-Lab-Lab/CPR-Music-Backend.git (fetch) 
      upstream        https://github.com/Lab-Lab-Lab/CPR-Music-Backend.git (push) 
      
  10. Node Version Manager

    1. Install using an installation executable found here
    2. Post-installer, open a Powershell and run nvm --version, and ensure your output shows a version number of nvm and not an error.
    3. With nvm installed, run nvm install latest in your Powershell.
    4. Now within the parent directory of your two clones, or within the directory of your frontend clone if you chose not to keep the two clones in the same directory, look at the output and run the suggested version command
    5. Verify the correct version of node is being used locally, by running node --version; Your output should should confirm the version you are using
  11. Postgres

    • download and run the installer for postgresql >= 14.12 here
    • select all 4 components during install
    • enter a password when prompted, and DO NOT FORGET IT
    • choose port 5432

Backend Setup

  1. Set up the database

    1. Launch pgadmin4, and in the Dashboard under Quick Links, click Add New Server
    2. Under the General tab, give the server a meaningful name, MusicCPR is probably a good one, and is how the rest of the guide will reference it.
    3. Under the Connection tab, enter localhost in for "Host name/address", and ensure that the "Port" is 5432.
    4. Still within the Connection tab, enter your password once more, toggle "Save password", and then hit "Save"
    5. Right click the MusicCPR server and select "Create > Database"
      1. Enter a name, I'm just using teleband
      2. ensure the "Owner" is the user you've been using so far (most likely just postgres)
      3. hit "Save"
  2. Make your local clone aware of the database

    1. create a file named .env inside your CPR-Music-Backend directory
    2. add the following line:
    • DATABASE_URL=postgres://user:pass@localhost/teleband
    • where user and pass are the username and password you have been using thus far.
  3. Set up and activate a virtual environment

    1. Within the parent directory of your cloned repositories run py -3.12 -m venv musenv
    2. cd back into the backend directory
    3. run ..\musenv\Scripts\Activate.ps1
    • Your shell prompt should be prefixed with (musenv)
    • NOTE: it is particularly important you run the Activate.ps1 script in step (iii.) listed above from a Powershell instance.
  4. Fetch the media folder from a teammate Media Folder

    1. Paste it into your backend clone within the teleband directory
    2. ensure that from the VSCode file explorer sidebar, the media folder is "greyed out"
  5. Install backend dependencies

    1. You MUST ensure several things before proceeding:
      1. You are in the backend clone's directory (you can verify by running pwd)
      2. Your venv is activated, i.e., your shell prompt is prefixed with (musenv) or whatever you named your venv.
      3. Your shell is using the correct python executable. To check, run Get-Command python | fl *. Make absolutely certain that for File: the corresponding entry is the python.exe within your venv folder, and NOT something like: C:\Users\<username>\AppData\Local\Programs\Python\Python312\python.exe. Below is my output:
      HelpUri            : 
      FileVersionInfo    : File:             C:\Users\mfwol\Documents\Thesis\actual-OS-resolve\musenv\Scripts\python.exe
                     InternalName:     Python Launcher
                     OriginalFilename: py.exe
                     FileVersion:      3.12.4
                     FileDescription:  Python
                     Product:          Python
                     ProductVersion:   3.12.4
                     ...
                     Language:         Language Neutral
      
      Path               : C:\Users\mfwol\Documents\Thesis\actual-OS-resolve\musenv\Scripts\python.exe
      Extension          : .exe
      Definition         : C:\Users\mfwol\Documents\Thesis\actual-OS-resolve\musenv\Scripts\python.exe
      Source             : C:\Users\mfwol\Documents\Thesis\actual-OS-resolve\musenv\Scripts\python.exe
      Version            : 3.12.4150.1013
      Visibility         : Public
      OutputType         : {System.String}
      Name               : python.exe
      CommandType        : Application
      ...
      
      1. Lastly, and ...DO NOT SKIP THIS: There are myriad problems with the combination of Windows, Pillow, psycopg2, and Python 3.12. So we need to tweak a few things:
        • run the following manually:
        python -m pip install --upgrade pip
        python -m pip install --upgrade Pillow
        python -m pip install --upgrade psycopg2
        
    2. Once you have absolutely ensured you have completed/verified the above tasks and checks, cross your fingers and run: python -m pip install -r .\requirements.txt
    3. If that was error-free, cross your fingers once again and run database migrations with, python manage.py migrate
    4. Make a superuser for the django admin pages by running python manage.py createsuperuser and follow the prompts
      • DO NOT FORGET YOUR USERNAME AND PASSWORD
      • The email address you provide need not be a "real" address
    5. ...And if that was error-free, cross them once more and run python manage.py runserver. If your output is free of errors, pat yourself on the back, ya done good.

Frontend Setup

you're probably like, how the !@#$ is there more???. Thankfully, as long as you got the preliminaries, frontend setup is fairly trivial.

  1. Set the correct version of node
    1. From your frontend clone's directory, run: nvm use 22.3.0
    2. DON'T SKIP THIS: check that it was successful by running node --version. Your output should be v22.3.0. *If the expected version information is not displayed after running the command, open a new terminal session and try again. If the issue persists, restart your computer and reattempt the command.
  2. run npm i
    • this is an alias for npm install, which installs all dependencies & dependencies of dependencies & dependencies of dependencies of dependencies (you get the point) for MusicCPR listed in package.json
    • it can take a minute so don't panic if it seems like it's hung
    • don't worry about warnings; as long as there are no errors things are okay-ish
    • throw caution to the wind and even ignore the anticipated single "high severity vulnerability"
  3. Launch it
    1. Make sure the backend is still running
    2. Cross your fingers for hopefully the last time and run npm run dev
    3. In your browser, navigate to http://localhost:3000/
    4. Try to login with one of the demo users provided to you

And after all that, everything should be wunderbar

Quotidian Setup

quotidian?

  1. Check that your fork is in sync

    • if it isn't, sync it up either using git from the command line, or github's option to sync on your fork's page
  2. Launch the server/backend

    1. In a Powershell session within your backend clone activate the venv with ..\musenv\Scripts\Activate.ps1
    2. Check for migrations to be safe: python manage.py migrate
    3. Login to the admin pages as your superuser at http://localhost:8000/admin/
    4. Note: do not kill/quit the server while working
  3. Start up the frontend

    1. In a Powershell session within your frontend clone, run: npm run dev
    2. Navigate to http://localhost:3000/

Have fun coding

Clone this wiki locally