Skip to content

Using elm-open-api to generate the API for the RealWorld app.

License

Notifications You must be signed in to change notification settings

wolfadex/realworld-app

 
 

Repository files navigation

RealWorld Example App

A codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

This codebase was created to demonstrate using elm-open-api for all API operations.

This codebase is forked from the Elm Land RealWorld app to provide an easy to compare diff of hand writting the API vs generating it from an OpenAPI spec.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

How it works

The file Api.elm is generated from the OpenAPI spec ./openapi.yml using elm-open-api, then used within the rest of the application.

This application was built with Elm Land, a production-ready framework for building Elm applications.

Check out the the source code to get a feel for the project structure!

openapi.yml
generate/
  Api.elm
src/
  Api/...
  Components/...
  Pages/...
  Utils/...
  Shared.elm
  Ports.elm

Getting started

npm install
npm run gen-api
npm run dev

Versioning

The main branch will always be setup to use the latest verison of elm-open-api. If you'd like to see the differences with an older version, refer to the changelog for which version of elm-open-api matches with which state of this repo.

About

Using elm-open-api to generate the API for the RealWorld app.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elm 99.4%
  • Other 0.6%