Covid-19 project that displays statistics for each country regarding the pandemic.
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:
- To install Python Packages:
- Open terminal/cmd
- cd to the root directory of the repo.
- Run
pip install -r requirements.txt
- To install Node Packages:
- Open terminal/cmd
- cd to the root directory of the repo.
- Type
cd DjangoReact/frontend
- Type
npm install
-
There are two types of local environments you can run:
- A development environment, running Django and React independtly. This is the recommended one for performing edits on the project.
- 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:
- Open two terminal/cmd tabs and cd to the root directory of the project on both tabs.
- On one of the tabs type
cd DjangoReact/frontend
- In the root directory tab, type
python manage.py runserver --settings=settings
to start the Django server. - In the frontend directory tab, type
npm start
to start the react app. - Go to your browser and in the url tab, type
http://localhost:3000/
to navigate to the page.
-
To run the production environment:
- Open two terminal/cmd tabs and cd to the root directory of the project on both tabs.
- On one of the tabs type
cd DjangoReact/frontend
- In the root directory tab, type
python manage.py runserver --settings=production_settings
to start the Django server. - In the frontend directory tab, type
npm run build
. - In
DjangoReact/frontend
directory, copy thesrc
file from that directory. - 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). - Go to your browser and in the url tab, type
http://127.0.0.1:8000/
to navigate to the page.