SAFE-Stack / docs

https://safe-stack.github.io/docs/
MIT License
145 stars 69 forks source link

Add lots of recipes #154

Open isaacabraham opened 4 years ago

isaacabraham commented 4 years ago

This is a tentative list of "recipes" or "how-to" guides that the docs should offer. Hopefully each should be relatively small and quick to author!

Upgrading from SAFE v1

Hosting

Build

Package Management

Client / server communication

Developing and Testing

Fable

UI

Server

Other Platforms

WebPack

Other

Security

theimowski commented 4 years ago

Here's a list of items I'd add / change. Most of these are due to us removing features in v2 compared to v1.

building and hosting

• How do I handle application versioning - As we remove support for RELEASE_NOTES and Version.fs with FAKE support for parsing, we need to explain how this can be done • How do I add / remove FAKE support? - similar to Paket, one might want this small change when starting with full / minimal template • How do I host inside Heroku? • Google cloud platform - separate section for App Engine and Kubernetes as @mastoj did those two awesome contributions

package management

• How do I use Yarn instead of NPM? • How do I add / remove paket support? - we should document both ways

client / server communication

• "How do I add support for Fable" - what do you mean?

dev & test

• How do I add support for remote container extension in VS Code?

fable

• How do I add support for fable reaction ?

ui

• How do I start with a Bulma template? - here we can create sample repos with all v1 layout options


Two more sections I'd add:

server

• How do I use Giraffe instead of Saturn? - we have users that want bare Giraffe

other platforms

• How do I share code between Web and Console application? - I can add that section given it's my actual commercial use case. In future we could expand it to Mobile (Xamarin) / Electron / etc.

isaacabraham commented 4 years ago

All added :-)

theimowski commented 4 years ago

I've moved a couple items in the list under proper group

Ulriksen commented 4 years ago

I'd very much love to see one on how to authenticate with Azure AD, preferably that the user is member of a specific group.

rastreus commented 4 years ago

I'd like to see a recipe on WebSockets and a recipe on integrating Akka.NET / Akkling.

This could possibly re-use the WebSockets with SAFE Stack blog post and the corresponding example code (safe-sockets).

SAFE-Chat is a nice demo app that leverages Akka and WebSockets, but it is older and uses Suave for the Server. It's not the same as a "How To Start" recipe.

Jmaharman commented 4 years ago

I recently added Tailwind to a SAFE template to try them both out. I'd be happy to create a recipe for that once the new minimal template is out and I have a recipe format to follow.

Jmaharman commented 4 years ago

One misconception I had coming into SAFE was thinking that it was a purpose built stack, I knew it was made out of a number of frameworks / libraries, but I didn't quite realise how much you could just play around with it from there. It's a starting point more than anything.

I think the way it is moving forward makes total sense, having a minimal template and a full template. It reminds me a little bit of hedycode, if you start using the full template there's too much going on to remember the important bits. Where as if you start with the minimal template and create recipes to help others add more content to their repo, they are then learning as they progress and realise why the full template does the things that it does.

You probably have these thoughts as well, but it won't hurt to hear them repeated. I think it should be very obvious to anyone reading the recipes that they are community driven, that they survive and grow based on community input. A very useful one is to make sure there is an edit link on the page for the reader to make changes, especially as recipes age and packages are updated with breaking changes.

It would be amazing to be able to see the history of the recipe based on the version of package being used, but I feel that is a whole other beast. A problem to solve if recipes are a success, rather than something to do upfront.

isaacabraham commented 4 years ago

We're working on a recipe template and are doing a few sample recipes to get it going. I'm hoping to start rolling them out next week :-)

markpattison commented 4 years ago

Recipe suggestion: How to serve up a file (created on the server) to a user.

Example workflow from the user's point of view:

  1. User presses button
  2. Front-end sends request with parameters to the server
  3. Server creates a file based on request
  4. User gets the usual "Download/open./save as..." dialogue in browser
kaashyapan commented 3 years ago

How do I add application configuration ? How do I add environment specific configuration ?

Following Don Syme's recent talk about memetic independence, I think it is an important area to cover for people who come from non .Net background.

A non-C# version of an application configuration walk through without use of Visual Studio and without assuming any prior .Net familiarity and in a location that is readily accessible as the Safe stack docs will be useful.

RicoSaupe commented 9 months ago

Question to that recipe "How do I share code between Web and Console applications?". What is the use case for that? You have some types or even Thoth decoders and use it in server project and a simple console app?

theimowski commented 9 months ago

Question to that recipe "How do I share code between Web and Console applications?". What is the use case for that? You have some types or even Thoth decoders and use it in server project and a simple console app?

I believe this might have been my idea. We do something like that at work - there's an agent running on a device that acts as 'backend' for the Fable app, so the same concepts of sharing code apply. Probably an edge case though, so might not be interesting for wider audience.

RicoSaupe commented 9 months ago

This could also be a use case for my work. Doing similar things, still using c# though but undergoing a transformation to F# now. Thanks to @isaacabraham

olivercoad commented 9 months ago

Sharing code with web and console applications is also something I've done at work with Elmish Bridge DotnetClient (as well as Remoting) for managing CAD projects. There's a background service (BGService) that runs on users' computers and sends/receives messages from the server, which broadcasts/receives messages from the Feliz Client and other BGService instances.

What would you think of naming it "How do I share code between Web and Dotnet client applications" (Or "... Console/Desktop applications")? A different project that never got off the ground had an Avalonia.FuncUI.Elmish component, but any dotnet desktop app that needs to share code with the server could probably benefit from the same recipe.

kaashyapan commented 8 months ago

I realized the difficulty was the unsafetiness of JSON. I ended up going with Bare serialization for client-server messages. It has a fable compatible nuget package with code generator. https://www.nuget.org/packages/bare-cli

kurt-mueller-osumc commented 3 months ago

I would love to see a recipe for adding jwt authentication to a safe stack app :)