{"id":22957090,"url":"https://github.com/kenmwaura1/price_tracker_backend","last_synced_at":"2026-05-09T10:31:49.253Z","repository":{"id":46223854,"uuid":"424229162","full_name":"KenMwaura1/price_tracker_backend","owner":"KenMwaura1","description":"A Django API to display items and their current up-to-date prices from different online retailers in one platform. Utilizing scrapy to periodically scrape the latest prices from different online retailers. Store in a PostgreSQL database and make available via an API. ","archived":false,"fork":false,"pushed_at":"2021-11-05T14:40:37.000Z","size":102,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-07T16:39:19.262Z","etag":null,"topics":["django","django-rest-framework","postgresql","scrapy"],"latest_commit_sha":null,"homepage":"https://price-tracker-backend.herokuapp.com/ ","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KenMwaura1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-03T13:13:22.000Z","updated_at":"2021-11-05T14:40:39.000Z","dependencies_parsed_at":"2022-08-31T02:41:43.673Z","dependency_job_id":null,"html_url":"https://github.com/KenMwaura1/price_tracker_backend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KenMwaura1%2Fprice_tracker_backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KenMwaura1%2Fprice_tracker_backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KenMwaura1%2Fprice_tracker_backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KenMwaura1%2Fprice_tracker_backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KenMwaura1","download_url":"https://codeload.github.com/KenMwaura1/price_tracker_backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246739141,"owners_count":20825892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","django-rest-framework","postgresql","scrapy"],"created_at":"2024-12-14T17:15:15.206Z","updated_at":"2026-05-09T10:31:44.227Z","avatar_url":"https://github.com/KenMwaura1.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Price Tracker Backend \nA Django api to display items and their current up-to-date prices from different online retailers in one platform.\nUtilizing scrapy to periodically scrape the latest prices from different online retailers. Store in a PostgreSQL database and \nmake available via an API. \n\n\n[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)\n\n### **Note**: This project is a work in progress.\n\n## Front-End \nThe Angular frontend repo is found [here](https://github.com/LawiOtieno/price-tracker-frontend)\n### Live Front End\nLink to live [frontend](https://lawiotieno.github.io/price-tracker-frontend/home)\n\n## Setup Instructions / Installation\n\n### Getting Started\n\n### Prerequisites\n\n- Python and pip (I am currently using 3.9.7) Any version above 3.7 should work.\n* Git installed on your machine\n* Code editor/ IDE\n* PostgreSQL installed on your machine\n\n### Installation and Running the App\n\n1. Clone GitHub repository\n\n    ```shell\n    git clone \n    ```\n\n2. Change into the folder\n\n    ```shell\n   cd price_tracker_backend\n    ```\n\n3. Create a virtual environment\n\n   ```shell\n   python3 -m venv venv \n   ```\n\n    * Activate the virtual environment\n\n   ```shell\n   source ./bin/activate\n   ```\n\n* If you are using [pyenv](https://github.com/pyenv/pyenv):\n\n  3a. Create a virtualenv\n\n   ```shell\n   pyenv virtualenv price_tracker_backend\n   ```\n\n  3b. Activate the virtualenv\n\n   ```shell\n   pyenv activate price_tracker_backend\n   ```\n\n4. Create a `.env` file and add your credentials\n\n   ```\n   touch .env \n   ```\n\n   OR Copy the included example\n\n    ```\n    cp .env-example .env \n    ```\n5. Create a PostgreSQL Database \n\n    ```\n    psql -U postgres\n    ```\n\n    * Create a database\n\n    ```\n    CREATE DATABASE price_tracker_db;\n    ```\n\n    * Create a user\n\n    ```\n    CREATE USER price_tracker_user WITH PASSWORD 'password';\n    ```\n\n    * Grant privileges to the user\n\n    ```\n    GRANT ALL PRIVILEGES ON DATABASE price_tracker_db TO price_tracker_user;\n    ```\n\n    * Exit the psql session\n\n    ```\n    \\q\n    ```\n\n6. Add your credentials to the `.env` file\n\n    5a. export db credentials to your environment variables\n    \n    ```\n    export DATABASE_URL=postgres://user:password@localhost:5432/price_tracker\n    ```\n   \n\n6. Migrate your database\n    ```shell\n    python manage.py migrate\n    ```\n\n7. Install the required dependencies\n\n   ```shell\n   pip install -r requirements.txt\n   ```\n\n8. Make the shell script executable\n\n    ```shell\n   chmod a+x ./run.sh\n    ```\n\n9. Run the app\n\n    ```shell\n   ./run.sh\n    ```\n   app should be available on [http://127.0.0.1:8081/](http://127.0.0.1:8081/\n)\n\n\n   OR\n   run with python\n\n   ```shell\n   python manage.py runserver\n   ```\n### To run the scrapy spider\n```shell\n cd price_scraper \n scrapy crawl jumia_spider\n ```\n### To Run Scrapd and use a web interface\n```shell\ncd price_scraper \nscrapyd\n ```\n\n### To run ScrapyRT and get a real time API\n```shell\ncd price_scraper \nscrapyrt\n   ```\n* Test out the api: \n```shell\n curl \"http://localhost:9080/crawl.json?spider_name=jumia_spider\u0026url=https://jumia.co.ke/\"\n  ```\n    \n\n## Technologies used\n\n* Python-3.9.7\n* Django web framework\n* PostgreSQL\n* Scrapy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenmwaura1%2Fprice_tracker_backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenmwaura1%2Fprice_tracker_backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenmwaura1%2Fprice_tracker_backend/lists"}