|
| 1 | +# Quickstart: Angular app with FusionAuth |
| 2 | + |
| 3 | +This repository contains an Angular app that works with a locally running instance of [FusionAuth](https://fusionauth.io/), the authentication and authorization platform. |
| 4 | + |
| 5 | +## Setup |
| 6 | + |
| 7 | +### Prerequisites |
| 8 | +- [Node](https://nodejs.org/en/download/): This will be needed to run the Angular app. |
| 9 | +- [Docker](https://www.docker.com): The quickest way to stand up FusionAuth. |
| 10 | + - (Alternatively, you can [Install FusionAuth Manually](https://fusionauth.io/docs/v1/tech/installation-guide/)). |
| 11 | + |
| 12 | +### FusionAuth Installation via Docker |
| 13 | + |
| 14 | +In the root of this project directory (next to this README) are two files [a Docker compose file](./docker-compose.yml) and an [environment variables configuration file](./.env). Assuming you have Docker installed on your machine, you can stand up FusionAuth up on your machine with: |
| 15 | + |
| 16 | +``` |
| 17 | +docker-compose up -d |
| 18 | +``` |
| 19 | + |
| 20 | +The FusionAuth configuration files also make use of a unique feature of FusionAuth, called [Kickstart](https://fusionauth.io/docs/v1/tech/installation-guide/kickstart): when FusionAuth comes up for the first time, it will look at the [Kickstart file](./kickstart/kickstart.json) and mimic API calls to configure FusionAuth for use when it is first run. |
| 21 | + |
| 22 | +> **NOTE**: If you ever want to reset the FusionAuth system, delete the volumes created by docker-compose by executing `docker-compose down -v`. |
| 23 | +
|
| 24 | +FusionAuth will be initially configured with these settings: |
| 25 | + |
| 26 | +* Your client Id is: `e9fdb985-9173-4e01-9d73-ac2d60d1dc8e` |
| 27 | +* Your client secret is: `super-secret-secret-that-should-be-regenerated-for-production` |
| 28 | +* Your example username is `richard@example.com` and your password is `password`. |
| 29 | +* Your admin username is `admin@example.com` and your password is `password`. |
| 30 | +* Your fusionAuthBaseUrl is 'http://localhost:9011/' |
| 31 | + |
| 32 | +You can log into the [FusionAuth admin UI](http://localhost:9011/admin) and look around if you want, but with Docker/Kickstart you don't need to. |
| 33 | + |
| 34 | +### Angular complete-application |
| 35 | + |
| 36 | +The `complete-application` directory contains a minimal Angular app configured to authenticate with locally running FusionAuth. |
| 37 | + |
| 38 | +Install dependencies and run the Angular app with: |
| 39 | +``` |
| 40 | +cd complete-application |
| 41 | +npm i |
| 42 | +npm start |
| 43 | +``` |
| 44 | + |
| 45 | +Now vist the Angular app at [http://localhost:4200](http://localhost:4200) |
| 46 | +You can log in with a user preconfigured during Kickstart, `richard@example.com` with the password of `password`. |
| 47 | + |
| 48 | +### Further Information |
| 49 | + |
| 50 | +Visit https://fusionauth.io/quickstarts/quickstart-javascript-angular-web for a step by step guide on how to build this Angular app integrated with FusionAuth from scratch. |
| 51 | + |
| 52 | +### Troubleshooting |
| 53 | + |
| 54 | +* I get `This site can’t be reached localhost refused to connect.` when I click the Login button |
| 55 | + |
| 56 | +Ensure FusionAuth is running in the Docker container. You should be able to login as the admin user, `admin@example.com` with the password of `password` at http://localhost:9011/admin |
0 commit comments