Skip to content

SAMA - Simple but Advanced Messaging Alternative chat server, powered by uWebsockets.js under the hood.

License

Notifications You must be signed in to change notification settings

MatthewTheBird/sama-server

 
 

Repository files navigation

SAMA - Simple but Advanced Messaging Alternative - Chat server

Powered by uWebSockets.js

Last commit GitHub issues GitHub stars GitHub license GitHub language count GitHub top language

NodeJS MongoDB Redis AWS

Screenshot 2022-12-31 at 14 15 04

Motivation

The intention of our messaging protocol and chat server, which are different from others, is to provide an alternative solution to the wide spread XMPP messaging protocol (and to be honest — the only wide spread ‘standard’ these days).

Read a complete medium post Introducing SAMA about what is SAMA and what problems we are trying to solve with it https://medium.com/sama-communications/introducing-sama-simple-but-advanced-messaging-alternative-chat-server-524a532e2040

Development

  • Make sure you have Node 18 installed.
  • Copy .env.example to .env.
  • Run docker-compose up to run dependant services (MongoDB, Minio, Redis)
  • npm install to install dependencies
  • npm run migrate-mongo-up to run DB migrations
  • npm run start to run server

There are also other components. Make sure to check Deploying SAMA chat server stack: a comprehensive guide

Docker one-command deployment

To build and run the SAMA with all dependencies, you can use the following command:

docker-compose -f docker-compose-full.yml up --build

If you only want to run dependency services (for local development without Docker), use this command:

docker-compose up

Run dependency services with SAMA main apps:

RUN_SAMA=true docker-compose up --build

⚠️ If you are using MacOS or Windows, and want run SAMA apps, add these two variables before the launch command: MacOS

MINIO_ENDPOINT=$(ipconfig getifaddr en0) MINIO_PORT=9010

Windows

$env:MINIO_ENDPOINT = (Get-NetIPAddress | Where-Object { $_.AddressFamily -eq 'IPv4' -and $_.IPAddress -match '^192\.168\.|^10\.|^172\.(1[6-9]|2[0-9]|3[0-1])\.' } | Select-Object -ExpandProperty IPAddress)[1]; $env:MINIO_PORT = 9010;

If you are encountering issues with attachments in the web client, it suggests that an error occurred in the first variable. To resolve this, you can simply update the code segment with the private IP address of your machine.

Now you can access apps at the following addresses:

Docker e2e tests

Run migrations:

docker-compose exec sama-server sh -c "MONGODB_URL=mongodb://172.25.0.4/samatests npm run migrate-mongo-up"

Run e2e tests:

docker-compose exec sama-server sh -c "MONGODB_URL=mongodb://172.25.0.4/samatests npm run test"

Public cloud

The whole SAMA stack can be tested using https://app.samacloud.io public cloud.

API

API reference

Also, there is a set of detailed articles for each API:

Clustering

Clustering documentation

Roadmap

Roadmap

License

GPL-3.0

Help us!

Any thoughts, feedback is welcome! Please create a GitHub issue for any feedback you have.

Want to support us with some coffee?. Will be much appreciated!

About

SAMA - Simple but Advanced Messaging Alternative chat server, powered by uWebsockets.js under the hood.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.9%
  • Dockerfile 0.1%