This lets us remove the snippets, and also fixes a bug involving wierd interactions with the context menu limiter between WS and DB messages, since they're now part of the same iterable. |
||
|---|---|---|
| .github/workflows | ||
| src | ||
| static | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .npmrc | ||
| .prettierignore | ||
| .prettierrc | ||
| bun.lockb | ||
| components.json | ||
| compose.yaml | ||
| Dockerfile | ||
| eslint.config.js | ||
| LICENSE | ||
| package.json | ||
| postcss.config.js | ||
| prodServer.ts | ||
| README.md | ||
| svelte.config.js | ||
| tailwind.config.ts | ||
| TODO.md | ||
| tsconfig.json | ||
| vite.config.ts | ||
SVChat
A simple chat app built with SvelteKit and Apache Cassandra
💻 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.
-
Pull down the
compose.yamlfilecurl https://raw.githubusercontent.com/arithefirst/svchat/refs/heads/master/compose.yaml -o compose.yml -
Edit the service details
Opencompose.yamlin 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 Password
-
Start 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 athttp://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.
-
Clone the repo
git clone https://github.com/arithefirst/svchat -
Install deps
In this example, I usebun, 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 athttp://hostname:3000, where hostname is the hostname or IP Address of your machine.