Skip Navigation

Members
0
Posts
5
Created
2 mo. ago

Decentralized Microfrontend Architecture

image IMPORTANT DISCLAIMER: This is my own project. I am using AI. Its important to get that out of the way... because its the key reason for why YOU SHOULD NOT USE IT. Im not trying to promote "yet another secure messaging app", this is an example to see what is possible with a related UI framework im working on ( https://github.com/positive-intentions/dim ). Its unreviewed, unaudited and far from finished. This framework is intended for myself on my own projects. It is provided open-source for transparency, testing and demo purposes only. There will be breaking changes. • Messaging app repo: https://github.com/positive-intentions/dimim • Live demo: https://dim.glitr.io/ • Framework guide: https://glitr.io/docs/technical/research-and-development/dim/getting-started The key details that set this approach apart: • No installation or registration • No minification or transpilation • No React, NPM or bundler • Works from index.html To make something complicated at scale, i would need to have an approach for testing out changes in a way thats more isolated/focused. The npm ecosystem is useful because you can have things like storybook, unit-testing and browser automation tools. So i wanted to see what is possible with the pure javascript approach and created runTests.html. Like the main app, the code is just plain javascript and so it can be imported and tested in with production statics. The testing functionality here is especially far from finished. This is an important feature to do it properly because it would be doing a lot of heavy lifting as the project improves. The architecture is also a bit unique. Module federation has been around for a while but still fairly under-used. Im aiming for something that could be described as like a vanilla JS "decentralized microfrontend architecture", where in this approach, i can abstract complexity into seperate repositories to manage reusble functionality like in the boilerplate example: • Code: https://github.com/positive-intentions/dim-boilerplate • Demo: https://positive-intentions.github.io/dim-boilerplate • Docs: https://glitr.io/docs/technical/research-and-development/dim/dim-boilerplate To avoid vibecoded cryptography, the aim here is to avoid handling encryption where possible. Browsers that support webrtc, will have their own mechanisms for managing encryption (as required by the spec). The keys will not be accessible from app-level JS code. For security best-practice, users should use an OS, browser and network they trust. P.S. The disclaimer above is always worth repeating. Im aiming for a post like this to be like "building in public". If interesting to anyone, i hope its inviting to take a look. It's hard to determine if / when its a good time to share, so best to get it out there sooner for any outstanding issues i may have overlooked.

A React-like JS Framework with Web Components

I was investigating an idea i had about JSX-like syntax for webcomponents after some experience with Lit. I am sharing this here because it might be interesting/educational. Lit is a nice lightweight UI framework, but i didnt like that it was using class-based components. It can support React with a wrapper, buts React is fundamentally an abstraction away from the DOM. Vue has a nice approach but i prefer working with the syntax that React uses. I find it more intuitive for debugging and deterministic rendering. I wondered if with webcomponents, i could create a UI framework that didnt need to be transpiled. • docs • code • demo My intentions with this framework is to get to a reasonable level of stability, to then replace React on some of my existing projects. I made a start by creating some basic reusable ui components components to be built with the js framework. Aiming for something like Material UI. • code • demo I can then simmer that slop into some basic UI demos: • Shopping app demo • Messaging app demo • Encrypted Notes app demo To better demonstrate the pure javascript approach, i created an example of using a minimal amount of tooling for a PWA. The aim here is to keep the application logic in readable js and abstract the framework logic away from the developer for better DX. • code • demo To simplify things for myself, i added something similar to module-federation where i can fetch the dim dependencies from remote instead of publishing to npm. The approach has tradoffs worth considering and is still a work in progress.

Browser-based LLM Chatbot

To help users on the Glitr.io app, it was important to document the details around the “how it works”. Using Docusaurus, I can then index that data (like used in the Docusaurus search) to be consumed by some script locally and offer suggested links. I framed this as like a chatbot so that it can be intuitive for users who have questions. At first it was only a fancy autocomplete. I then wanted to investigate running a local LLM to offer a more conversational experience (or better suggestions)? I'm using WebLLM on a browser and it seems to work “reasonably” well. I wired it up and set it up so users can select an LLM to download for offline use. The experience varies between devices and models used. There are models that are 19MB… they seem pretty unusable. There are also some ~1GB models which are better but understandably slow. I hope to add more models available and users can choose one that suits them (or none). Without an AI, i hope the "fancy autocomplete" can fill in the gaps. Its great that the ~1GB models can “show me the bubble-sort in rust”, but i want something “dumber” to aim for smaller (im assuming a ~1GB download from the onset would be off-putting for most users). Ideally, something can can take advantage the data ive already indexed. Something that can respond “quickly enough” for a conversational flow on a "modern" phone. Im aiming for a good user-experience more than trying to wedge in an LLM... and a fancy autocomplete might be enough if i create the appropriate coachmarks and docs. It might be better to scrap the LLM in chat approach and have context aware templates instead for a "fancier autocomplete". Are there any smaller language models out there im overlooking for me to investigate and compare? • Find out more: https://glitr.io/docs/technical/ai • Test it out: https://app.glitr.io/ai Note: I hope it goes without saying, this is not ever going to be competative against offerings out there like ChatGPT, Claude, Grok, etc. This project is experiemental and unstable. Its far from finished. Im still trying things out. Use responsibly.

Reverse engineering my own project

TLDR; i thought my project would have been harder to chew up. it was surprisingly low-effort. ——— i wanted to red-team myself on my project and id like to know how to reverse engineer so i can see what can be done to defend against it. my app is aiming to be fully client-side. An implementation in javascript seems like it would relatively easy for an AI to swallow. my latest project is in rust, which would make it harder for a person, but AI can now digest binaries. i created a fairly unique p2p messaging app. a rust-based frontend with a rit-server backend, which can be used to establish a p2p connection. while this version remains close-source, i aimed to create comprehensive technical documentation (formal-verification and security audits too (all ai-slop-maxxing at scale under my guidance)). 1. https://glitr.io/ 2. https://app.glitr.io/ a core detail to my project is the focus on client-side cryptography and storage. i think my older iteration as a javascript webapp would be relatively easy for AI, so i thought id put a spin-on-things by having a rust wasm frontend. In practice, i dont think AI broke a sweat. i know nothing about decompiling, but i think the TUI would be the easiest for it to decompile... and given its largly one codebase for all the platforms, it can be used to trace and see what is going on in the builds for the other platforms. it might be that all close source is obselete. i tried asking here, and the responses there are polar opposites, so i decided to get some first-hand experience. i used cursor's "auto" agent (in contrast to the frontier models available). i used https://github.com/morluto/rea and tried to make it easier by proving it with a few binaries of my project (tui, apk, web, desktop) and pointed it to the documentation as a website. after a few prompts, it seems to have done a decent job decompiling the project here: https://github.com/positive-intentions/glitr-decompiled (note: this is basically AI-slop) like with many projects, i see AI lacks taste in architecture. it consolidates a lot of complexity into one repo, when in my project it's split into multiple repos. it also seems to lack a bunch of bells-and-whistles i added for my own benefit like formal-verification and rigorous unit-tests. having done it myself before, i dont think that it's a large gap to close for somone who knows what they're doing. i think the overhead to keep up with new changes may become trivial if you can automate the process of ingesting new binaries. i kinda offer the base in the repo above (maybe it saves you a few tokens?), but its for my own research and i dont plan to maintain it given it undermines the actual project. in general, im impressed considering how fast and low effort this was. it seems this may push forward my timeline for when i open source my project, i wasnt expecting client-side close-source being so easy to undemine. while the project can be decompiled, in a project like this, its important to consider the countless nuances there are in software development and cybersecurity. the code is only a fraction of the project. i think people should try this in their own code. while the decompiled output is not the same codebase, it seems trivial for me to take some unfamiliar app and rebuild a protocol-compatible version with some new button, feature... or auto-installing malware. (note: feel free to try decompile this yourself or offer tips on how i can improve. id be keen to see what can be done. feel free to reach out for clarity about how it works if the docs are not clear)

github.com

Combining Git, Tor and WebRTC into a Messaging App

image It's a fairly a unique stack and architecture in contrast to the traditional approach with mainstream messaging apps. To put it briefly, its a Rust-based frontend with a Git-server backend, which can be used to establish a E2EE connection. Features: • No installation • No registration • PWA • Android • TUI • WebRTC • Tor routing • TURN server • Git-host backend • Local-first • Encrypted-at-rest • Signal protocol • Post Quantum cryptography • Calls • File-transfer image Note: Its still a work in progress and there will be breaking changes. Roadmap: https://glitr.io/docs/technical/roadmap IMPORTANT DISCLAIMER: While this is aiming to provide a secure experience, it's a work-in-progress and far from finished. It is unreviewed and unaudited. I'm sharing here for testing, feedback and demo purposes only. Pease use it responsibly. image