Skip to content

RustGPT is a ChatGPT UI built with Rust + HTMX: the power of Rust coupled with the simplicity of HTMX 💚

License

Notifications You must be signed in to change notification settings

StripyRaven/rustgpt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust_AI

Sources

Materials

RUST

Errors handling

Errors Code
rustc --explain E0277

Sqlx

Axum


Acc & Mutex

HTTP

tailwindcss

Introduction

Rust-AI is latest experiment in cloning the abilities of OpenAI's Chat-AI. In this repository, a Rust-based server leveraging the Axum framework combined with HTMX, providing a Rusty web development experience. From database operations to streaming responses, this project covers a broad spectrum of backend functionalities and real-time web interactions. So, for Rust enthusiasts and web developers alike, dive in to explore a world where web development is redefined with the power of Rust!

Features

  • Rust with Axum Framework: A fast and reliable server that's all about performance and simplicity.
  • SQLite: A lightweight yet powerful database for all your data persistence needs.
  • Server Sent Events (SSE): Real-time streaming made easy to bring life to the ChatGPT interactions.
  • HTMX: No hefty JavaScript frameworks needed—HTMX keeps interactions snappy with simple HTML attributes.

Tech Stack

  • sqlx: Direct and type-safe SQL queries and migrations.
  • tera: A templating engine inspired by Jinja2, for rendering the HTML views.
  • axum: A web application framework that's easy to use and incredibly fast.

For those eyeing some client-side WASM magic, you might also want to check out Yew or Leptos for more complex applications.

Quickstart

  1. Clone the repository.
  2. Create a .env

.env

MIGRATIONS_PATH=db/migrations
TEMPLATES_PATH=templates
DATABASE_URL=sqlite:db/db.db
DATABASE_PATH=db/db.db
OPENAI_API_KEY=<api-key> (only necessary for tests, users will add their own keys)
  1. Install TailwindCSS Standalone in this repository: 1.1 Brew
  2. cargo install just : install Just
  3. just init : install additional tools and migrate the db
  4. just dev : concurrently run tailwind and cargo run in watch mode
  5. Open your browser and enjoy chatting with your Rust-powered ChatGPT clone (port 3000 by default)

Install tailwindcss

  1. execute
title:terminal
# Example for macOS arm64
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.17/tailwindcss-macos-x64
chmod +x tailwindcss-macos-x64
mv tailwindcss-macos-x64 tailwindcss
  • rename executable to tailwindcss

Contributin

Contributions are what make the open-source community an incredible place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make RustGPT better, please fork the repo and create a pull request. You can also simply open an issue. Don't forget to give the project a star! Thank you again!

Acknowledgments

Hats off to the wonderful crates and libraries that made Rust_AI possible!


About

RustGPT is a ChatGPT UI built with Rust + HTMX: the power of Rust coupled with the simplicity of HTMX 💚

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 69.4%
  • HTML 27.4%
  • Just 1.1%
  • Dockerfile 1.0%
  • CSS 0.6%
  • Shell 0.3%
  • JavaScript 0.2%