https://github.com/olegzee/safe-crudapp
Fullstack application sample made with SAFE stack
https://github.com/olegzee/safe-crudapp
fable fsharp full-stack giraffe safe safe-stack
Last synced: 5 months ago
JSON representation
Fullstack application sample made with SAFE stack
- Host: GitHub
- URL: https://github.com/olegzee/safe-crudapp
- Owner: OlegZee
- Created: 2019-10-29T17:06:06.000Z (over 6 years ago)
- Default Branch: develop
- Last Pushed: 2022-12-11T11:19:48.000Z (over 3 years ago)
- Last Synced: 2024-07-30T18:21:49.826Z (over 1 year ago)
- Topics: fable, fsharp, full-stack, giraffe, safe, safe-stack
- Language: F#
- Size: 1.24 MB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://www.microsoft.com/net/download) 3 or newer
* install tools by running `dotnet tool restore` in the project folder
* The [Yarn](https://yarnpkg.com/lang/en/docs/install/) package manager (you can also use `npm` but the usage of `yarn` is encouraged).
* [Node LTS](https://nodejs.org/en/download/) 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:
```bash
cd src/server
dotnet run
```
* now navigate to [http://localhost:8085]
* if the database is new connect under admin/\, where pwd is some number you can find in server logs
`fake build target Run` starts development mode.