<commit_before>[![Heroku](http://heroku-badge.herokuapp.com/?app=tarina&style=flat&root=/static/images/default.jpg)](https://tarina.herokuapp.com/api/register)

![Logo](https://raw.githubusercontent.com/pu6ki/tarina/master/client/images/tarina_logo.jpg)


# tarina

**tarina** is a web application where you can post a story and wait to see how others will continue it, or you can contribute to the story of someone else.
This is the project of team PU6KI for the school hackathon HackTUES 3.


## Tech

The app is written in Python (Django) and JavaScript mainly. It uses a number of open-source projects to work properly:

* [Django](https://github.com/django/django) - A really nice high-level Python web framework
* [Django REST Framework](https://github.com/tomchristie/django-rest-framework) - Framework for building REST APIs in Django
* [django-cors-headers](https://github.com/ottoyiu/django-cors-headers) - Django app for handling the server headers required for Cross-Origin Resource Sharing (CORS)
* [drf-nested-routers](https://github.com/alanjds/drf-nested-routers) - Nested routing for DRF
* [django-vote](https://github.com/shanbay/django-vote) - Simple Django app to conduct vote for a model.
* [jQuery](https://github.com/jquery/jquery) - New Wave JavaScript
* [navigo](https://github.com/krasimir/navigo) - Minimalistic JavaScript router
* [live-server](https://github.com/tapio/live-server) - A small HTTP web server with live reload
* [handlebars](https://github.com/wycats/handlebars.js/) - Semantic templates for JavaScript
* [materialize-css](https://github.com/Dogfalo/materialize) - CSS Framework based on Material design.


## Getting started

How to copy this project to your local machine and run it:

1. Download a copy from GitHub:

    ```
    $ git clone https://github.com/pu6ki/tarina.git
    $ cd tarina/
    ```

2. Setup Django requirements:

    ```
    $ pip3 install -r requirements.txt
    $ python3 manage.py makemigrations
    $ python3 manage.py migrate
    ```

3. Create a superuser:

    ```
    $ python3 manage.py createsuperuser
    ```

4. Run the tests:

    ```
    $ python3 manage.py test
    ```

5. Run the `live-server`:

    ```
    $ cd client/
    $ live-server
    ```


## API urls

* /api/register
* /api/login
* /api/profile/{user_id} - *Profile view.*
* /api/story - *List of all stories.*
* /api/story/personal - *Personal story list.*
* /api/story/trending - *Trending stories.*
* /api/story/{story_id} - *Story detail.*
* /api/story/{story_id}/storylines - *Story lines of a story.*
* /api/story/{story_id}/storylines/{storyline_id} - *See a certain story line.*
* /api/story/{story_id}/vote - *Vote for a story.*
* /api/story/{story_id}/unvote*
* /api/story/{story_id}/block/{user_id} - *Block user from posting story lines.*
* /api/story/{story_id}/unblock/{user_id}


### License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.<commit_msg>Added TODO list in README<commit_after>[![Heroku](http://heroku-badge.herokuapp.com/?app=tarina&style=flat&root=/static/images/default.jpg)](https://tarina.herokuapp.com/api/register)

![Logo](https://raw.githubusercontent.com/pu6ki/tarina/master/client/images/tarina_logo.jpg)


# tarina

**tarina** is a web application where you can post a story and wait to see how others will continue it, or you can contribute to the story of someone else.
This is the project of team PU6KI for the school hackathon HackTUES 3.


## Tech

The app is written in Python (Django) and JavaScript mainly. It uses a number of open-source projects to work properly:

* [Django](https://github.com/django/django) - A really nice high-level Python web framework
* [Django REST Framework](https://github.com/tomchristie/django-rest-framework) - Framework for building REST APIs in Django
* [django-cors-headers](https://github.com/ottoyiu/django-cors-headers) - Django app for handling the server headers required for Cross-Origin Resource Sharing (CORS)
* [drf-nested-routers](https://github.com/alanjds/drf-nested-routers) - Nested routing for DRF
* [django-vote](https://github.com/shanbay/django-vote) - Simple Django app to conduct vote for a model.
* [jQuery](https://github.com/jquery/jquery) - New Wave JavaScript
* [navigo](https://github.com/krasimir/navigo) - Minimalistic JavaScript router
* [live-server](https://github.com/tapio/live-server) - A small HTTP web server with live reload
* [handlebars](https://github.com/wycats/handlebars.js/) - Semantic templates for JavaScript
* [materialize-css](https://github.com/Dogfalo/materialize) - CSS Framework based on Material design.


## Getting started

How to copy this project to your local machine and run it:

1. Download a copy from GitHub:

    ```
    $ git clone https://github.com/pu6ki/tarina.git
    $ cd tarina/
    ```

2. Setup Django requirements:

    ```
    $ pip3 install -r requirements.txt
    $ python3 manage.py makemigrations
    $ python3 manage.py migrate
    ```

3. Create a superuser:

    ```
    $ python3 manage.py createsuperuser
    ```

4. Run the tests:

    ```
    $ python3 manage.py test
    ```

5. Run the `live-server`:

    ```
    $ cd client/
    $ live-server
    ```


## API urls

* /api/register
* /api/login
* /api/profile/{user_id} - *Profile view.*
* /api/story - *List of all stories.*
* /api/story/personal - *Personal story list.*
* /api/story/trending - *Trending stories.*
* /api/story/{story_id} - *Story detail.*
* /api/story/{story_id}/storylines - *Story lines of a story.*
* /api/story/{story_id}/storylines/{storyline_id} - *See a certain story line.*
* /api/story/{story_id}/vote - *Vote for a story.*
* /api/story/{story_id}/unvote*
* /api/story/{story_id}/block/{user_id} - *Block user from posting story lines.*
* /api/story/{story_id}/unblock/{user_id}


## TODOs

* [ ] Add tests for author profile updating.
* [ ] Implement story lines tests.


### License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
{'fraction_non_alphanumeric': 0.13782796413151777, 'fraction_numerical': 0.004649618067087346, 'mean_word_length': 3.6545595054095825, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 26, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4054839', 'n_tokens_mistral': 1970, 'n_tokens_neox': 1883, 'n_words': 546}