real-time-chat-svelte-couchbase Svelte Themes

Real Time Chat Svelte Couchbase

Real-Time Chat Application with Couchbase and SvelteKit

Real-Time Chat Application with Couchbase and SvelteKit

This is a simple real-time chat application built with SvelteKit, Couchbase, and WebSockets. The application allows users to send and receive messages in real-time.

Table of Contents

Features

  • Real-time messaging using WebSockets
  • Messages stored in Couchbase Capella
  • Simple, elegant UI with Tailwind CSS

Installation

  1. Clone the Repository

    git clone https://github.com/hummusonrails/real-time-chat-svelte-couchbase.git
    cd real-time-chat-svelte-couchbase
    
  2. Install Dependencies

    npm install
    npm install express ws couchbase dotenv
    npm install -D tailwindcss postcss autoprefixer
    npx tailwindcss init -p
    
  3. Set Environment Variables Copy the .env.example file in the root of the project to .env and set the required environment variables.

    COUCHBASE_BUCKET=your_bucket_name
    COUCHBASE_CONNECTION_STRING=your_connection_string
    COUCHBASE_USER=your_username
    COUCHBASE_PASSWORD=your_password
    

Running the Application

  1. Start the Node.js Server
    node server.cjs
    
  2. Start the SvelteKit Application
    npm run dev -- --open
    

Usage

Open your browser and navigate to http://localhost:5173. Open multiple tabs or windows to simulate multiple users. Send messages and verify they appear in all open instances in real-time.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Top categories

Loading Svelte Themes