chat_app Svelte Themes

Chat_app

A crossplatform chat app that uses an axum api and a tauri+svelte client

Chat App

A real-time chat application built with Rust, Axum, Tauri, Svelte, and PostgreSQL. The backend is an Axum server, and the frontend is a Tauri desktop app with a Svelte UI.

Prerequisites

  • Rust (latest stable version)

  • Docker Desktop

  • Node.js (for Tauri/Svelte)

  • pnpm (recommended for Tauri, npm/yarn work too)

  • Tauri Cli

    cargo install tauri-cli --version "^2.0.0" --locked
    
  • Sqlx Cli

    cargo install sqlx-cli --no-default-features --features postgres
    

    Project Structure

  • /: Project root directory.

    • docker-compose.yml: Configuration for the PostgreSQL database running in Docker.
    • .env: Environment variables (e.g., DATABASE_URL for the database connection).
  • api/: Rust backend directory.

    • Contains the Axum server code for handling API requests and database logic (using sqlx to interact with PostgreSQL).
  • client/: Tauri-Svelte frontend directory.

    • Houses the Tauri desktop app with a Svelte frontend and Rust backend (in src-tauri/ within this dir).

Setup Instructions

1. Start the PostgreSQL Database

  1. Ensure Docker Desktop is running.

  2. Start the database:

    docker compose up -d
    

    2. Start API

  3. Navigate to api dir:

    cd api
    
  4. Run sqlx migrations to initialize db

    sqlx migrate run
    
  5. Start the API:

    cargo run
    

    3. Start client app

  6. Navigate to client dir:

    cd client
    
  7. Install npm dependencies:

    npm install
    
  8. Run tauri app:

    cargo tauri dev
    

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes