Skip to content

argon-chat/server

Repository files navigation

Argon Server

Argon is a high-performance, distributed voice chat server built on modern cloud-native technologies. It provides real-time communication capabilities with a focus on scalability, reliability, and low latency.

🌟 Features

  • Real-time Voice Communication: Built on LiveKit for high-quality, low-latency voice chat
  • Distributed Architecture: Leverages Orleans virtual actors for scalable, distributed computing
  • Multi-Region Support: CockroachDB cluster with multi-region replication
  • Event-Driven: NATS messaging with JetStream for reliable event streaming
  • S3-Compatible Storage: SeaweedFS for scalable object storage
  • High-Performance Caching: DragonflyDB for Redis-compatible in-memory operations

πŸ› οΈ Technology Stack

Component Technology
Framework .NET 10.0 (Preview)
Language C# (Latest)
Actor Model Microsoft Orleans
Database CockroachDB (3-node cluster)
NoSQL ScyllaDB (Cassandra-compatible)
Cache DragonflyDB (Redis-compatible)
Messaging NATS with JetStream
Storage SeaweedFS (S3-compatible)
Media Server LiveKit
Reverse Proxy Caddy

πŸ“‹ Prerequisites

Before getting started, ensure you have:

  • .NET 10.0 SDK (Preview)
  • Docker Desktop (or Docker Engine + Compose)
  • mkcert β€” for generating local TLS certificates
  • PowerShell (for Windows) or Bash (for Linux/macOS) for running setup scripts

πŸš€ Quick Start

1. Clone the Repository

git clone https://github.com/argon-chat/server.git
cd server

2. Set Up Local Infrastructure

Navigate to the deploy directory and start the local development environment:

cd deploy
./ensure-certs.ps1  # Generate local TLS certificates
docker compose -f docker-compose.local.yml up -d

This will start all required services (databases, caching, messaging, media server, etc.).

3. Build the Server

From the repository root:

dotnet restore
dotnet build

4. Run the Server

cd src/Argon.Api
dotnet run

πŸ“¦ Local Development Environment

This section explains the complete local infrastructure for development using Docker Compose.

Infrastructure Components

The local environment includes the following services:

Service Description
NATS Messaging bus with JetStream enabled for event streaming
ScyllaDB High-performance Cassandra-compatible NoSQL database
CockroachDB (3 nodes) Distributed SQL database cluster with multi-region support
SeaweedFS (S3) Local S3-compatible object storage
KineticaFS Argon's file lifecycle manager and S3 bridge
DragonflyDB High-performance Redis-compatible in-memory cache
LiveKit Real-time media server for voice/video communication
Caddy HTTPS reverse proxy for LiveKit

All services are connected through the argon Docker bridge network.


πŸ” Generating Local Certificates

Before starting the containers, generate local certificates used by Caddy and LiveKit.

Run:

cd deploy
./ensure-certs.ps1

This script will:

  • Check for existing certificates in the certs/ directory
  • Create new certificates via mkcert if they don't exist

πŸš€ Starting the Infrastructure

The docker-compose.local.yml file is located in the /deploy directory.

To launch the local infrastructure, run:

cd deploy
docker compose -f docker-compose.local.yml up -d

This will start all services in detached mode (-d).

The first startup may take a few minutes as the databases initialize.

Alternative: You can also use the provided PowerShell script:

cd deploy
./start.ps1

🧠 Service URLs and Ports

Service URL/Port Notes
NATS localhost:4222 NATS client port
ScyllaDB CQL localhost:9042 CQL port
CockroachDB SQL localhost:26257 SQL port
CockroachDB UI http://localhost:8080 Admin console
SeaweedFS S3 http://localhost:8333 S3 API endpoint
SeaweedFS UI http://localhost:9321 Admin interface
KineticaFS http://localhost:3000 File lifecycle manager
DragonflyDB localhost:6379 Redis-compatible port
LiveKit localhost:7880 LiveKit server port
LiveKit (HTTPS) https://localhost:9443 Served via Caddy proxy

🧹 Stopping and Cleaning Up

To stop all containers:

cd deploy
docker compose -f docker-compose.local.yml down

Alternative: Use the PowerShell script:

cd deploy
./stop.ps1

To stop all containers and remove related volumes (resetting all data):

cd deploy
docker compose -f docker-compose.local.yml -p argonlocal down --volumes --remove-orphans

This will:

  • Stop and remove all running containers
  • Remove persistent volumes
  • Clean up orphaned resources

πŸ—‚ Directory Structure

.
β”œβ”€β”€ src/                      # Source code
β”‚   β”œβ”€β”€ Argon.Api/           # Main API server
β”‚   β”œβ”€β”€ Argon.Core/          # Core business logic
β”‚   β”œβ”€β”€ Argon.Cassandra/     # ScyllaDB/Cassandra integration
β”‚   β”œβ”€β”€ Argon.CodeGen/       # Code generation utilities
β”‚   └── Argon.Ion/           # Ion protocol implementation
β”œβ”€β”€ tests/                    # Test projects
β”œβ”€β”€ deploy/                   # Deployment configurations
β”‚   β”œβ”€β”€ certs/               # Local TLS certificates (generated)
β”‚   β”œβ”€β”€ docker/              # Docker-related scripts/configs
β”‚   β”œβ”€β”€ dynamicconfig/       # Temporal dynamic configuration
β”‚   β”œβ”€β”€ docker-compose.local.yml  # Main Docker Compose file
β”‚   β”œβ”€β”€ ensure-certs.ps1     # Certificate generation script
β”‚   β”œβ”€β”€ start.ps1            # Start infrastructure script
β”‚   β”œβ”€β”€ stop.ps1             # Stop infrastructure script
β”‚   β”œβ”€β”€ Caddyfile            # Caddy reverse proxy configuration
β”‚   └── livekit.yaml         # LiveKit server configuration
β”œβ”€β”€ Argon.Server.slnx        # Solution file
└── README.md                # This file

🧩 Notes

  • The CockroachDB cluster automatically bootstraps with 3 nodes (cockroach1, cockroach2, cockroach3) in different regions.
  • KineticaFS waits for ScyllaDB to become healthy before starting.
  • DragonflyDB provides a fast Redis-compatible cache and stores data in the argon-cache-data volume.
  • Caddy uses certificates from ./certs to serve LiveKit over HTTPS on port 9443.

🧰 Troubleshooting

Issue Possible Fix
mkcert not found Install it from mkcert GitHub
Database healthcheck failures Wait 1–2 minutes; some databases (Scylla/CockroachDB) have long startup times
Ports already in use Check for conflicting local services and stop them
SSL errors in browser Run mkcert -install to add the local CA to your OS trust store
CockroachDB cluster init fails Run docker compose logs init to see initialization logs

πŸ—οΈ Building and Running the Server

Build

To build the entire solution:

dotnet restore
dotnet build

Run

To run the Argon API server:

cd src/Argon.Api
dotnet run

The server will start and connect to the local infrastructure services.

Configuration

The server configuration is managed through:

  • appsettings.json - Application settings
  • Environment variables - Runtime configuration
  • User secrets - Development secrets (use dotnet user-secrets)

πŸ§ͺ Testing

To run tests:

dotnet test

🀝 Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow the existing code style and conventions
  • Write tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting PR

πŸ“„ License

This project is licensed under the Business Source License 1.1.

  • Licensor: Argon Inc. LLC
  • Change Date: 4 years from publication
  • Change License: MPL 2.0

See LICENSE.md for full details.

Key Points:

  • βœ… Free for internal use within organizations
  • βœ… Free for non-production use
  • βœ… Free for modifications and derivative works
  • ⚠️ Cannot offer as a competing hosted service
  • ⏰ Automatically becomes MPL 2.0 after 4 years

For alternative licensing arrangements, contact: privacy@argon.gl


πŸ“ž Support and Contact


πŸ™ Acknowledgments

Built with ❀️ by the Argon team and contributors.

Special thanks to all the open-source projects that make Argon possible:

  • Microsoft Orleans
  • CockroachDB
  • ScyllaDB
  • LiveKit
  • NATS
  • And many more...

βœ… Ready to build!
You now have everything you need to start developing with Argon Server.

About

Argon Backend, controlled voice intergration, servers, channels, users and other

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6