A simple chat app built with SvelteKit and Apache Cassandra
To deploy with Docker, you will need to have both docker
and docker-compose
installed.
Pull down the compose.yaml
file
curl https://raw.githubusercontent.com/arithefirst/svchat/refs/heads/master/compose.yaml -o compose.yml
Edit the service details
Open compose.yaml
in the editor of your choice and replace the following enviroment variables:
ORIGIN
: The URL of your production deployment (no trailing slash)CASSANDRA_USER
: Database UsernameCASSANDRA_PASSWORD
: Database PasswordMINIO_ROOT_USER
: S3 Bucket UsernameMINIO_ROOT_PASSWORD
: S3 Bucket PasswordStart the stack
docker-compose up -d # Starts detatched
docker-compose up # Starts attatched
Done!
Yes, it's really that easy! You can now access your deployment at http://hostname:3000
, where hostname is the hostname or IP Address of your machine.
[!TIP] This installation method is not reccomended. Unless you have a specific reason not to use Docker, we suggest you do so! Our docker image is kept fully up-to-date and gets re-built on every push to the repository.
Clone the repo
git clone https://github.com/arithefirst/svchat
Install deps
In this example, I use bun
, but any NPM compatible package manager should work just fine!
bun install
Run DB Migrations
Running the DB Migrations sets up the tables in the SQLite users DB, and allows for functional user authenticaton.
bun run migrate
Set Enviroment Variables
In order for the server to connect to Cassandra and Minio, the credentials need to be set in .env
. You will also need to set the production URL of your instance, to make sure CORS dosen't throw a fit.
# Example '.env' file
CASSANDRA_USER=admin
CASSANDRA_PASSWORD=admin
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=minioadmin
ORIGIN=http://localhost:3000
[!WARNING] The above DB and S3 credentials are just for example, and it is highly reccomended that you change them for security purposes.
Build
bun run build
Start the server
bun run production
Done!
You can now access your deployment at http://hostname:3000
, where hostname is the hostname or IP Address of your machine.