{"id":21339610,"url":"https://github.com/jibril14/news-hub","last_synced_at":"2026-04-11T13:33:36.682Z","repository":{"id":83149759,"uuid":"587659218","full_name":"Jibril14/News-Hub","owner":"Jibril14","description":"Django React web application, A suitable MVP for a News Outlet.","archived":false,"fork":false,"pushed_at":"2023-04-16T12:51:30.000Z","size":5006,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T02:47:14.966Z","etag":null,"topics":["django","django-rest-framework","jwt-authentication","postgresql","react-router","reactjs","redux-toolkit","restful-api","smtp-server"],"latest_commit_sha":null,"homepage":"https://news-hub-env-2f47.up.railway.app/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jibril14.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-11T09:24:47.000Z","updated_at":"2023-02-25T21:22:17.000Z","dependencies_parsed_at":"2025-03-16T02:40:35.286Z","dependency_job_id":"7cadcb9f-b7b1-4e8a-b14d-35dd8afb79b1","html_url":"https://github.com/Jibril14/News-Hub","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jibril14/News-Hub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jibril14%2FNews-Hub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jibril14%2FNews-Hub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jibril14%2FNews-Hub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jibril14%2FNews-Hub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jibril14","download_url":"https://codeload.github.com/Jibril14/News-Hub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jibril14%2FNews-Hub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31682953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","django-rest-framework","jwt-authentication","postgresql","react-router","reactjs","redux-toolkit","restful-api","smtp-server"],"created_at":"2024-11-22T00:46:44.706Z","updated_at":"2026-04-11T13:33:36.677Z","avatar_url":"https://github.com/Jibril14.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# News Hub\n\nThis is a Django-React web application that allows users to create, read and edit posts.The home\npage will list all posted news from the backend, the detail page is reserved for each individual post. It also provides search and filtering functionality through API endpoints,\n\nNews Hub uses django and django rest framework for it backend and React.js as client side for fetching Api endpoints, and both served on the same server and port!\n\n\n![NewsHub](sample/sample1.png)\n\n![NewsHub](sample/sample2.png)\n\n\n### Live Demo On\n\nhttps://news-hub-env-2f47.up.railway.app/\nor\nhttps://news-hub.onrender.com/\n\n\n## Technologies \n\nThe following technologies were used for this project:\n\n- [HTML]\n- [CSS]\n- [Python]\n- [Django]\n- [Django REST Framework]\n- [PostgresSQL]\n- [React.js]\n- [Material Ui]\n- [Redux]\n\n\n## Running this App\n\nBefore Running this app, you need to have [Git](https://git-scm.com), [Python](https://www.python.org/) and [Node.js](https://nodejs.org/), installed.\n\n## Clone the app\n* `fork` and `clone` this repository.\n\nSwitch to project directory before running the below commands.\n\n## Frontend Setup\n\n\n* `cd` frontend in the project root.\n* Run `npm install` to fetch the frontend dependencies.\n* Run `npm start` to spin up a development server.\n* Run `npm run build` to create a production build of frontend.\n\n## Backend Setup\n\n### Create a virtual environment\n\n    python3 -m venv env\n\n### Activate the virtual environment\n\n    env/bin/activate\n\n### Install dependencies\n\n    pip install -r requirements.txt\n\n### Configure Postgres\n\n    configure postgres database\n\n### Make migrations\n\n    python manage.py makemigrations\n\n### Migrate apps and database\n\n    python manage.py migrate\n\n### Collect Static files\n\n    python manage.py collectstatic\n\n### Run Tests\n\n    python manage.py test\n\n### Start server\n  \n    python manage.py runserver\n\n\n\n## Features\n\n - **RESTful Api** - It follows Rest architectural style\n - **JSON Web Token -JWT** - Secure data transmission b/w this app and it users\n - **Unit Testing -Pytest** - Manually test each component to ensure it works correctly\n - **Token base authentication - Djoser** - Provides basic view for auth actions\n - **SMTP Email Server -** Email Delivery and Communication for sending and receiving email\n - **Powerful DB Queries- Filtring, Search** - This app provides refine search results of model to user\n - **React - Router** - Provide easy navigation for this app without refreshing the page\n - **Redux Toolkit** - A central store that provide easy access to data across all components\n\n\n\n## Exploring Some endpoints Locally\n\nRun below codes in the terminal or use any api client such as postman.\n\n## Endpoints\n\nThe endpoints, expected payloads, and responses are described below.\n\n\n## Get all news items \n\n### Request\n\n`GET api/v1/posts/`\n\n    curl -i -H 'Accept: application/json' http://127.0.0.1:8080/api/v1/posts/ \n \n### Server Response\n\n\n    {\n        \"count\": 2,\n        \"next\": \"http://127.0.0.1:8000/api/v1/posts/?page=2\",\n        \"previous\": null,\n        \"results\": [\n            {\n                \"title\": \"Lorem ipsum dolor sit amet, consectetur adipisicing\",\n                \"slug\": \"lorem-ipsum-dolor-sit-amet-consectetur-adipisicing\",\n                \"photo1\": \"http://127.0.0.1:8000/media/madama-potkin-cxnkcRnwS7M_Copy.jpg\",\n                \"photo2\": \"http://127.0.0.1:8000/media/sample.png\",\n                \"photo3\": \"http://127.0.0.1:8000/media/sample.png\",\n                \"excerpt\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit.\",\n                \"content\": \" \"content\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. In recusandae sit eligendi vitae corporis nemo, ullam perferendis, velit qui fugiat harum cumque voluptate, repellendus provident. Repudiandae dolorum dolore tempora magni?\",\n                \"views\": 1,\n                \"date_created\":\"2022-09-258T23:02:24.516803\",\n                \"last_updated\": \"2022-09-258T23:02:24.516803\",\n                \"author\": \"Admin\",\n                \"category\": \"Sport\",\n                \"comments\": [\n                    {\n                        \"user_name\": \"Admin\",\n                        \"text\": \"Lorem Ipsum\",\n                        \"post\": 6\n                    },\n                    {\n                        \"user_name\": \"wasoln\",\n                        \"text\": \"was\",\n                        \"post\": 6\n                    },\n                    {\n                        \"user_name\": \"wasoln\",\n                        \"text\": \"Lorem Ipsum\",\n                        \"post\": 6\n                    }\n                ]\n            },\n            {\n                \"title\": \"Rorem ipsum dolor sit amet, consectetur adipisicing\",\n                \"slug\": \"rorem-ipsum-dolor-sit-amet-consectetur-adipisicing\",\n                \"photo1\": \"http://127.0.0.1:8000/media/sample2.jpg\",\n                \"photo2\": \"http://127.0.0.1:8000/media/andw-nsplash.jpg\",\n                \"photo3\": \"http://127.0.0.1:8000/media/sample.png\",\n                \"excerpt\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit.\",\n                \"content\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. In recusandae sit eligendi vitae corporis nemo, ullam perferendis, velit qui fugiat harum cumque voluptate, repellendus provident. Repudiandae dolorum dolore tempora magni?\",\n                \"views\": 1,\n                \"date_created\": \"2022-09-258T23:02:34.516803\",\n                \"last_updated\": \"2022-09-258T23:02:34.516803\",\n                \"author\": \"Admin\",\n                \"category\": \"Tech\",\n                \"comments\": []\n            }\n        ]\n    }\n\n\n\n\n## Get Posts by Category\n\n### Request\n\n`GET /api/v1/posts/?post_category=tech`\n\n    curl -i -H 'Accept: application/json'  http://127.0.0.1:8000/api/v1/posts/?post_category=tech/\n\n### Payload\n\n    {\n        \"query param\": \u003cString\u003e,\n        \"category type\": \u003cString\u003e,   \n    }\n\n### Server Response\n\n    {\n        \"count\": 1,\n        \"next\": \"http://127.0.0.1:8000/api/v1/posts/?page=2\",\n        \"previous\": null,\n        \"results\": [\n            {\n                \"title\": \"Lorem ipsum dolor sit amet, consectetur adipisicing\",\n                \"slug\": \"lorem-ipsum-dolor-sit-amet-consectetur-adipisicing\",\n                \"photo1\": \"http://127.0.0.1:8000/media/madama-potkin-cxnkcRnwS7M_Copy.jpg\",\n                \"photo2\": \"http://127.0.0.1:8000/media/sample.png\",\n                \"photo3\": \"http://127.0.0.1:8000/media/sample.png\",\n                \"excerpt\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit.\",\n                \"content\": \" \"content\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. In recusandae sit eligendi vitae corporis nemo, ullam perferendis, velit qui fugiat harum cumque voluptate, repellendus provident. Repudiandae dolorum dolore tempora magni?\",\n                \"views\": 1,\n                \"date_created\":\"2022-09-258T23:02:24.516803\",\n                \"last_updated\": \"2022-09-258T23:02:24.516803\",\n                \"author\": \"Admin\",\n                \"category\": \"Tech\",\n                \"comments\": [\n                    {\n                        \"user_name\": \"Admin\",\n                        \"text\": \"Lorem Ipsum\",\n                        \"post\": 6\n                    },\n                    {\n                        \"user_name\": \"wasoln\",\n                        \"text\": \"was\",\n                        \"post\": 6\n                    },\n                    {\n                        \"user_name\": \"wasoln\",\n                        \"text\": \"Lorem Ipsum\",\n                        \"post\": 6\n                    }\n                ]\n            },\n\n\n\n## Create a user\n\n### Request\n\n`POST api/v1/auth/users/`\n\n    curl -i -H 'Accept: application/json'  http://127.0.0.1:8000/api/v1/auth/users/\n\n### Payload\n\n    {\n        \"username\": \u003cString\u003e,\n        \"first_name\": \u003cString\u003e,\n        \"last_name\": \u003cString\u003e,\n        \"password\": \u003cString\u003e,\n        \"re_password\": \u003cString\u003e\n    }\n\n### Server Response\n\n    {\n        \"access_token\": \u003cString\u003e,\n        \"refresh_token\": \u003cString\u003e,\n    }\n\n\n\n## Activate a user\n\n### Request\n\n`POST api/v1/auth/users/activation/`\n\n    curl -i -H 'Accept: application/json'  http://127.0.0.1:8000/api/v1/auth/users/activation/\n\n### Payload\n\n    {\n        \"uid\": \u003cString\u003e,\n        \"token\": \u003cString\u003e,   \n    }\n\n### Server Response\n\n    status 200 ok\n\n\n\n## Other Endpoints\n\n`POST /api/v1/comment/post/\u003cpost-slug\u003e/`\n\n`GET /api/v1/post/\u003cstr:slug\u003e/`\n\n`GET /api/v1/posts/?post_category=tech`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjibril14%2Fnews-hub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjibril14%2Fnews-hub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjibril14%2Fnews-hub/lists"}