I used SQLite when I wrote the initial code. Install sqlx-cli
and follow the docs via this documentation to get started.
My sqlite3 DB resides in the ./data
directory, but it can live anywhere, as long as the DATABSE_URL
in your .env
points to the DB file on your local file system.
Create an .env
file in the root directory and copy the contents of .env.example
into it, replacing the placeholder values with real ones.
Once you have your sqlite
DB set up and your .env
file's DATABASE_URL
is set correctly, you should be able to run the migrations with
sqlx migrate run
cargo update
cargo run
Should be good to go after that.
This app is by no means finished. A half-assed session + cookie layer has been implemented, but still needs proper session expiration checks. There are a couple of TERA templates that render the /chat
, /login
, and /sign-up
pages. Visiting the index page (/
) should check your session cookie and redirect you to /login
or/chat
, depending on its presence/validity. The websocket layer establishes a connection, but actual back n' forth chat functionality is yet to be implemented.