Skip to content

Latest commit

 

History

History
127 lines (100 loc) · 4.87 KB

Setup.md

File metadata and controls

127 lines (100 loc) · 4.87 KB

Project Setup

Dependencies

  • Install Python >= 3.11

  • Install Postgresql DB Engine

  • Install python pip

  • Add Python, scripts to PATH

    • Windows

       {Python_dir}\Python311\Scripts\
       {Python_dir}\Python311\
      
    • Unix ( mac / linux )

      No need to add anything
      
  • Project Python Venv

    • Windows

       not tested yet (you can skip this, or do it on your own)
      
    • Unix ( mac / linux )

      • create an empty directory (we'll call it db_home)
      mkdir db_home
      cd db_home
      mkdir db_venv
      python3 -m venv db_venv
      
  • Clone the repository

    git clone https://github.com/ibraheemalayan/COMP333-DB-Project.git .
  • Install required modules

    source db_venv/bin/activate
    pip3 install -r requirements/development_requirements.txt
    cd src
  • redirect domains to 127.0.0.1

    • Windows

      • open a powershell console as administrator and run:

        Add-Content -Path 'C:\Windows\System32\drivers\etc\hosts' -Value '127.0.0.1     www.silal-payments.com'
        Add-Content -Path 'C:\Windows\System32\drivers\etc\hosts' -Value '127.0.0.1     management.silal-payments.com'
        Add-Content -Path 'C:\Windows\System32\drivers\etc\hosts' -Value '127.0.0.1     delivery.silal-payments.com'
      • clear dns cache

        ipconfig /flushdns
    • Mac OS (unix)

      Note: if lookups against hosts file are slow, see this answer

      • open a terminal run:

        sudo zsh -c "echo -e '::1\twww.silal-payments.com' >> /etc/hosts"
        sudo zsh -c "echo -e '::1\tdelivery.silal-payments.com' >> /etc/hosts"
        sudo zsh -c "echo -e '::1\tmanagement.silal-payments.com' >> /etc/hosts"
      • clear dns cache

        sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    • Linux

      • open a terminal run:

        sudo su
        echo -e '127.0.0.1\twww.silal-payments.com' >> /etc/hosts
      • no need to flush DNS

IDE Extentions

To enhance IDE performance, disable all extentions then enable only globally required extentions for VSCode ( CoPilot, Themes, Git ... ) and enable other extentions for this workspace only.

Required workspace extentions

Required global extentions

Collaboration Setup ( Pre Commit Hooks )

In order to collaborate to the remote repository you have to finish the following setup:

  • enable format on save in VSCode
  • install precommit https://pre-commit.com/#install
  • run the following in the project root
    pre-commit install
    pre-commit install --hook-type commit-msg --hook-type pre-push

    those commands will install the pre-commit hooks defined in the .pre-commit-config.yaml file for the local repo