Skip to content

About

SPA client for the PeopleAPI sample

Resources

Stars

11 stars

Watchers

4 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PeopleAPI Client

A single-page application built with WebSharper.Mvu (WebSharper's Model-View-Update architecture) and WebSharper.UI. It manages a list of people — create, edit, delete — with client-side routing.

PeopleAPI Client screenshot

This is the front end of a client/server pair. It calls the sibling PeopleAPI sample over REST and shares that API's model (PersonData, EndPoint, ApiEndPoint, …) through a project reference, so the two sides stay in sync by construction.

What it demonstrates

  • The MVU pattern: typed Model, Message, Update and View.
  • Composition of independent pages (PeopleList, Creating, Editing) with WebSharper.Mvu's Page.Single / Page.Create.
  • Client-side routing with WebSharper.Sitelets infer routers.
  • Calling a typed REST API: the client reuses the PeopleAPI model and its inferred router (Router.Infer<EndPoint>() + Router.FetchWith).

Running locally

Start the API first, then the client, in two terminals:

cd ../PeopleAPI
dotnet run --project src      # http://localhost:5585
dotnet run --project src      # http://localhost:5479

Then open http://localhost:5479.

The client calls the API at http://localhost:5585 (see BaseUrl in src/Update.fs), and the API allows the client's origin via CORS (PeopleAPI/src/appsettings.json).

Building

dotnet build src/PeopleClient.fsproj -c Release

Because the client references the PeopleAPI project, both repos must be checked out side by side — the CI does this.

Deployment

Not deployed online: as the client half of a client/server pair, it is meant to be run together with PeopleAPI. CI builds it on every push.

About

SPA client for the PeopleAPI sample

Resources

Stars

11 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages