mwmbl / front-end

New SvelteKit-based front-end for Mwmbl
https://alpha.mwmbl.org/
GNU Affero General Public License v3.0
0 stars 0 forks source link

Initial phase: tracking issue #1

Open xynydev opened 2 months ago

xynydev commented 2 months ago

Moved from PR https://github.com/mwmbl/mwmbl/pull/203

Screenshots

Removed; see for an updated view of progress https://alpha.mwmbl.org/.

Design

The current design is loosely based on this image posted on the Matrix by Daoud showcasing a design draft by @realmytheman on the Matrix channel (who does not appear to be using Matrix anymore). It's still missing most of the basic correct design details: fonts, colors, gradients, correct icons and rounding constants.

I'm hoping to get in touch with @realmytheman either in this thread or on Discord if that's not possible, to figure out the design details and collaborate on the design.

Edit: We are now drafting designs on Figma and talking in a private Discord group.

Technical decisions

Framework and programming language

I opted for using SvelteKit (with Svelte 5 (runes) preview, though that may be reconsidered if issues arise) and TypeScript, because it is a combination I find very pleasing to work with, while enforcing a structured codebase and supporting filesystem routing. Svelte is especially nice since it works through kind of a compiler, making the client bundle smaller and more efficient. The new rune system with Svelte 5 implements a signal-based reactivity system very similar to other popular frameworks, which should make it pretty easy to adopt for developers new to Svelte.

CSS and UI

I opted for using TailwindCSS for styling, since it makes it easy to develop style and layout alongside the semantic HTML structure, without having to come up with classnames or context-switch to CSS. Additionally, it works as it's own standard and has nice defaults, making it possible to read HTML and understand how it looks, without having to learn what a bunch of custom classnames look like.

I like to pair Tailwind with shadcn-svelte, which is a "component library", a set of accessible and well-styled (with Tailwind) prebuilt components that are inserted directly into the codebase where they are used. shadcn-svelte is great because you always get something functional and accessible that follows best practices, while getting free rein to customize components as you see fit.

Misc

Where to host?

SvelteKit can be trivially hosted on any platform for which an adapter exists. I've personally enjoyed "serverless" PaaS hosting on Cloudflare Pages, which does not charge for bandwidth, which should be enough to prevent Mwmbl from getting a $104K hosting bill.

Hosting on bare metal (or VPS) is also possible with the NodeJS adapter, if hosting the frontend in the same place as the backend would be preferred.

TODO