A self-host personal chat app that groups some basic features of Whatsapp and Discord to store personal data in an organized manner.
The project is a custom built interface to visualize the data on top of PocketBase project, So This needs to be installed first:
- Download the compiled project depending on your OS from here & place it in the project root directory.
- Run
pocketbase migrate
to apply data base migrations. A 'pb_data' folder will be created. - Run
pocketbase serve
to start the server. - OPTIONAL: you can append
--http=<ip_addr>:<port>
to serve the application on a custom IP address if you own it. - Add a user in the users table.
- Change the credentials in
./pb_public/js/xzanspace.js
at lines 15 & 16. - Add whatever channels you want on line 2.
- You're all set! Head to the hosted IP address.
Demo.mp4
If you're a nerd, you probably have some kind of a private chat that only includes you as a member where you quick save notes, links, pics, etc. (Mine are on Whatsapp & Discord)
Speaking about their pros:
- Discord: gives you channels to better orgaize your data.
- Whatsapp: gives you a quick share option with peers, and access to data when you're offline.
For the cons:
- Discord: you need to be online to access your data.
- Whatsapp: you don't have the channels feature to organize your data which can makes alot of notes slip by if you're someone who frequently takes notes throughout the day.
Having to deal with the cons, things tends to get a bit annoying having to switch back and forth between both applications in addition to the place I'm taking notes from. So I decided to build up the best of the two worlds. A chat app that has enables you to organize data, can be accessed offline and put it online (on a local network) whenever I want to, and for better flexibility, I have to be able to host it from mobile.
In order to meet the requirments of real-time offline data, and portability. I needed a database to be hosted on a mobile, build a Rest-API for data transactions, and an interface to easier interact with the stack. First things first.
After some researching, I ended up choosing the following stack to satisfy the project needs:
- UserLand for Linux virtualization on Android.
- PocketBase a backend platform with a builtin database, JWT authentication, SDK, and a Restful API all packed into one single executable. To make it better, It's written in Go and directly compiled for ARM64.
- A webpage with HTML-CSS-JS as an interface to make the files compact and portable. PocketBase allows for the host of static files besides its services if they're put in pb_public folder. Docs
As the project won't deal with user accounts or chatting rooms, so It will be simple as making one table with 3 basic fields:
- Channel Name: to implement the idea of the channels in Discord.
- Text: to get the message text. (if any)
- Files: to get the associated file. (if any)
- Dark Theme.
- Controls (channel select, text & files input, send button) at the bottom for quick access on mobile.
- Double click a message to delete.
- Triple click to select whole code blocks.
- Ability to upload multiple files. (each file as a seperate message)
- Keyboard shortcuts in Desktop mode. (Ctrl+Shift+F to upload a file, Ctrl+Shift+M to focus text input)