Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tutorial Web Application for @imqueue (REST edition)

The same Car-Wash tutorial front-end as web-app, with identical look and feel — but talking to the REST/OpenAPI gateway api-rest instead of GraphQL/Relay.

Every presentational component is reused unchanged from web-app. Only the data layer differs: Relay is replaced by a thin REST layer.

About the tutorial

This repo is one piece of the imqueue-sandbox tutorial — a complete car-wash booking app built from independent RPC microservices that communicate over a Redis-backed message queue.

Repo Role Store
user Customer accounts & their garage MongoDB
auth Login, JWT issuing & revocation Redis
car Car catalog (makes / models / types) in-memory
time-table Washing reservations & schedule PostgreSQL
api GraphQL gateway orchestrating the fleet
api-rest REST/OpenAPI gateway over the same fleet
web-app React front-end on api (GraphQL/Relay)
web-app-rest React front-end on api-rest (REST)

What differs from web-app

  • src/rest/client.js — REST client (adds the X-Auth-User token, normalizes errors).
  • src/rest/reactRelayShim.jsx — a react-relay compatibility shim (aliased in vite.config.js) so the reused components keep their react-relay imports while data arrives over REST. Fragment containers become transparent pass-throughs; the refetch container reloads reservations over REST.
  • src/rest/bus.js — a tiny invalidation bus that lets the data loader refresh in place after a mutation, reproducing Relay store reactivity.
  • src/relay/queries/* — REST query descriptors + the withQuery data-loader HOC.
  • src/relay/mutations/* — the same mutation functions, implemented as REST calls.

Usage

Point it at a running api-rest (default http://localhost:8080/, override with VITE_WEB_API_URL) and run:

npm start

The dev server listens on port 3001 (so it can run alongside the GraphQL web-app on 3000).

License

ISC License

About

REST edition of the @imqueue Car-Wash tutorial front-end

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages