From d9483f63b22f40d423d76f21a24c87bcde0f848e Mon Sep 17 00:00:00 2001 From: km0 Date: Wed, 12 Jun 2024 00:54:02 +0200 Subject: [PATCH] add readme and branch to main --- README.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..deaa908 --- /dev/null +++ b/README.md @@ -0,0 +1,57 @@ +# Xquisite Branch + +A branching version of the [exquisite corpse](https://en.wikipedia.org/wiki/Exquisite_corpse) game. A drawing app developed for [SI17](https://issue.xpub.nl/17/). + +Draw something, upload it and send the link to someone else: they will continue from your drawing. But wait! There's a catch!!!!! If you send to just one person the chain will continue linearly, but send it to more people and things will start branching in different directions. + +## Install + +Clone the repository. +``` +git clone https://git.xpub.nl/kamo/exquisite-branch.git +``` + +Create a virtual environment. +``` +python3 -m venv venv +``` + +Install the requirements with `pip` and the `requirements.txt` file. +``` +pip install -r requirements.txt +``` + +Create an `.env` file in the root folder of the project with the following variables: +``` +DEBUG=True +FLASK_ENV=development +FLASK_APP=exquisite_branch +``` + +Before running the app for the first time, be sure to initialize the database. __Watch out:__ this will delete the previous instance of the database along with its contents! +``` +flask init-db +``` +After initializing the database you can run the flask application +``` +flask run +``` + +## Overview + +_Xquisite Branch_ saves contents in a database, and join them together in a branching version of the exquisite corpse. + +The original exquisite corpse data structure is something similar to a linked list, where every drawing is connected to the previous one. Contents in _Xquisite Branch_ are saved in a database with the same principle. + +Each entry in the database has the following properties: + +- `id`: a unique identifier for every entry +- `branch`: a random name for the excerpt +- `parent`: the random name of the previous excerpt +- `content`: the actual content of the writings +- `username`: the author of the excerpt + +When generating the display page, every entry look up its `parent` property to position itself after that. + +Mhh should rewrite this better bc is super convoluted ahah. +