This project is a web application developed using Django and Django REST Framework. It includes a web scraper built with Scrapy to crawl and store news articles from Zoomit.
This project utilizes the following technologies:
- Django: A high-level Python web framework that encourages rapid development and clean, pragmatic design.
- Django REST Framework: A powerful and flexible toolkit for building Web APIs in Django.
- PostgreSQL: A powerful, open-source relational database system.
- Scrapy: An open-source and collaborative web crawling framework for Python.
- RabbitMQ: A message broker that your applications can use to send and receive messages.
- Celery: An asynchronous task queue/job queue based on distributed message passing, used with RabbitMQ.
- Nginx: A high-performance web server and reverse proxy.
- Docker: A platform for developing, shipping, and running applications in isolated containers.
Before you begin, ensure you have met the following requirements:
- Docker installed on your machine.
- Docker Compose installed on your machine.
- Basic knowledge of Docker and Docker Compose.
First, clone the repository to your local machine:
git clone https://github.com/MatinHosseinianFard/NewsAPI.git
cd NewsAPI/
Build the Docker images and start the containers with Docker Compose:
docker-compose up -d --build
This command will:
Build the Docker images as specified in the Dockerfile
.
Start the containers as defined in the docker-compose.yml
file.
docker-compose exec -it app
Then:
python manage.py createsuperuser
The application will be available at http://localhost:8000.
The Django admin interface can be accessed at http://localhost:8000/admin.
http://localhost/api/news?tags__name=
Celery Flower, a real-time monitoring tool for Celery, is available at:
http://localhost:5556
Below is a visual representation of the project structure:
To stop and remove the containers, run:
docker-compose down
Port Conflicts: Ensure that the ports specified in docker-compose.yml are not already in use by other applications.
Logs: To view logs for debugging, use:
docker-compose logs [service-name]
Environment Issues: Make sure all required environment variables are correctly set in the .env file.
This project is licensed under the MIT License.
For any questions or support, please reach out to [email protected].