#+title: Building a Social App with Spin #+date:[2023-11-19 Sun] #+author: HaQadosch #+startup: indent #+note: based on https://www.fermyon.com/blog/building-a-social-app-with-spin-1 #+link: article1 https://www.fermyon.com/blog/building-a-social-app-with-spin-1 #+link: article2 https://www.fermyon.com/blog/building-a-social-app-with-spin-2 #+link: article3 https://www.fermyon.com/blog/building-a-social-app-with-spin-3 #+link: article4 https://www.fermyon.com/blog/building-a-social-app-with-spin-3-5 #+link: article5 https://www.fermyon.com/blog/building-a-social-app-with-spin-4 * Org shortcuts ** Feetnotes[fn:1] - create footnote :: ~C-c C-x f~ - jump to the footnote ref :: ~C-c C-c~ * Article 1 ** Notes on [[article1:][article 1]] [fn:2] #+begin_quote Our primany goal this year is to empower developers to build real-world applications using the open-source *Spin* and the *Fermyon* platform projects or with *Spin* and *Fermyon Cloud*. #+end_quote #+begin_quote We're missing out on patterns like authentication, authorisation, CRUD micro-services, CICD, etc. #+end_quote It's a live documentation. We can explore the [[https://github.com/fermyon/code-things][repo]] and follow along the commits to see what is being done. Based on the activity in the [[https://github.com/orgs/fermyon/projects/13/views/1][project roadmap]] it's mostly all done already. Essential features: - POSTing and GETing some JSON - Creating a user profile - Authorisation on API endpoint - Persisting to a DB - Automating deployment This article focus is on: - Setting up a *Spin* project with - a module for the SPA - a module to allow us to create a user profile [[https://github.com/fermyon/code-things/compare/76c0206...feature/user-profile-api][Commits]] for the creating of user profile. Technologies used: - MySQL :: nah, we want *SQLite3*[fn:3] - VueJS :: seriously? Either *React* or the tryptique - REST Endpoint :: Why not *GRPC*[fn:4]? - Nothing is said but :: offline first would be so nice[fn:5] Looks like we're going to need 2 repos on top of this one: - One for the API - One for the SPA I'm going to try and follow along, to make sure I get the technology right but also create another version with the tech I would like to use instead. That is double the work but where would be the fun? The gimmick of the social app is to expand the comit link to the source code directly. It would be interesting to see if we can make it a bit like [[https://observablehq.com/][Observable]] or *org-mode* and have the snippet executable. *** TODO Issue for reading the article *** DONE Create API repo for RUST https://gittea.dev/HaQadosch/SpinSocial_RUSTAPI **** TODO Create template for Rust API **** TODO Make an app, any app, that works with Rust Just to get the feel for it and make sure you have all the libs installed. ***** TODO Follow the quickstart in Rust https://developer.fermyon.com/spin/v2/quickstart ***** TODO Follow the RUST tutorial https://developer.fermyon.com/spin/v2/rust-components *** DONE Create SPA repo for Vue https://gittea.dev/HaQadosch/SpinSocial_SPAVue *** TODO Create API repo for GRPC *** TODO Create API repo for HTML+CSS+JS *** TODO Make a template out of it and be able to create an instance of the social app easily *** TODO Make it an Activity Pub based and let multiple instance connect to each other * Footnotes [fn:5] [[https://automerge.org/][Automerge]] maybe ? [fn:4] [[https://buf.build/][Buf]] absolutely rocks. [fn:3] They have a [[https://www.sqlite.org/download.html][wasm]] version by the way. And they even have a [[https://www.fermyon.com/blog/noops-and-serverless-are-the-perfect-pair][tutorial]] for that! [fn:2] Or rather, how I understand it. [fn:1] If you put ~footnoes~, org-mode is too clever and will stick the notes there. So I name it feetnotes instead, which by the way should absolutily be the way to pluralise a footnote.