/Covid-19-Tracker

Covid-19 project that displays statistics for each country regarding the pandemic.

Primary LanguageJavaScript

Covid-19-Tracker

Covid-19 project that displays statistics for each country regarding the pandemic.

Installation

To download repo you can:

  • Use git clone:
  git init 
 git clone https://github.com/AmeanAsad/Covid-19-Tracker.git  
  • Download zip file from Git.

After download, you need to install required packages:

  • You need to have Node and pip installed on your machine. Installing these packages is fairly easy with a quick google search.
  • There are two steps to this, installing the Python Django Packages and Installing the Node Packages:
  1. To install Python Packages:
  • Open terminal/cmd
  • cd to the root directory of the repo.
  • Run pip install -r requirements.txt
  1. To install Node Packages:
  • Open terminal/cmd
  • cd to the root directory of the repo.
  • Type cd DjangoReact/frontend
  • Type npm install

Usage

  • There are two types of local environments you can run:

    1. A development environment, running Django and React independtly. This is the recommended one for performing edits on the project.
    2. A production environment, serving the React app through the Django server on the same localhost . This is recommended only to test the website before a push to production.
  • To run the development environment:

    1. Open two terminal/cmd tabs and cd to the root directory of the project on both tabs.
    2. On one of the tabs type cd DjangoReact/frontend
    3. In the root directory tab, type python manage.py runserver --settings=settings to start the Django server.
    4. In the frontend directory tab, type npm start to start the react app.
    5. Go to your browser and in the url tab, type http://localhost:3000/ to navigate to the page.
  • To run the production environment:

    1. Open two terminal/cmd tabs and cd to the root directory of the project on both tabs.
    2. On one of the tabs type cd DjangoReact/frontend
    3. In the root directory tab, type python manage.py runserver --settings=production_settings to start the Django server.
    4. In the frontend directory tab, type npm run build .
    5. In DjangoReact/frontend directory, copy the src file from that directory.
    6. Paste it in the root directory of the project, and replacing the src file there. (I am working on a fix to prevent the copy/pasting part, but this works for now).
    7. Go to your browser and in the url tab, type http://127.0.0.1:8000/ to navigate to the page.