|
1 | | -# NGRX Hateoas |
| 1 | +# ngrx-hateoas |
2 | 2 |
|
3 | | -A library to bring hypermedia json into the ngrx signal store following the HATEOAS approach to make it easily useable within Angular. |
| 3 | +`ngrx-hateoas` is an Angular library for loading hypermedia JSON into the NgRx Signal Store, following related-resource links, editing state, and executing actions described by the backend. |
4 | 4 |
|
5 | | -## Repo Usage |
| 5 | +This repository contains the published library, an interactive playground with a local demo API, and the documentation website. |
6 | 6 |
|
7 | | -The repository provides the library itself, a playground app and a dummy backend which provides some Hypermedia Web APIs.`` |
| 7 | +## Project Links |
8 | 8 |
|
9 | | -To run the playground app clone the repository and run an `npm install`. Then start the backend with `npm run server` and the playground app with `npm start`. |
| 9 | +- [npm package](https://www.npmjs.com/package/@angular-architects/ngrx-hateoas) |
| 10 | +- [Library quick start](./libs/ngrx-hateoas/README.md) |
| 11 | +- [Documentation](https://angular-architects.github.io/ngrx-hateoas/) |
| 12 | +- [Getting Started guide](https://angular-architects.github.io/ngrx-hateoas/docs/guide/getting-started) |
| 13 | +- [Issues and feature requests](https://github.com/angular-architects/ngrx-hateoas/issues) |
10 | 14 |
|
11 | | -## Playground applicaiton |
| 15 | +## Repository Structure |
12 | 16 |
|
13 | | -Use and review the playground application inside the repository to understand how to use the library. Also you can review the http responses and requests in the browser network tab to get an impression of how hypermedia json can look like. |
| 17 | +| Path | Purpose | |
| 18 | +| --- | --- | |
| 19 | +| [`libs/ngrx-hateoas`](./libs/ngrx-hateoas) | Angular library source, public API, and unit tests | |
| 20 | +| [`apps/playground`](./apps/playground) | Angular application demonstrating the library | |
| 21 | +| [`apps/playground/server.js`](./apps/playground/server.js) | Local demo API | |
| 22 | +| [`apps/playground/db.json`](./apps/playground/db.json) | Data used by the local demo API | |
| 23 | +| [`doc`](./doc) | Docusaurus documentation website | |
14 | 24 |
|
15 | | -## Lib Usage |
16 | | -The library is available as npm package here: https://www.npmjs.com/package/@angular-architects/ngrx-hateoas |
| 25 | +## Install Dependencies |
17 | 26 |
|
18 | | -## Documentation |
19 | | -Find the documentation here: https://angular-architects.github.io/ngrx-hateoas/ |
| 27 | +Clone the repository and install the root workspace dependencies: |
20 | 28 |
|
21 | | -## Real World Sample Application |
22 | | -There is a sample application [Fancy.ResourceLinker.Sample](https://github.com/fancyDevelopment/Fancy.ResourceLinker.Sample) which demonstrates end to end real world usage of hypermedia in Angular and also some other aspects of a real wold system. |
| 29 | +```bash |
| 30 | +npm i |
| 31 | +``` |
| 32 | + |
| 33 | +## Run the Playground |
| 34 | + |
| 35 | +Start the demo API in one terminal: |
| 36 | + |
| 37 | +```bash |
| 38 | +npm run server |
| 39 | +``` |
| 40 | + |
| 41 | +The API listens on `http://localhost:5100`. |
| 42 | + |
| 43 | +Start the Angular playground in another terminal: |
| 44 | + |
| 45 | +```bash |
| 46 | +npm start |
| 47 | +``` |
| 48 | + |
| 49 | +Open `http://localhost:4200` and use the browser network tools to inspect the hypermedia responses and the requests derived from their links and actions. |
| 50 | + |
| 51 | +## Build and Verify the Library |
| 52 | + |
| 53 | +Build the Angular library: |
| 54 | + |
| 55 | +```bash |
| 56 | +npm run build |
| 57 | +``` |
| 58 | + |
| 59 | +Run the complete headless test suite with coverage: |
| 60 | + |
| 61 | +```bash |
| 62 | +npm run test |
| 63 | +``` |
| 64 | + |
| 65 | +Run linting: |
| 66 | + |
| 67 | +```bash |
| 68 | +npm run lint |
| 69 | +``` |
| 70 | + |
| 71 | +## Work on the Documentation |
| 72 | + |
| 73 | +The documentation website has its own dependencies. Install and start it from the `doc` directory: |
| 74 | + |
| 75 | +```bash |
| 76 | +cd doc |
| 77 | +npm i |
| 78 | +npm start |
| 79 | +``` |
| 80 | + |
| 81 | +Create a production documentation build with: |
| 82 | + |
| 83 | +```bash |
| 84 | +cd doc |
| 85 | +npm run build |
| 86 | +``` |
| 87 | + |
| 88 | +## Real-World Sample |
| 89 | + |
| 90 | +The [Fancy.ResourceLinker.Sample](https://github.com/fancyDevelopment/Fancy.ResourceLinker.Sample) project demonstrates end-to-end hypermedia usage with Angular and a .NET backend. |
| 91 | + |
| 92 | +## Contributing |
| 93 | + |
| 94 | +Bug reports, feature proposals, documentation improvements, and pull requests are welcome. Before opening a pull request, run the headless tests, library build, and lint checks described above. |
| 95 | + |
| 96 | +## License |
| 97 | + |
| 98 | +This project is licensed under the terms of the [repository license](./LICENSE). |
0 commit comments