DataStax-Examples / astra-loom

Elixir/Phoenix based web chat using Liveviews and the DataStax Astra Elixir module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Astra DB Loom

60 minutes, Advanced, Start Building

Loom is a thread based chat server, where users can send messages to one or more threads via hashtags (ex. "I'm heading to the park at noon #family #friends #frisbee_club" ). Users can subscribe to new threads they see by clicking them and start new threads but just adding a new hashtag to a message.

image

Quick Start

  1. Signup for DataStax Astra, or login to your already existing account.
  1. Create an Astra DB Database or use an existing one.
  2. Create an Astra DB Keyspace called sag_loom in your database.
  3. Generate an Application Token with the role of Database Administrator for the Organization that your Astra DB is in.
  4. Click the 'Open in Gitpod' link: Open in IDE
  5. Once the app is finished launching in the Gitpod IDE, copy the .env.example file to a file named .env and fill the required values in from your Application Token and Astra DB connection settings.
  6. Start the example by running the following command in the Gitpod console:
source .env
mix phx.server

How this works

The app demonstrates working with DataStax Astra DB, Elixir, and Phoenix Liveviews together. The project attempts to make the best use of this stack. Messages histories are saved and loaded in Astra DB, while new messages are shared via Phoenix channels between all active users in a "thread". The goal is a fast, scalable, and durable chat/messaging application.

About

Elixir/Phoenix based web chat using Liveviews and the DataStax Astra Elixir module

License:Apache License 2.0


Languages

Language:Elixir 68.9%Language:CSS 14.0%Language:HTML 9.7%Language:JavaScript 3.9%Language:SCSS 1.5%Language:Shell 1.1%Language:Dockerfile 0.9%