Skip to content

Fullstack application sample made with SAFE stack

Notifications You must be signed in to change notification settings

OlegZee/SAFE-CrudApp

Repository files navigation

Expense recorder application

The application demonstrates what can be accomplished in 30-40 hours with SAFE stack with a very basic knowledge of the SAFE. Application features:

  • Giraffe based backend
  • using Postgres with F# Data Providers for persisting app data
  • simplistic REST Api
  • authentication and authorization
  • sharing F# code between client and server to ensure contracts
  • client routing to ensure application is navigation friendly
  • Fulma to build nice looking UI with a very basic HTML design skills

I would love to use some newer things to simplify say client-server communication (kudos to Zaid Ajaj) but I was asked to expose REST Api.

Install pre-requisites

You'll need to install the following pre-requisites in order to build SAFE applications:

  • The .NET Core SDK 3 or newer
  • install tools by running dotnet tool restore in the project folder
  • The Yarn package manager (you can also use npm but the usage of yarn is encouraged).
  • Node LTS installed for the front end components.

How to build

  • setup local Postgresql and roll out "expenses" database
  • restore database schema by running psql -d expenses -a -f create-db.sql from src/server folder
  • correct connection settings in src/server/DataAccess.fs
  • build using dotnet fake build command line

Now you could run the application:

cd src/server
dotnet run
  • now navigate to [http://localhost:8085]
  • if the database is new connect under admin/<pwd>, where pwd is some number you can find in server logs

fake build target Run starts development mode.

About

Fullstack application sample made with SAFE stack

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published