Chat room for test network

Could something like the link below have the existing API swapped out to use SAFE’s?

It looks to be just HTML and JS and could be a good project…I am just not familiar enough with the APIs to see if it is actually doable…

Here is a little info and the source code is over on github…(not my project…the below is from the website…)

The Approach

The entire application consists of three files, one HTML file, one JavaScript file and one CSS file. Most of the frontend is built with jQuery Mobile components. In the end I had to add some CSS to get the user list working responsively and add some overall flair to the app. The app also uses jQuery Mobile’s page navigation. This allowed me to define all my pages in one file and then show and hide them using JavaScript. This might not scale if I kept adding more functionality, but it worked for the purposes of building this demo.

Building a Group Chat App with the JavaScript API

The rest of the group chat app is built on top of the PubNub JavaScript API. Each user is identified by a username that they enter at the beginning of the application. From there the user can enter any chat room designated by a chat room name and use the app to talk to everyone else in that room. The PubNub API also allowed me to get chat history for a given room so you can see what people have been talking about as well as PubNub Presence to tell the user who is currently in the room chatting.

Working on Mobile and Desktop

The final piece of the puzzle to get it working on iOS and Android was using PhoneGap. With PhoneGap, I could easily generate an Android and iOS app that runs a full screen web view to load the application in. As soon as the page loads, the frameworks take care of the rest. The best part of this that is the only mobile support I had to include was hiding the user list on smaller screens. Everything else was simply plug and play.

Overall, it was pretty straightforward to build. Instead of spending my time writing platform specific code or setup a single server, I was able to focus on adding great features to my application. This is how web development should be.

4 Likes

Just a thought

Might work a lot better when SD object is live since you can rewrite them where files are immutable and a lot more costly resources/time/coin when it arrives, to keep updating files.

Each message a user writes could be written to the last SD in their list of SDs for that application. Then the application simply keeps a running list of “SD_address, message_in_SD” and can display them. Change file accesses to SD accesses

1 Like