{"id":16454719,"url":"https://github.com/bolajiolajide/headlineapi","last_synced_at":"2025-08-11T18:19:26.926Z","repository":{"id":88782048,"uuid":"98830508","full_name":"BolajiOlajide/HeadlineAPI","owner":"BolajiOlajide","description":"API for headline","archived":false,"fork":false,"pushed_at":"2017-10-11T11:29:19.000Z","size":97,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-01-09T17:55:12.526Z","etag":null,"topics":["api","headline","scraping","web","web-scraping"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/BolajiOlajide.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":"2017-07-30T23:23:17.000Z","updated_at":"2019-04-29T08:58:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"90c4c7ef-2286-409d-b1ac-dfc7770e8158","html_url":"https://github.com/BolajiOlajide/HeadlineAPI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BolajiOlajide%2FHeadlineAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BolajiOlajide%2FHeadlineAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BolajiOlajide%2FHeadlineAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BolajiOlajide%2FHeadlineAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BolajiOlajide","download_url":"https://codeload.github.com/BolajiOlajide/HeadlineAPI/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240943213,"owners_count":19882369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api","headline","scraping","web","web-scraping"],"created_at":"2024-10-11T10:19:47.916Z","updated_at":"2025-02-26T22:24:28.819Z","avatar_url":"https://github.com/BolajiOlajide.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HeadlineAPI\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![CircleCI](https://circleci.com/gh/BolajiOlajide/HeadlineAPI.svg?style=svg)](https://circleci.com/gh/BolajiOlajide/HeadlineAPI)\n\nThis repository contains an API for the mobile application: `HEADLINE`. `HEADLINE` is an iOS (should be coming to Android anytime soon) that helps you get relevant news and happenings from top nigerian websites.\n\n## Development\nThis application was developed using [Flask](http://flask.pocoo.org/). Postgres was used for persisting data with [SQLAlchemy](https://www.sqlalchemy.org/) as [ORM](https://en.wikipedia.org/wiki/Object-relational_mapping).\n\n### Development - Docker\nDevelopment with docker has been made simple. To get started make sure you have [docker](https://www.docker.com/) on your PC. You can download it [here](https://www.docker.com/).\nFollow the following steps carefully to set the project up:\n- Create a `.env` using the `.env.sample` file.\n- Run the command `docker-compose up` to let the docker daemon start building the image and create the container.\n- When you're done, use the command `docker-compose down` or `Ctrl + C` to stop the container.\n\n## Application Features\n###### User Authentication\nUsers are authenticated and validated using an `werkzeug` token. Generating tokens on login ensures each account is unique to a user and can't be accessed by an authenticated user.\n\n## Installation\n* Start up your terminal (or Command Prompt on Windows OS).\n* Ensure that you've `python` installed on your PC.\n* Clone the repository by entering the command `git clone https://github.com/BolajiOlajide/HeadLineAPI` in the terminal.\n* Navigate to the project folder using `cd HeadLineAPI` on your terminal (or command prompt)\n* After cloning, create a virtual environment then install the requirements with the command:\n`pip install -r requirements.txt`.\n* Create a `.env` file in your root directory as described in `.env.sample` file. Variables such as DATABASE_URL and config are defined in the .env file and it is essential you create this file before running the application.\n```\nFLASK_CONFIG='default'\nDATABASE_URI='database connection to be used'\nSECRET_KEY='random string used for generating token'\nTEST_DB='database to be used for testing'\nSERVER_NAME='server in which app is being tested: `localhost:5000` works.'\n\n- Docker Variables\nDB_USER=postgres\nDB_PASS=postgres\nDB_SERVICE=postgres\nDB_PORT=5432\nDB_NAME=postgres\n```\n* After this, you'll need to migrate data schema to the database using the command: `python manage.py create_db`.\n\n## Usage\n* A customized interactive python shell can be accessed by passing the command `python manage.py shell` on your terminal.\n* Once this is done, the application can be started using `python manage.py runserver` and by default the application can be accessed at `http://127.0.0.1:5000` or `gunicorn manage:app` which starts the application using port `8000`. The application starts using the configuration settings defined in your .env file.\n\n## Configuration\nThe API currently has 4 different configuration which can be defined in the .env file.\n- `production`: this configuration starts the app ready for production to be deployed on any cloud application platform such as Heroku, AWS etc.\n- `development`: this configuration starts the application in the development mode.\n- `testing`: this configuration starts the application in a testing mode.\n- `default`: this is the same as the development configuration.\n\n## API Documentation\n-----\nThe API has routes, each dedicated to a single task that uses HTTP response codes to indicate API status and errors.\n\n### API Features\n\nThe following features make up the BucketList API:\n\n#### Authentication\n-   It uses itsdangerous-Serializer \u0026 werkzeug token for authentication.\n\n-   It generates a token on successful login and returns it to the user.\n\n-   It verifies the token to ensures a user is authenticated to access protected endpoints.\n\n#### Users\n\n-   It allows users to be created.\n\n-   It allows users to login and obtain a token\n\n-   It allows authenticated users to retrieve and update their information.\n\n### API Resource Endpoints\n\nURL Prefix = `http://sample_domain/` where sample domain is the root URL of the server HOST.\n\n\n| EndPoint                                 | Functionality                 | Public Access|\n| -----------------------------------------|:-----------------------------:|-------------:|\n| **POST** /auth/register                  | Register a user               |    TRUE      |\n| **POST** /auth/login                     | Logs a user in                |    TRUE      |\n\n\n### Authentication\n#### POST HTTP Request\n-   `POST /auth/login`\nINPUT:\n```json\n{\n  \"username\":\"username\",\n  \"password\":\"password\"\n}\n```\n\n###### HTTP Response\n-   HTTP Status: `200: OK`\nJSON data\n```json\n{\n  \"token\": \"edasdnmdsakmkEcR4Ardmfsdamfkjdsjlasnfh)__QWEh\"\n}\n```\n\n#### POST HTTP Request\n-   `POST /auth/register`\nINPUT:\n```json\n{\n  \"username\":\"username\",\n  \"password\":\"password\"\n}\n```\n\n###### HTTP Response\n-   HTTP Status: `201: created`\nJSON data\n```json\n{\n  \"username\": \"test_user\"\n}\n```\n\n### Author\n- [Bolaji Olajide](https://twitter.com/Bolaji___)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbolajiolajide%2Fheadlineapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbolajiolajide%2Fheadlineapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbolajiolajide%2Fheadlineapi/lists"}