Flack is a simple chat system relying on WebSocket protocol to provide quasi-realtime communication and IPFS to store files shared in conversations. Conversations are organized as rooms, where each room has at least two participants. Participants can send messages and optionally attach their GPS location and files to them.
This is the repository for Flack’s server (back end) component. It uses Django
for data storage, Django Channels for communication using WebSocket protocol,
Django REST framework to facilitate other non-realtime REST-based activities
such as file uploads, logging in and registering and django-ipfs-storage
to
integrate IPFS support in Django. Documentation for REST-based API endpoints
is provided using Swagger UI with the help of drf-yasg
package.
The server provides a minimalist web interface used to ensure all the core functionalities work properly. While it supports most of implemented features, it is created primarily for debugging purposes. The Android client is the preferred method of communicating with other users.
The steps below describe the installation process on a machine running Ubuntu. It should work with minimal changes on Debian, but it has not been tested. Users running other Linux distributions, especially those running Windows or macOS will have to make some adjustments to steps provided.
-
Install system dependencies.
sudo apt install git virtualenv python3-dev build-essential curl redis-server libappindicator3-1
-
Install IPFS Desktop and start it from your system’s application launcher or start menu.
-
Go to the Settings tab in opened IPFS Desktop window. Under the IPFS Config section find Gateway key in Addresses object and change its value from
"/ip4/127.0.0.1/tcp/8080"
to"/ip4/0.0.0.0/tcp/8080"
. -
Restart IPFS Desktop. Shut IPFS Desktop down by right-clicking the IPFS icon in system tray and selecting Quit. Once the IPFS icon is no longer present in tray, start IPFS Desktop.
-
Clone this repository and enter cloned directory.
git clone https://github.com/skomaromi/flack-server.git cd flack-server
-
Add execute permission to
setup.sh
and run it. In the setup process, an administrator account will be created. Enter values of your choice for its username, email address and password when prompt appears.chmod +x setup.sh ./setup.sh
-
Start IPFS Desktop if it isn’t running already.
-
Start the server by executing
run.sh
../run.sh
Once the server is started, you can:
-
connect to it using the Android client;
-
use the built-in web interface at
localhost:8000
; or -
roll your own client (the documentation might help here).