-
Python version: 3.8+
-
Django version: 3.2.13
-
DRF version: 3.13.1
-
Database: PostgreSQL, Redis
-
Vue version: Vue2
-
NodeJS version: 16.13.2
-
Clone the project
git clone https://github.com/adnan-alam/newsfeed_portal
-
Create a .env file inside the project directory and copy from env_example to .env and set the environment variables according to the needs.
-
Create a virtual environment named env with Python's venv:
python3.8 -m venv env
- Activate the virtual environment (For Ubuntu):
source env/bin/activate
- Activate the virtual environment (For Ubuntu):
-
Install all Python the dependencies
pip install -r requirements.txt
-
Run database migrations:
./manage.py migrate
-
Create Superuser:
./manage.py createsuperuser
need to provide the username, email and password.
-
Run the development server
./manage.py runserver
and the Django server will be available on
http://127.0.0.1:8000/
. -
Before fetching news, we need to populate the News sources from the
newsapi.org
. To populate the news sources, execute the command:./manage.py populate_news_sources
-
For task scheduling, huey Python package is being used. It has dependency of Redis, so it must be installed on the system. Run the consumer:
./manage.py run_huey
-
Go to frontend directory, install packages:
npm install
-
Run the development server:
npm run dev
frontend will be available on
http://127.0.0.1:8080/
.