Hackernews clone that sync with the hackernews website
- Python 3.9: Base programming language for development
- Bash Scripting : Create convenient script for easy development experience
- PostgreSQL: Application relational databases for development, staging and production environments
- Django Framework: Development framework used for the application
- Django Rest Framework : Provides API development tools for easy API development
- Celery: A simple, flexible, and reliable distributed system to process vast amounts of tasks
- Django Celery Beat: A Database Period task scheduler
- Flower: A web based tool for monitoring and administrating Celery clusters.
- Redis: A NoSQL Database that serves as a Celery Broker and Result Backend
- Aiohttp: An Asynchronous HTTP Client/Server for asyncio and Python.
- MailHog: MailHog is an email testing tool for developers
- Sphinx: Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python projects
- Github Actions : Continuous Integration and Deployment
- Docker Engine and Docker Compose : Containerization of the application and services orchestration
-
Clone the Repository
-
Run
docker-compose -f local.yml build
- Running the above command for the first time will download all docker-images and third party packages needed for the app.
- NB: This will take several minutes for the first built, others will be in a blink of an eye
-
Run
docker-compose -f local.yml up
- Running the above command will Start up the following Servers:
- Postgres Server --> http://localhost:5432
- Django Development Server --> http://localhost:8000
- Redis Server --> http://localhost:6379
- Flower --> http://localhost:5555
- MailHog --> http://localhost:8025
- Sphinx Docs --> http://localhost:7000
- Running the above command will Start up the following Servers:
-
Run Migrations
docker-compose -f local.yml exec django python3 manage.py makemigrations
-
Run Migrate
docker-compose exec django python3 manage.py migrate
Make sure that all the above servers are running before you start exploring the project. If those servers are up and running, have fun with the app!!!
You can explore the Hackernews App by going to http://localhost:8000
on your browser. You will be able to see the following features
- View list of paginated latest hackersnews
- Filter hackernews by type:
story
,job
andpoll
- Search hackernews by text
- View News Details page with Comments
- Sign up
- Login
- Forgot and Reset password
- Login to Django Admin on
http://localhost:8000/admin
You can explore the Hackernews App by going to http://localhost:8000/api
on your browser. The following endpoints are accessible
- GET News -->
http://localhost:8000/api/news/
- GET Paginated news -->
http://localhost:8000/api/news/?limit=10&offset=10
- GET Filtered news by type
- For story --> http://localhost:8000/api/news/?type=story
- For poll --> http://localhost:8000/api/news/?type=poll
- For job --> http://localhost:8000/api/news/?type=job
- POST News -->
http://localhost:8000/api
- PUT News -->
http://localhost:8000/api
if only created by user - DELETE News -->
http://localhost:8000/api
if only created by user
You can also monitor and administer Hackernews Background Job with flower. Go to http://localhost:5555
on your browser.
Login with username: debug
and password: debug
You can visit http://localhost:7000
to read the Sphinx auto generated documentation