SAFEpress: A Web App that builds websites/blogs on SAFE Network

Okay I’m reading this, sort of, and thinking of stuff so if I’ve missed something just tell me and I’ll go back. Anyway was just thinking of the structure of a decentralized site vs a centralized site. In a centralized site, say a blog for instance, you post content at a central point (your website) and people come to view it, subscribe to it and leave comments on it. In a decentralized model you would COLLECT content and comment and like it and then make it available for others to also collect. Remember information can be easily copied. I know it’s obvious right? But we don’t actually need to own data in order to, you know, own it. Imagine a blog where everything can ultimately be changed by the reader. Say you found a site, loved it’s content but HATED the style of the website. So just switch the theme you’re viewing it with. The point here is to illustrate that instead of storing a website a central point we can treat it more like a U-Pick. User A’s comments and likes are stored on User A’s safespace. If user B doesn’t like user A’s comments (or even a specific comment) then all he needs to do is unsubscribe to it or them. Comments and likes aren’t something you add to a central point, they’re a database YOU KEEP and that others can subscribe to. This would also allow for a ton of different mods that most websites and social networks don’t bother with. Dislikes? Silly emotes? Do I care that much about your dislikes? maybe Do I care to subscribe to all your emoticons on posts? Probably not. But someone else might and you’re free to add them. This would also save the database problem and solve the issue with censorship. People wouldn’t need to control their stuff because if you have a problem with someone you just elect not to listen to them or delete their particular comment from your database So take a business for example. Say customer A has a problem with customer B. The business need not get involved at all because customer A can simply delete customer B’s comments from his database, or unsubscribe from customer B entirely. And all the business has control of is their own comments and the content they produce. They don’t control what other people say or do. This could work for any kind of content. I just used comments as an example. You could put out any kind of content and people could comment on it but the comments would be their collection. People would own their data. If you got a spammer on your site just unsubscribe from them them. You could even combine all this with a reputation system so that good content gets bumped up and bad spammy content gets rated down.

So coming into a website would be something like this.

Collect website theme/layout.
Collect banner
Subscribe to content
Subscribe to author’s comments.

Remember you download a website’s content every time you visit it so really it is that simple, you are subscribing to it. Its just a really slow refresh rate compared to what we tradiionally think of as “subscriptions.”

4 Likes

I guess I’ve not explained this very well @joshuef, my apologies.

When I say there is a database, I mean SAFE network is a database. Both it is a key/value store, and where that lacks the stuff we’d get with say an SQL database, I believe we can still achieve similar levels of functionality without having a database server (SQL, CouchDB or anything - just a layer of Javascript that runs in the browser, but maintains indexes we keep stored on SAFE).

As for CouchDB, there will be no CouchDB in SAFEpress! Let me try to explain. Firstly, what I based the initial idea on (CouchApp/CouchDB) and then what I’ve been thinking for SAFEpress.

CouchApp / CouchDB

Everything is stored in a server based CouchDB, which is a NoSQL database - so similar to SAFE REST API.

To run a CouchApp, user loads it into the browser, accessing the CouchDB server using http://, and in the browser is some HTML / CSS / Javascript. This of course just does more interaction with the CouchDB server via http://

So quite similar to the architecture I’ve described for SAFEpress. However, CouchDB has extra server side functionality that we don’t have in SAFE. So if we wanted to port a CouchApp to SAFEnetwork, we’d have to write some extra magic code in the client side Javascript to do what we can’t ask CouchDB to do for us. Since we only have SAFE REST API, and not a CouchDB.

I hope that clarifies a bit. Don’t worry if not, we can discuss more and I do hope to get my head clear enough to put some more detail into this soon. However, I see @dirvine’s offer and sense he and the team could help me to do this in a much neater way than I’ve been imagining so far. Let’s proceed as we are until we find out though! :smile:

Developer Mumbles

So to @dirvine, yes, yes, yes. This would be brilliant to do. I know I’m still only 50% (max) getting this, and that there are bound to be design choices I’m just not seeing yet. This thread has already thrown up one such, and I’m sure there are many more :smile:

User Permissions

We can keep this stored on SAFE in the owner’s space, but publicly accessible. So when a user loads a page: 1) The UI checks what role they have (looks up their ID in our register), and adapts the UI accordingly. 2) Any operations performed would be appropriate to the user’s role, and (I hope) be validated using SAFE’s own permissions mechanisms on the various data structures. If so, no need for a DB to do this for us.

I may be wrong on this! A lot of what I have in mind needs fleshing out and veryfying.

References & Submissions Log

Thanks @TylerAbeoJordan & @seneca. You are right on here and your input is very helpful. I was thinking along these lines, but your inputs give me something new to sprinkle in the mix. I have been thinking of using messages to “request” create/edit of post/page/comment etc, and for these to be reviewed and approved (see the Outline Design).

@seneca I don’t believe we need a server or SAFE computation to do this though, at least not for a curated website because the admins can act as the server, reviewing contributions and updating the site indexes as they do. Its slightly trickier to automate posting without admin involvement, but that may be doable too (@eblanshey needs this for a forum app so I wonder how far he’s got in this area).

What I hadn’t thought would work was using references, but now I think with versioning it might. My concern was a user modifying or deleting content after posting, but I now realise that the versioning mechanism should mean this isn’t a problem, so thanks for alerting me to that.

Thanks everyone for your contributions. It is extremely helpful - and inspiring to see so much interest in SAFEpress.

One thing I see as a core challenge in a distributed network like SAFE is linking data together. Take a classic forum thread like this. If I upload a reply to your post on SAFE, how can other people know that these belong together? Sure, I can include a backwards reference in my reply to your post, but since your post doesn’t contain a forward reference to my reply people reading your post have no clue my reply even exists. Right now we still rely on a central entity everyone has to report to who puts it all together. I’d really like to have a distributed solution though.

One idea I have for conversations is using this rule: new post identifier = hash(last post)
This would effectively be a linked a list. The forward reference is pre-determined by this rule. The first person to reply to the last post will take up that address in SAFE. Anyone’s PUT after that would fail since the address is already in use. Their reply can be retried by using as identifier the hash of the post that beat them to it.

If branches are desired (replying to a specific message rather than posting at the end of the thread) the rule could be hash(hash(post)). It’d essentially start a new (sub)thread. That could be used for reddit-style comments.

Drawback of this approach is that when opening a discussion thread, you GET all the posts one by one rather than simultaneously. They’ll trickle in at network latency speed.

1 Like

Maybe I’m misunderstanding, so apologies in advance … we have to be careful here not to allow other accounts to see which accounts are using which services/sites. That information would constitute meta-data that can be analysed over time and across the network to deduce/extrapolate information about user-account owners.

I think any logs of user account use/activity should be signed by the user (maybe this is redundant in SafeNet?) and then encrypted with the public key of the site owner and then can be written to the owners public space. The site owner can then publicly store user-access information signed by the site owner and then encrypted with the users public key - this would be stored in the users public space.

I’m thinking that maybe there needs to be two parts to this app - the site owner (admin side) which can access owners private keys and present owner with admin information and the user side which can access the users keys. But maybe I’m not understanding the inherent security of SAFENet and this is all redundant.

Or perhaps the app is pulled directly from internal SAFE-github … so it’s fully trusted to handle private keys of both user and owner simultaneously … probably this is the case.

Perhaps the user chooses a unique-to-site username/identity when they request access, then each time any user goes to view a thread the app looks at all recent user logs and updates the thread’s page.

In this manner if there are no changes to the thread then it just pulls the cache-static page and doesn’t have to rebuild the whole page from scratch every time.

Great ideas flying around here.

First thing. @dirvine mumble session: yes!

I’m liking the ideas of how content could work here, seeing a lot of stuff in a light that I’d been struggling to, I think.

@happybeing Okay, that’s grand. Thanks for clarifying :slight_smile: That’s along the same lines I was on too, the CouchDB stuff threw me a bit is all. But if we’re working in terms of Couch in the browser behaviour for our App, it’s looking like PouchDB is an option for that (allowing easy IndexedDB / WebSQL), and then it’ll be a matter of exporting to SAFE / datatypes etc. Cool cool cool. (although I need to learn more about the datatypes and using SAFE as a key/value store… that’s all still pretty foggy for me).

@Seneca kind of like git commit hashes reference their parentage?

Can an App on safe have a message address? If so, POSTing content (in the traditional HTTP request sense) could be a message to the App, which it would react to whenever started up (by the site ‘owner’). Wouldn’t be realtime unless it was constantly running on a server I guess.

Neat nonetheless.

If we’re looking at this in the fashion of @Blindsite2k . A ‘site’ is just a collection of curated information. Anyone could write a ‘post’, only those users / locations referenced by the ‘site’ however, would be allowed to publish to the curated platform.
Your site could subscribe to messages from trusted sources, and when they message the app about something new (comment/blog post) and send its location – wherever they have stored it, anon or public etc – then the App could pull this and integrate it. (Perhaps using git style hashing for thread reference as suggested by @Seneca).

That would provide a smooth viewing of the main ‘site’ in the end, as everything would have been precompiled by the site app. Equally though we could do this in the modular fashion, where the ‘site’ could just load/contain a JSON of the site hierarchy, which is a collection of SAFE:// links to content. This would be slower, but more in the vein of users owning their content.

Apologies if I’m rehashing ideas from up the thread, I’m just trying to put them in context of the browser for myself.

1 Like

Ohh. And then i saw I’d missed this:

So an App can create a new datatype? Like: MyAwesomeSite12312435, which then anyone can use? So the App could theoretically grab anything with this datatype? And then deal with it as it pleases?

4 Likes

I think you have what I was trying to say a bit backwards man, you got most of it right except for one point. The site isn’t the currated platform, the site IS the information being currated. The “platform” is your browser that you use to browse various websites and other content. When you go on youtube and make a playlist of videos you are currating the videos, you are collecting and sorting them. But that doesn’t change the platform you are using to curate them with. What I’m saying is instead of building a CMS where people individually curate stuff build an open source browser app and then let people put their stuff out there for others to curate.

What’s the difference between all the different blogs out there? Their content! But the blogs are essentially the same. We don’t need to own the factory that builds the site or lets us collect stuff we just want to publish our stuff and be able to efficiently collect what others have put out there. A website essentially is an IDEA. A design, an arrangement, a style and an assortment of information and content. If a website is a lump of clay, a blog is a pot then consider one’s website to be a personalized and stylized painted and glazed vase depicting a moment in their lives. We don’t need to focus ownership on clay or pots, we need to give people ownership of their DATA and content because that’s where their lives are at. Anoher metaphor would be that a generic blog would be equivilant to a flute but the content is the music you play with it. Now its entirely possible to custom design, or even carve one’s own personal instrument and THAT is a form of self expression but it’s not the flute itself, or the wood, that’s special but rather the personalization therein and self being expressed in the act of creation. Meaning it’s more important to give someone the ability to stylize their experience (themes, content) than obsess about owning individual central points TO express one’s experience.

Build a browser, let people customize it in every way shape and form. When someone comes to a website they are experiencing a configuration that we express as a location because that’s how we conceptualize it as 3D human beings. But the reality is your web browser is more like your own personal space ship, or even your own skull. So what you are doing is collecting configurations. When you go to safe://www.whatever.com they’ll have a site that expresses who they are. But let’s face it there are just so many ways you can organize a website. So what’s unique is THEIR particular style. Would anyone be upset if someone else had a 3 column website or used Times New Roman? No! They would be upset if you used their brand or perhaps plaguarized them (well some people would, others would be complimented) but the point is what is owned is unique personal content not the generic blog, not the clay pot. You getting what I’m saying?

So what needs to be shared are things like css stylesheets, the blogs, the pics and videos, maybe blog configuration templates, comments, likes, that kind of thing. And the app itself would help one generate all that stuff. Think dreamweaver had a baby with Friendica and got Pintrest to babysit or something like that.

Look let’s break this down. Say someone said they wanted to build a blog? Okay then! How much detail do you want to put into it? “Just give me a blog… Um a red one.” Okay then sir we have a bunch of stored templates on file. Picking one at random and coloring it with a red stylesheet and storing said stylesheet on your safespace. Now what data do you want to put on it? “Um all these pics and all these posts here.” Righto Sir and do you want to style it any particular way “Yeah just stick all the pics in a gallery and make it all look professional.” Yes sir! Picking a random picture gallery from our archives and a random professional template. “Wait I don’t like that one let me see more.” Okay Sir here is the community archives, feel free to browse away. “Uh I found one but I don’t like this part.” “Okay Sir, you can change that right here.” “Awesome I’m done. Publish it!”

You need to plan for both simple as well as creative. Basically all we’d need is a public group of some kind, a repository for various bits of content. You could keep your content private or push it to various repositories with various permisions and said permisions and repository lists could be stored on your safespace in a text file or similar. Doesn’t need to be huge. As I recall SAFE has it’s own public/private permissons. So this should be workable. All the app needs to know is what content you want to share and what content you don’t, or perhaps assume you don’t want to share anything and just know which files you do and how much. Others collect, utilize and subscribe to this content.

Why would the time of replies be an issue? Just add a timestamp. The end viewer doesn’t even need to see it an A.I. could easily sort according to time and just hide the actual time from view. If user a comments at 1:00 and user b comments at 1:01 obviously they’re in sequence. As for following a conversation if user A says something and user B replies then user B has subscribed to the conversation and is following it. Where’s the confusion?

2 Likes

Wall of text alert! Seriously man, what you have to say is pretty interesting but it makes it really hard to read with such huge paragraphs.

2 Likes

I edited it. Any better?

Oh and was just thinking, from what I’ve heard about the new StructuredData additions where you can custom design data types and watermark data that could definitely be applied here to creating SAFEpress. Say we created a data type called “blogs”, “banner”, “comments”, “likes”, etc and watermarked such data according to who created them. So if someone creates a blog post their key watermarks it as theirs and so there’s no confusion about who owns it or who’s safespace it’s stored on.

Keep in mind I have no idea how to code all this but the logic seems to work.

@Blindsite2k, I may be missing something here but I think what you are proposing is for the SAFE Network to hold the shared data of a site (such as text/html/xml/whatever) and have the end user render that data in any form of a display they choose with templates,etc that they store and own… This is a great idea and very interesting, but seems to be a very different project than creating an entire WordPress type app with all its plug and play and built in features for the SAFE Network as @happybeing initially proposed with this thread…I think the biggest hurdle is not the themes, but figuring out the new “backend” to use on SAFE to work with its decentralized/server-less nature.

1 Like

This is a good point, we’ll need to be careful about leakage where we can. The IDs will be anonymous and untracable, but we should only expose what has to be exposed.

Me too Josh, and although I’m enthusiastic about PouchDB I’m not yet convinced we need it. But that choice will come later. I think we can begin to set up some targets and see if we can hit them, which could be very simple to begin. Imagine just having a simple tool that can import a WordPress blog onto SAFE, which can then natively accept comments and new posts. It would be massive to have that early on. Or even a tool that lets existing web devs create a website directly on SAFE using only the HTML / CSS skills they already know.

I’m gonna say this isn’t possible, but half expect someone to chip in with, “well not immediately but in a wee while…” :wink: As I said to @seneca, I don’t think the lack of this is a limitation for us, certainly not for a curated site.

Sounds fun. We definitely need the team to explain our options here. I’ve read what there is about structured data but I know I don’t understand a tenth of what it can do. :frowning:

This is not SAFEpress as currently envisaged. This is decentralised twitter/facebook (and as you note) youtube etc. WordPress and the kinds of sites it is used to build are the model for SAFEpress. I’m very interested in the decentralised-social self-curated platform, but that’s for another project thread, so I’ll start spinning those post out into a new thread if people want to explore that more, so we can keep SAFEpress focussed and people can choose which way to go. Maybe the alternative will get more interest and devs, let’s see.

Just got to @mvanzyl’s response - you got it. We’re discussing two separate applications on this thread and its going to get confusing! Great discussions, let’s just keep SAFEpress to one, and kick off a new thread if folks want to continue discussion of fully decentralised stuff.

1 Like

Possibilities are virtually unlimited. In case of websites, perhaps you can compare a particular type of StructuredData to a particular table in a relational database. A particular instance of such a type could be compared with a row in that table.

The website is a a file that links to other files. In the past we have built web apps based on a centralized concept where we use databases and have users register with the website. What I am pointing out is that on SAFE people own their own data, are already logged into the network and therefore this model of having the website as the central point will not work! The website is no longer the town square, the network is. The website is either acting as an object or an entity but not as a central controlling nexus. That’s the difference. Complain about it or create a new thread of you will but that’s pretty much internet 1.0 vs 2.0. SAFEpress as it was orignally envisioned was still based on the idea of having a website as the central point. That is trying to take a old concept and apply it to the new technology. I’m sorry if my telling you that that will not work made you unhappy. I’m not trying to create a decentralized social network or youtube or whatever, tho that could obviously develop out of all this and given how people use their websites there really isn’t that much difference. What I’m trying to do is explain the implications of having a decentralized internet and everyone owning their data and the possibilities and applications maidsafe allows us to utilize.

If you want a website as a central point then just make a static site. But when designing dynamic features remember that users own their own data and we’re in a decentralized internet, not a centralized one. That means content needs to be exchanged. What do you do when you install wordpress? Step 1 download the software. Step 2 install it on your server. Step 3: configure it. Step 4: Download some sparkly themes and what not. Step 5 add content. On SAFE SAFEpress would be “installed” by linking to it. Boom it’s downloaded in two seconds and you forever have access to it whenever you want. What’s left? Configuration. So that means a config file of some kind. Themes and addons? Again more linking and paying a bit of safecoin to store on your safespace. Boom. That leaves content which is presumably on the users safespace or hard drive or yet to be created. When someone logs into the new website their comments and such are stored on their own space. How does that turn a web blog into facebook? How does using one’s public key to identify comments and likes and such or watermark one’s content as one’s own turn a website into twitter?

@Blindsite2k, in order for an app like SAFEpress to work, the actual functionality of the app needs to be kept somewhere. For example, if someone wants to make a website with baked in features such as a shopping cart or photo carousel with a few clicks of a button, as WordPress can currently provide, the code that enables these features to be available/executed needs to be stored somewhere, weather that is on a centralized server as the old internet model would use or on a decentralized database such as SAFE. The challenge is figuring out how to port all the features that a program like WordPress can provide that were created for a centralized database to a decentralized one (SAFE).

1 Like

The app would be uploaded to some space and others could just link to it. The database of the user’s data would be stored on the user’s space (as I have previoiusly described).

Well there in lies the rub as Wordpress uses php for it’s database and we’re looking at using javascript or something entirely different for ours. Also all of this needs to be coded.

You are correct until the “presumption” you make here. SAFEpress is like WordPress, the website owner owns and curates the content. That’s the distinction I’m makeing between a WordPress website and decentralised facebook, if you want users to curate and own the content, then it isn’t SAFEpress.

2 Likes

I wondered if there was something like this but then dismissed it as (my) fantasy. I need to hear this or something more detailed about how SD can be used from @dirvine (PS David, I’ve been back from holidays for several days now so prepare to be pestered again soonish ;-))

If @seneca is half right here and I’ve no reason to doubt him except for my “until I hear it from David” skeptic, then this would be amazing and I can start re-thinking how to do this.

Mean time I’m hacking together a simple website for SAFEpress :-). BTW we have http://twitter.com/safepress so please follow if you have a twitter account (11 followers in < 24 hours without asking any favours is not bad :-))

You own what you create. The website creator doesn’t own my comments or otherwise own MY content. And if you’re trying to build something that insists on owning and controlling all content on the site then no I don’t agree with your vision one bit. That’s far too authoritarian for me. That’s why I want to be on maidsafe, to get away from people and systems like that.

1 Like

That’s fair enough @Blindsite2k, I’m seeing a need for both approaches. You may be right, but I think we need to be able to build sites that work in a variety of ways and I’m supportive of both, and for us to create new models that we haven’t thought of yet. SAFEpress is as I’ve described, unless as a community of interested people we change that, but I’ve billed it as “like WordPress for SAFE Network” and that includes the website owner getting to curate what appears within their domain. As I said, I’m enthusiastic to discuss a completely decentralised approach, but not on this thread.

1 Like