Skip to content

Latest commit

 

History

History
45 lines (40 loc) · 2.19 KB

README.md

File metadata and controls

45 lines (40 loc) · 2.19 KB

Off Campus

This started as Max Gruber, Andrew Haberlandt, and Adam Lis's Hack OHI/O 2019 project. It is a web app and web scraper that allows the user to view aggregated property data from various realties around the campus of The Ohio State University.

Setting up the app

  1. Install dependencies: sudo apt install build-essential postgresql libpq-dev python3 python3-pip nodejs npm
  2. Set up back end
    1. Navigate to the back end directory
    2. Install the dependencies in the Django project: pip install -r requirements.txt
    3. Set up the environment variables file
      1. Copy .env.local.example and rename it to .env.local
      2. Populate the "SECRET_KEY"
      3. Populate the "GOOGLE_SECRET_KEY"
    4. Run Django migrations: python manage.py migrate
    5. Scrape listings: python manage.py scrape
  3. Set up database
    1. Start the Postgres service: sudo service postgresql start
    2. Change the password of the postgres user
      1. Open psql: sudo -u postgres psql
      2. Change the password: \password postgres
      3. Quit psql: \q
    3. Update the password of the postgres user in the backend .env file
      1. Navigate to the backend directory
      2. Open the .env file
      3. Change the "POSTGRES_PASSWORD" to the password you set above
    4. Create the Off Campus database: sudo -u postgres createdb offcampus
    5. Change Postgres's authentication mode
      1. Find the configuration file: sudo -u postgres psql -c "show hba_file;"
      2. Open the configuration file: sudo vim [configuration file path]
      3. Change "md5" to "password" in these lines:
        # IPv4 local connections:
        host    all             all             127.0.0.1/32            md5
        # IPv6 local connections:
        host    all             all             ::1/128                 md5
        
  4. Set up front end
    1. Navigate to the front end directory
    2. Install the dependencies in the Vue project: npm install

Running the app

  1. Navigate to the back end directory and run the Django app: python manage.py runserver
  2. Navigate to the front end directory and run the Vue app: npm run serve