An example of a real project in F #

In the Microsoft ecosystem, F # takes the place of an experimental language, from which successful concepts are subsequently carried over to C #. At the same time, thanks in large part to the community, minced meat has become a real alternative for applied projects. Under the cut, the ingredients of the backend, frontend, tests, assembly and infrastructure of a project written entirely in F # are described. The source code is attached.









Container diagram
Container diagram





SAFe

, , SAFe Stack. SAFe dotnet CLI, SPA . .





SAF . . , , , SAFe. 





- ‘S’ - Saturn - Giraffe, , , Asp.net. 





- ‘A’ - Azure. - SAFe, , , , Farmer, , SAFe.





- ‘F’ - Fable - F# JavaScript - .





API Fable.Remoting. Fable.Remoting -. , , ( ). API , ( , , , ) . JSON, .





, , Fable.Remoting, Saturn - Giraffe - Asp.Net. , , Giraffe.





OpenAPI, GiraffeGenerator.





, NoSql DynamoDB. DynamoDb.Ok. Reader. , , . . , , .





C F# . F# Entity Framework Dapper.





: 1, 2 3. , Flexible Types, .





Serilog, Giraffe.





JWT.





AWS AWSSDK, HTTP, SDK .





F# - Fable,  JS. JS. (binding) , .. React .





Elmish - Elm-. Fable.React Bulma.





.





let quizView (dispatch : Msg -> unit) (settings:Settings) (quiz:QuizRecord) l10n = [
   br []
   figure [ Class "image is-128x128"; Style [Display DisplayOptions.InlineBlock] ] [ img [ Src <| Infra.urlForMediaImgSafe settings.MediaHost quiz.ImgKey ] ]
   br []
   h3 [Class "title is-3"] [str quiz.Name]
 
   div [Class "notification is-white"][
       p [Class "subtitle is-5"][
           match quiz.StartTime with
           | Some dt -> str (dt.ToString("yyyy-MM-dd HH:mm"))
           | None -> str "???"
 
           if quiz.Status = Live then
               str " "
               span [Class "tag is-danger is-light"][str "live"]
           br[]
       ]
 
       p [] (splitByLines quiz.Description)
 
       if quiz.EventPage <> "" then
           a[Href quiz.EventPage][str l10n.Details]
    ]
]
      
      







- The Elmish Book.





, , Elmish + Fable.React + Boolma . 2021 , , Feliz + Fable.React.WebComponent + Material UI - Fable.Svetle. .





Aws, AppSync, Aws Amplify.





. ( JMeter ). 





. , F#. . , . FsUnit expecto. , , , , .





, :





  • FsCheck -





  • Canopy - DSL UI





  • NBomber -





Paket. Fake. SAFe. , - , , . , .





AWS Cloud Development Kit. F# , , C#. 





. SAFe . , -.





. , , C#. VSCode Ionide. , , - - . , , , . Ionide Rider. , , .





Ionide, ILSpy, , .





, F# . , . FSI.





As of early 2021, F # is suitable for small to medium sized application projects. For me, the advantages of this language are:





  • front-end development ecosystem,





  • type system,





  • compact syntax.





Until these features appear in C #, other things being equal, my choice will be in favor of mince.





project source code





An encouragement picture for those who have read this article to the end.
An encouragement picture for those who have read this article to the end.








All Articles