{"id":19090312,"url":"https://github.com/jefedcreator/chirpr_api","last_synced_at":"2026-05-06T15:41:32.471Z","repository":{"id":61666234,"uuid":"551652448","full_name":"jefedcreator/chirpr_api","owner":"jefedcreator","description":"chirpr social","archived":false,"fork":false,"pushed_at":"2022-11-03T13:33:15.000Z","size":189,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-02T22:20:01.663Z","etag":null,"topics":["flask","python","twitter"],"latest_commit_sha":null,"homepage":"https://chirpr-api.herokuapp.com/swagger","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/jefedcreator.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}},"created_at":"2022-10-14T20:28:15.000Z","updated_at":"2022-11-03T13:36:49.000Z","dependencies_parsed_at":"2022-10-20T01:30:29.849Z","dependency_job_id":null,"html_url":"https://github.com/jefedcreator/chirpr_api","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/jefedcreator%2Fchirpr_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jefedcreator%2Fchirpr_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jefedcreator%2Fchirpr_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jefedcreator%2Fchirpr_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jefedcreator","download_url":"https://codeload.github.com/jefedcreator/chirpr_api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240136997,"owners_count":19753650,"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":["flask","python","twitter"],"created_at":"2024-11-09T03:04:10.485Z","updated_at":"2026-05-06T15:41:27.401Z","avatar_url":"https://github.com/jefedcreator.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chirpr_api\nA Twitter esque social media with search Bookmark functionality\n\n# Table of Contents\n[Intoduction](#Introduction) \n\n[Getting Started](#getting-started)\n\n[Development Setup](#development-setup)\n\n[API Walkthrough](#api-walkthrough)\n\n[Docker](#docker)\n\n[Testing](#testing)\n\n[Live](#live-server)\n\n## Introduction\nTwitter is a popular micro blogging social media where users can share tweets on their timeline, and also save particulat tweets theyre interested in a bookmarks section. but twitter requires users to keep scrolling in their bookmark sections whenever they're in need of a particular bookmarked tweet. Enter chirpr, chirpr aims to solve this UX problem by introducing searchable boomarks in every user's bookmark section, just by typing particular words in the search bar, bookmarked tweets are filtered by the typed keywords. \n\n### Entity Relationship Diagram\n![My Image](chirpr_api_edr.jpg)\n\n\n## Overview\n## Getting Started\n\n### Installing Dependencies\n\n#### Python 3.7\n\nFollow instructions to install the latest version of python for your platform in the [python docs](https://docs.python.org/3/using/unix.html#getting-and-installing-the-latest-version-of-python)\n\n#### Virtual Environment\n\nWe recommend working within a virtual environment whenever using Python for projects. This keeps your dependencies for each project separate and organized. Instructions for setting up a virtual environment for your platform can be found in the [python docs](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/)\n\n#### PIP Dependencies\n\nOnce you have your virtual environment setup and running, install dependencies by navigating to the `/chirpr_api` directory and running:\n\nbash\n```\npip install -r requirements.txt\n```\n##### Key Dependencies\n\n- [Flask](http://flask.pocoo.org/) is a lightweight backend microservices framework. Flask is required to handle requests and responses.\n\n- [SQLAlchemy](https://www.sqlalchemy.org/) and [Flask-SQLAlchemy](https://flask-sqlalchemy.palletsprojects.com/en/2.x/) are libraries to handle the lightweight sqlite database. \n\n## Development Setup\n### **Download the project starter code locally**\n```\ngit clone https://github.com/jefedcreator/chirpr_api.git\ncd chirpr_api/\n```\nThese are the files relevant for this project:\n```bash\n.\n\n├── models.py\n├── settings\n    ├── settings.py\n├── .venv\n├── .env\n├── README.md\n├── test.py\n├── app.py\n├── Procfile\n├── runtime.txt\n├── requirements.txt\n├── wsgi.py\n├── Dockerfile\n├── .gitignore\n\n```\n\n### **To comtribute to the upstream repository path from your local repository, use the commands below:**\n```\ngit remote add upstream https://github.com/jefedcreator/chirpr_api.git\ngit remote -v \ngit checkout -b \u003cbranch name\u003e\n```\nOnce you have finished editing your code, you can push the local repository to the Github repository using the following commands.\n```\ngit add . --all   \ngit commit -m \"your comment\"\ngit push -u origin \u003cbranch name\u003e\n```\n\n### **Initialize and activate a virtualenv using:**\n```\npython -m virtualenv env\nsource env/bin/activate\n```\n\u003e**Note** - In Windows, the `env` does not have a `bin` directory. Therefore, you'd use the analogous command shown below:\n```\nsource env/Scripts/activate\n```\n\n### **Install the dependencies:**\n```\npip install -r requirements.txt\n```\n\n### **Run the development server:**\n```\nexport FLASK_APP=myapp\nexport FLASK_ENV=development # enables debug mode\nflask run\n```\nTo run the server, execute:\n\n```bash\nflask run --reload\n```\n\nThe `--reload` flag will detect file changes and restart the server automatically.\n\nalternatively, run\n\n```bash\npython wsgi.py\n```\n\n### **Verify on the Browser**\u003cbr\u003e\nNavigate to project homepage [http://127.0.0.1:5000/](http://127.0.0.1:5000/) or [http://localhost:5000](http://localhost:5000) \n\n## API Walkthrough\n\n`GET '/api/users'`\n- Fetches a dictionary of all users in which the keys are the user ids and the value is the corresponding dictionary of the user  details\n- Request Arguments: None\n- Returns: An object with a two key,`success`, that contains a value of `True` if successful and `users`, that contains an object of `user_obj ` key: value pairs.\n\n```json\n{\n  \"success\" : \"True\",\n  \"users\": \"user_obj\"\n}\n```\n\n`POST '/api/users/create'`\n\nSends a post request in order to create a new user dictionary with user details\nRequest Body:\n\n```json\n{\n    \"id\": \"user id\",\n    \"name\": \"user name\",\n    \"url\": \"user url\",\n    \"tweets\": \"[]\",\n}\n```\n\nReturns: An object with a two key,`success`, that contains a value of `True` if successful and `users`, that contains an object of `user_obj ` key: value pairs.\n\n```json\n{\n    \n    \"success\" : \"True\",\n    \"users\": \"user_obj\"\n}\n```\n\n`POST '/api/login'`\n\nSends a post request in order to login an existing user, receives a json request with user details\nRequest Body:\n\n```json\n{\n    \"id\": \"user id\",\n    \"name\": \"user name\",\n}\n```\n\nReturns: An object with a key,`success`, that contains a value of `True` if successful, or `False` is user does not exist\n\n```json\n{\n    \n    \"success\" : \"True\",\n}\n```\n\n`GET '/api/users/${user_id}'`\n\nFetches entire user details, including tweets for a user specified by their id request argument\nRequest Arguments: id - string\nReturns: A list of objects with user details for the specified user, and a list of all user tweets\n\n```json\n{\n    \"success\": \"True\",\n    \"user\" : \"user_list\"\n}\n```\n\n`GET '/api/tweets'`\n\n- Fetches a dictionary of all tweets in which the keys are the tweet ids and the value is the corresponding dictionary of the tweet  details\n- Request Arguments: None\n- Returns: An object with a two key,`success`, that contains a value of `True` if successful and `tweets`, that contains an object of `tweets ` key: value pairs.\n\n```json\n{\n  \"success\" : \"True\",\n  \"users\": \"all_tweets\"\n}\n```\n\n`POST '/api/tweets/create'`\n\nSends a post request in order to create a new tweet dictionary with tweet details\nRequest Body:\n\n```json\n{\n    \"id\": \"tweet id\",\n    \"text\": \"tweet text\",\n    \"author\": \"tweet author\",\n    \"timestamp\": \"123\",\n    \"likes\": \"[]\",\n    \"replies\": \"[]\",\n    \"replying_to\": \"\"\n}\n```\n\nReturns: An object with a two key,`success`, that contains a value of `True` if successful and `tweets`, that contains an object of `all_tweets ` key: value pairs.\n\n```json\n{\n    \n    \"success\" : \"True\",\n    \"tweets\": \"all_tweets\"\n}\n```\n\n`GET '/api/tweets/${tweet_id}'`\n\nFetches entire tweet details, including tweets for a user specified by their id request argument\nRequest Arguments: id - string\nReturns: A list of objects with tweet details for the specified tweet id\n\n```json\n{\n    \"success\": \"True\",\n    \"user\" : \"tweet_list\"\n}\n```\n\n`PATCH '/api/tweets/${tweet_id}'`\n\nModifies the `likes` and `replies` column specified by the `tweet_id`. this request checks if a `user's likes` already exists within the likes array and pops it, else appends to it.\nthis request also checks if a `user's replies` already exists within the replies array and pops it, else appends to it.\nthis request also checks if a tweet is a reply to another tweet to it, else null.\n\nRequest Body:\n\n```json\n{\n    \"likes\": \"user id\",\n    \"replies\": \"user replies\",\n    \"replying_to\": \"tweet id\"\n}\n```\n\n`GET '/api/bookmarks/user_id'`\n- Fetches a dictionary of all bookmarks in which the keys are the bookmarks ids and the value is the corresponding dictionary of the bookmark details\n- Request Arguments: None\n- Returns: An object with a two key,`success`, that contains a value of `True` if successful and `bookmarks`, that contains an object of `bookmarks ` key: value pairs.\n\n```json\n{\n  \"success\" : \"True\",\n  \"tweets\": \"all_bookmarks\"\n}\n```\n\n`POST '/api/bookmarks/create'`\n\nSends a post request in order to create a new bookmark dictionary with tweet details\nRequest Body:\n\n```json\n{\n    \"id\": \"bookmark id\",\n    \"text\": \"bookmark text\",\n    \"author\": \"bookmark author\",\n    \"timestamp\": \"123\",\n    \"likes\": \"[]\",\n    \"replies\": \"[]\",\n    \"replying_to\": \"\"\n}\n```\n\nReturns: An object with a two key,`success`, that contains a value of `True` if successful and `tweets`, that contains an object of `all_tweets ` key: value pairs.\n\n```json\n{\n    \n    \"success\" : \"True\",\n    \"tweets\": \"all_bookmarks\"\n}\n```\n\n`GET '/api/bookmark/${bookmark_id}'`\n\nFetches entire bookmark details, including bookmarks for a user specified by their id request argument\nRequest Arguments: id - string\nReturns: A list of objects with tweet details for the specified bookmark id\n\n```json\n{\n    \"success\": \"True\",\n    \"tweets\": \"bookmark_list\"\n}\n```\n\n`DELETE '/api/bookmark/${bookmark_id}'`\n\ndeletes entire bookmark details, including bookmarks for a user specified by their id request argument\nRequest Arguments: id - string\nReturns: `success` with value of `True`\n\n```json\n{\n    \"success\": \"True\"\n}\n```\n\n`POST '/api/bookmarks/search'`\n\nReceives a json request `search_term` and filters the Bookmark database, and returns a list of Bookmarks containing `id` and `text` object that match specified request\n\n```json\n{\n    \"success\": \"True\",\n    \"bookmarks\": \"bookmarks\"\n}\n```\n\n## Docker\nAfter cloning, Navigate to the `chirpr_api` folder\n```bash\ncd chirpr_api\n``` \nOpen the VS code editor to display the file content\n\n```bash\ncode .\n```\n\nBuild an image\n\n```bash\ndocker build -t chirprapi .\n\n```\ncheck list of images\n\n```bash\ndocker image ls\n\n```\n\nCreate and run a container\n\n```bash\ndocker run --name chirprapi -p 80:8080 chirprapi\n\n```\n\nAccess the application\n\n```bash\n# Mac/Linux users only\ncurl http://0.0.0.0/\n# Windows users using WSL/GitBash\ncurl http://127.0.0.1:80/\n```\n\n## Testing\n```bash\n\npython test.py\n```\n\n## Live server\n\n\u003cb\u003e[chirpr](https://chirpr-api.herokuapp.com/swagger)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjefedcreator%2Fchirpr_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjefedcreator%2Fchirpr_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjefedcreator%2Fchirpr_api/lists"}