Flettex/flettext is a monorepo.
The individual components of the project are found here:
- Frontend: https://github.com/Flettex/pineapple-svelte
- Backend: https://github.com/Flettex/raspberry
- Frontend (legacy): https://github.com/Flettex/pineapple
Flettext is an extensive real-time instant messaging application designed to connect people from all over the world. Provided features include guilds (container of channels), channels (container of messages), etc. You may create a guild to talk with a group of friends, or just directly message your friend. There is also a global chat where you can make new friends!
Flettext was made to test the usage and capabilities of WebSockets, as well as essentials of every modern software application - authentication, data storage, sessions, etc. Frontend and user interface was not the primary focus of this project, therefore aesthetics are relatively lacking on every page except the main application.
Frontend:
- SvelteKit
- TailwindCSS
Backend
- tokio + actix-web + actix-cors + actix-ws + actix-http + actix-identity + actix-session
- sqlx
- postgres
Picture of flettext main application window
Demo: https://pineapple-deploy.vercel.app/
Note: captcha is sometimes broken due to cross-origin cookies (I cannot afford to get a real domain to solve this issue). Signup and login may not function as intended, and error messages can be observed in the network tab in inspect/devtools
Run
git clone https://github.com/Flettex/flettext
to clone the repository andcd
into the flettext folder
Run
git submodule update --recursive --init
to clone the frontend and backend repositories
The backend is programmed in Rust, therefore you will need the rust toolchains which includes cargo.
cargo >= 1.67.1, rustc >= 1.67.1
Tools prerequisites:
cargo-watch >= 8.1.1, sqlx-cli >= 0.7.1
-
cd
into the backend foldercd src/raspberry
-
Create an
.env
in the backend folder file containingDATABASE_URL='postgres://<user>:<password>@localhost:5433/<database>' DATABASE_PROD_URL='...' # this is optional RUST_LOG=INFO,sqlx=TRACE # SQLX_OFFLINE=true EMAIL_PASSWORD='<your_gmail_2fa_password>' # make sure to modify the email SECRET_KEY='<32_randomly_generated_2_digit_positive_integers_separated_by_commas>'
replace the
<>
with the relevant valuesNote: You can use cockroachdb.
-
Install the dependencies after exporting the env file variables
export $(grep -v '^#' .env.prod | xargs) # note that this is zsh syntax in macOS, adjust accordingly cargo build
-
Apply the database migrations
export $(grep -v '^#' .env.prod | xargs) # you need this for DATABASE_URL env variable sqlx database create sqlx migrate run
-
Run the server
export $(grep -v '^#' .env.prod | xargs) # if you are in a new terminal syntax cargo run # OR cargo watch -x run --ignore src/html.rs # html.rs is generated at build time, this flag is to prevent infinite loops
Node version > 18.15.0 and npm version > 9.5.0
-
cd
into the frontend foldercd src/pineapple-svelte # the pineapple folder is the legacy next.js version, it is no longer maintained
-
Install the dependencies
npm install # OR pnpm install # OR bun install
-
Run the frontend
npm run dev # OR pnpm dev # OR bun dev