# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['the_social_network',
 'the_social_network.migrations',
 'the_social_network.serializers',
 'the_social_network.urls',
 'the_social_network.views']

package_data = \
{'': ['*']}

install_requires = \
['Django>=3.2.9,<4.0.0',
 'Pillow>=8.4.0,<9.0.0',
 'djangorestframework>=3.12.4,<4.0.0']

setup_kwargs = {
    'name': 'the-social-network',
    'version': '0.0.6',
    'description': 'Basic social network core.',
    'long_description': '# The Social Network\n\nThe package "The Social Network" is a django base backend core element for any possible social network you can think of. You can easily create clones for all popular social networks. \n\n## Installation\nMinimum requierments are:\n\n> [Python](https://www.python.org/downloads/) >= 3.9  \n> [Django](https://pypi.org/project/Django/) >= 3.2.9  \n> [Pillow](https://pypi.org/project/Pillow/) >= 8.4.0  \n> [djangorestframework](https://pypi.org/project/djangorestframework/) >= 3.12.4\n\nIntallation can be done by **pip** like\n\n> pip install the-social-network\n\nor download manuel on [Pypi](https://pypi.org/project/the-social-network/).\n\n## How to use\n\nIf you not have already created a django python project, [create](https://docs.djangoproject.com/en/3.2/intro/tutorial01/) it at first in a new directory with the command\n\n> django-admin startproject mysite\n\nThis will create a **mysite** directory in your current directory.\n\nOpen the **mysite** directory and open the **settings.py**.\nAdd *\'the_social_network\'* to **INSTALLED_APPS** and save the file.\n\nNext open the urls.py and add the following lines to your **urlpatterns**\n\n> url(r\'^authentication/\', include(\'the_social_network.urls.authenticationUrls\')),  \n> url(r\'^accounts/\', include(\'the_social_network.urls.accountUrls\')),  \n> url(r\'^search/\', include(\'the_social_network.urls.searchUrls\')),  \n> url(r\'^contents/\', include(\'the_social_network.urls.contentUrls\'))\n\nNow everything is ready to run django with **the-social-network**.\nCreate the database with\n> python manage.py migrate\n\nand start the server with\n> python manage.py runserver\n\nthe default django information page should showup if you open [http://127.0.0.1:8000/](http://127.0.0.1:8000/) in your browser.\n\n## Request API for the URLs\n\nIn all requests (except for the request of *authentication/register/* or */authentication/login/*) you need to send the authentification token inside the header.\nFor authorization use the header name "Authorization" and the value "Token <token>"\n\n#### Authentication\n##### POST url: ".../authentication/register/"\nRegister a user  \n\nRequestbody:  \n```json\n{  \n    "username": "username",  \n    "password": "password",  \n    "email": "email"  \n} \n``` \nResponsebody:  \n```json\n{  \n    "token": "token"  \n}  \n```\n\n##### POST url: ".../authentication/login/"\nLogin a user  \n\nRequestbody:  \n```json\n{  \n    "username": "username",  \n    "password": "password"  \n}  \n```\nResponsebody:  \n```json\n{  \n    "token": "token"  \n}  \n```\n\n##### POST url: ".../authentication/logout/"\nLogout a user  \n\nRequestbody: None  \nResponsebody: None  \nSuccess: HTTP/200  \n\n##### GET url: ".../authentication/validate/"\nValidate a token  \n\nRequestbody: None  \nResponsebody: None  \nSuccess: HTTP/200  \n\n#### Account\n##### GET url: ".../accounts/show/<user_id>/"\nShow a public user  \n\nRequestbody: None  \nResponsebody:  \n```json\n[{  \n    "user": {  \n        "id": ...,  \n        "username": ...,  \n        "email": ...,  \n        "date_joined": "..."  \n    },  \n    "image": "...",  \n    "biography": "...",  \n    "related_by": [],  \n    "related_to": [],  \n    "statements": []  \n}]  \n```\n\n\n##### GET url: ".../accounts/show/own/"\nShow the own user  \n\nRequestbody: None  \nResponsebody:  \n```json\n[{  \n    "user": {  \n        "id": ...,  \n        "username": ...,  \n        "email": ...,  \n        "date_joined": "..."  \n    },  \n    "image": "...",  \n    "biography": "...",  \n    "related_by": [],  \n    "related_to": [],  \n    "statements": []  \n}]  \n```\n\n##### GET url: ".../accounts/show/all/"\nShow all public users  \n\nRequestbody: None  \nResponsebody:  \n```json\n[{  \n    "user": {  \n        "id": ...,  \n        "username": ...,  \n        "email": ...,  \n        "date_joined": "..."  \n    },  \n    "image": "...",  \n    "biography": "...",  \n    "related_by": [],  \n    "related_to": [],  \n    "statements": []  \n},  \n...  \n]  \n```\n\n##### PUT url: ".../accounts/update/"\nUpdates the own account. Only "Biography" and "Image" are allowed to be updated.  \n\nRequestbody:  \n```json\n{  \n    "biography": "...",  \n    "file": "..."  \n}  \n```\nResponsebody: None  \nSuccess: HTTP/200  \n\n##### PUT url: ".../accounts/follow/<user_id>/"\nFollow a user  \n\nRequestbody: None  \nResponsebody: None  \nSuccess: HTTP/200  \n\n##### PUT url: ".../accounts/unfollow/<user_id>/"\nUnfollow a user  \n\nRequestbody: None  \nResponsebody: None  \nSuccess: HTTP/200  \n\n##### PUT url: ".../accounts/operation/add/statement/"\nAdd a statement to the own account  \n\nRequestbody:  \n```json\n{  \n    "input": "<statement>"  \n    "reactions": { "to": <reaction_to_a_statement_id>, "relation": <"attack" or "support">}   <--- optional  \n}  \n```\nResponsebody:  \n```json\n{  \n    "id": ...,  \n    "author": {  \n        "user": {  \n            "id": ...,  \n            "username": "..."  \n        },  \n        "image": "..."  \n    },  \n    "content": "...",  \n    "tagged": [],  \n    "mentioned": [],  \n    "created": "...",  \n    "relation_to_parent": ...  \n}  \n```\nSuccess: HTTP/200  \n\n#### Contents\n##### GET url: ".../contents/statements/get/<statement_id>/"\nGet a statement  \n\nRequestbody: None  \nResponsebody:  \n```json\n[  \n    {  \n        "id": ...,  \n        "author": {  \n            "user": {  \n                "id": ...,  \n                "username": "..."  \n            },  \n            "image": "..."  \n        },  \n        "content": "...",  \n        "tagged": [],  \n        "mentioned": [],  \n        "created": "...",  \n        "relation_to_parent": ...,  \n        "reactions": []  \n    }  \n]  \n```\n\n##### GET url: ".../contents/statements/with/hashtag/"\nGet all statements with a hashtag  \n\nRequestbody: None  \nQueryparameters: "?q=<hashtag>"  \nResponsebody:  \n```json\n[  \n    {  \n        "id": ...,  \n        "author": {  \n            "user": {  \n                "id": ...,  \n                "username": "..."  \n            },  \n            "image": "..."  \n        },  \n        "content": "...",  \n        "tagged": [],  \n        "mentioned": [],  \n        "created": "...",  \n        "relation_to_parent": ...,  \n        "reactions": []  \n    },  \n    ...  \n]  \n```\n\n##### GET url: ".../contents/statements/feed/"\nGet all statements of the accounts that are followed by the user  \n\nRequestbody: None  \nResponsebody:  \n```json\n[  \n    {  \n        "id": ...,  \n        "author": {  \n            "user": {  \n                "id": ...,  \n                "username": "..."  \n            },  \n            "image": "..."  \n        },  \n        "content": "...",  \n        "tagged": [],  \n        "mentioned": [],  \n        "created": "...",  \n        "relation_to_parent": ...,  \n        "reactions": []  \n    },  \n    ...  \n]  \n```\n\n##### GET url: ".../contents/statements/feed/pagination"\nGet statements of the accounts that are followed by the user  \n\nRequestbody: None  \nQueryparameters: "?page=<page_number>&size=<number_of_statements_per_page>"\nResponsebody:  \n```json\n{\n    "total": ...,  \n    "data": [  \n        {  \n            "id": ...,  \n            "author": {  \n                "user": {  \n                    "id": ...,  \n                    "username": "..."  \n                },  \n                "image": "..."  \n            },  \n            "content": "...",  \n            "tagged": [],  \n            "mentioned": [],  \n            "created": "...",  \n            "relation_to_parent": ...,  \n            "reactions": []  \n        },  \n        ...  \n    ]  \n}  \n```\n\n##### GET url: ".../contents/trending/hashtag/"\nGet all trending hashtags which are most used in statements  \n\nRequestbody: None  \nReponsebody: ++++++ TODO:  Setting of a hashtag not clear ++++++  \n\n\n#### Search\n##### GET url: ".../search/"\nSearchs for a user or hashtag  \n\nRequestbody: None  \nQueryparameters: "?q=<search_query>&filter=<"user" or "hashtag">"  \nResponsebody:  \n```json\n{  \n    "accounts": [  \n                    {  \n                    "user": {  \n                        "id": ...,  \n                        "username": "...",  \n                        },  \n                    "image": "..."  \n                    },  \n                    ...  \n    ],  \n    "hashtags": [  \n                    {  \n                    "id": ...,  \n                    "tag": "..."  \n                    },  \n                    ...  \n    ]  \n}  \n```\n\n## Core Database structure\n\nThe project requieres the base authentication database structure from django and extends it with the following tables:  \n\n#### the_social_network_account\n    with  \n    user_id: int as primary key and foreign key to django auth_user  \n    image: varchar(100)  \n    biography: varchar(1000)  \n\n#### the_social_network_statement\n    with  \n    id: int as primary key  \n    author_id: int as foreign key to the_social_network_account  \n    content: varchar(120)  \n    created: datetime  \n\n#### the_social_network_accounttagging\n    with  \n    id: int as primary key  \n    created: datetime  \n    account_id: int as foreign key to the_social_network_account  \n    statement_id: int as foreign key to the_social_network_statement  \n\n#### the_social_network_hashtag\n    with  \n    id: int as primary key  \n    tag: varchar(30)  \n    created: datetime  \n\n#### the_social_network_hashtagtagging\n    with  \n    id: int as primary key  \n    created: datetime  \n    hashtag_id: int as foreign key to the_social_network_hashtag  \n    statement_id: int as foreign key to the_social_network_statement  \n\n#### the_social_network_reaction\n    with  \n    id: int as primary key  \n    created: datetime  \n    vote: small uint  \n    child_id: int as foreign key to the_social_network_statement  \n    parent_id: int as foreign key to the_social_network_statement  \n\n#### the_social_network_relationship\n    with  \n    id: int as primary key  \n    created: datetime  \n    from_account_id: int as foreign key to the_social_network_account  \n    to_account_id: int as foreign key to the_social_network_account  \n',
    'author': 'Marc Feger',
    'author_email': 'marc.feger@hhu.de',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://gitlab.cs.uni-duesseldorf.de/feger/the-social-network',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.9,<4.0',
}


setup(**setup_kwargs)
