IndieChat is a decentralized messaging client that uses WebSub, TicketAuth, and IndieAuth. Messages are exchanged over HTTPS.
First, clone the project repository and install the required dependencies:
git clone https://github.com/capjamesg/indiechat
cd indiechat
pip install -r requirements.txt
Create a file called config.py
and add the following values:
ME="https://example.com" # your domain name
WEBSUB_HUB="https://switchboard.p3k.io/" # the WebSub hub you use on your personal website
CALLBACK_URL="https://example.com/listener" # the callback URL for IndieChat
Then, run the application:
python app.py
- You sign in to IndieChat with your domain name.
- You subscribe to a private feed to which someone has given you access via TicketAuth.
- Every time you send a message, it is saved in a database and published on your message feed with a user.
- A notification is sent to the recipient's WebSub hub to say your message feed has been updated.
- When a feed to which you are subscribed is updated, you receive a notification from the WebSub hub.
- The feed URL is retrieved using the
Link
header from the notification. - The token redeemed via TicketAuth is used to retrieve the
mf2+html
representation of the sender's feed. - The feed is retrieved and the latest message is / messages are saved in the recipient's database.
- You can read the message(s) in IndieChat.
- James decides to send a private message to Angelo
- James creates a ticket in his web interface and sends it to Angelo’s ticket endpoint
- Angelo’s ticket endpoint redeems the ticket for a token
- Angelo sends the token in all requests to get the resource for which the token was issued (feed of posts / chats)
- Now Angelo can read my content
- Angelo sends a POST request to my WebSub server to subscribe to content
- Angelo has an endpoint on his chat server that can receive messages from the WebSub feed
- Angelo listens for WebSub messages
- James sends a message
- James' chat client sends a POST request to James' WebSub server. The WebSub server will inform Angelo a new message is available.
- Angelo's chat client retrieves and parses the feed.
- Messages whose
u-uid
have not been found in the feed are added to amessages
table that stores the chat
- WebSub: For real-time notifications of feed updates
- TicketAuth: For granting access to private feeds
- IndieAuth: For authentication
- microformats2: For marking up feeds with messages (h-feed and h-entry)
This project is licensed under an MIT license.