SVChat is a simple chat app built with SvelteKit and Apache Cassandra
Go to file
April Hall 6fd8f0f85f
Some checks failed
ESLint / lint (push) Has been cancelled
Push to GHCR / build (push) Has been cancelled
Tests / Tests (push) Has been cancelled
Prettier / checkformat (push) Has been cancelled
fix: Make icon import style consistent
2025-03-05 16:31:11 -05:00
.github/workflows style: Prettier format 2025-03-02 00:46:41 -05:00
src fix: Make icon import style consistent 2025-03-05 16:31:11 -05:00
static feat: Tests for profile image changer 2025-03-02 00:37:07 -05:00
tests fix: Update tests for new component 2025-03-05 09:36:49 -05:00
.dockerignore fix: Add ./tests/ to dockerignore 2025-03-02 00:37:07 -05:00
.env.example docs: Update .env.example 2025-02-24 12:36:18 -05:00
.gitignore feat: E2E Tests for change username 2025-03-02 00:37:07 -05:00
.npmrc feat: Initial commit 2025-01-03 10:34:11 -05:00
.prettierignore feat: Initial commit 2025-01-03 10:34:11 -05:00
.prettierrc feat: Partial user auth 2025-02-09 19:58:50 -05:00
bun.lockb feat: Avatar cropping 2025-03-04 12:10:45 -05:00
components.json build: Update to ShadCN-Svelte V5 2025-03-04 10:30:55 -05:00
compose.yaml feat: Customizable auth for DB and S3 2025-02-24 10:53:59 -05:00
Dockerfile feat: Other image metadata 2025-02-23 22:06:20 -05:00
eslint.config.js ci: Set {@html ...} XSS Error to Warn 2025-02-10 03:46:26 -05:00
LICENSE docs: Setup GNU GPL 3.0 2025-01-03 12:10:21 -05:00
package.json feat: Avatar cropping 2025-03-04 12:10:45 -05:00
playwright.config.ts ci: Finish setting up testing CI 2025-03-02 00:37:07 -05:00
postcss.config.js style: Update .prettierrc 2025-01-04 16:25:58 -05:00
prodServer.ts feat: Message context menus 2025-02-25 10:25:48 -05:00
README.md docs: Add tests badge to README.md 2025-03-02 00:37:07 -05:00
svelte.config.js build: Remove close plugin 2025-02-15 23:54:03 -05:00
tailwind.config.ts build: Update to ShadCN-Svelte V5 2025-03-04 10:30:55 -05:00
TODO.md feat: Avatar cropping 2025-03-04 12:10:45 -05:00
tsconfig.json style: Update .prettierrc 2025-01-04 16:25:58 -05:00
vite.config.ts build: Enable ESBuild as minifier 2025-02-16 01:16:37 -05:00

SVChat

A simple chat app built with SvelteKit and Apache Cassandra

Prettier ESLint Playwright

💻 Techstack

Techstack

  • Cassandra and SQLite for storing messages and user data respectively
  • Docker for easier deployments
  • SvelteKit and TypeScript for backend
  • TailwindCSS and ShadCN Svelte for frontend
  • SocketIO for communication between connected clients

🐋 Deploying (Docker)

To deploy with Docker, you will need to have both docker and docker-compose installed.

  1. Pull down the compose.yaml file

    curl https://raw.githubusercontent.com/arithefirst/svchat/refs/heads/master/compose.yaml -o compose.yml
    
  2. 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 Username
    • CASSANDRA_PASSWORD: Database Password
    • MINIO_ROOT_USER: S3 Bucket Username
    • MINIO_ROOT_PASSWORD: S3 Bucket Password
  3. Start the stack

        docker-compose up -d # Starts detatched
        docker-compose up # Starts attatched
    
  4. 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.

🚀 Deploying (Manual)

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.

  1. Setup Apache Cassandra

  2. Setup Minio

  3. Clone the repo

    git clone https://github.com/arithefirst/svchat
    
  4. Install deps
    In this example, I use bun, but any NPM compatible package manager should work just fine!

    bun install
    
  5. 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
    
  6. 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.

  1. Build

    bun run build
    
  2. Start the server

    bun run production
    
  3. Done!
    You can now access your deployment at http://hostname:3000, where hostname is the hostname or IP Address of your machine.