|
1 | 1 | # UnityAuth |
2 | 2 |
|
3 | | -UnityAuth is a comprehensive authentication and authorization service built with modern microservices architecture. It provides JWT-based authentication, user management, and a web-based administration interface. |
| 3 | +UnityAuth is a comprehensive authentication and authorization service built with modern |
| 4 | +microservices architecture. It provides JWT-based authentication, user management, and |
| 5 | +a web-based administration interface. |
| 6 | + |
| 7 | +## QuickStart |
| 8 | + |
| 9 | +### Local Environment |
| 10 | +From the project root, copy `setenv.sh.example` into `setenv.sh` and update the correct |
| 11 | +environment variable values. |
| 12 | +* If used together with Libre311 project |
| 13 | +(https://github.com/UnityFoundation-io/Libre311.git), `LIBRE311_UI_BASE_URL` must be updated |
| 14 | +to base URL of Libre311 UI. |
| 15 | +* If use a local database, also update the `DATASOURCES_DEFAULT_*` environment variables |
| 16 | + for the corresponding database. |
| 17 | + |
| 18 | +Run the UnityAuth API with: |
| 19 | +```shell |
| 20 | +source setenv.sh |
| 21 | +cd UnityAuth |
| 22 | +./gradlew run |
| 23 | +``` |
4 | 24 |
|
5 | | -## Local Development QuickStart |
| 25 | +Run the UnityAuth UI in another terminal windows: |
| 26 | +```shell |
| 27 | +source setenv.sh |
| 28 | +cd frontend |
| 29 | +npm install |
| 30 | +npm run dev |
| 31 | +``` |
6 | 32 |
|
| 33 | +### Docker Environment |
7 | 34 | To launch the auth service, you can use the docker compose from the project root: |
8 | 35 |
|
9 | 36 | ```sh |
10 | 37 | docker compose -f docker-compose.local.yml up |
11 | 38 | ``` |
12 | 39 |
|
13 | | -This will start: |
| 40 | +This will start containers for the UnityAuth API, UI and database server with service |
| 41 | +names `unity-auth-api`, `unity-auth-ui`, and `unity-auth-db`, respectively. |
14 | 42 |
|
15 | | -- **UnityAuth API** on http://localhost:8081 (or http://unity-auth-api:8081) |
16 | | -- **UnityAuth UI** on http://localhost:3001 (or http://unity-auth-ui:3001) |
17 | | -- **MySQL Database** for data persistence |
| 43 | +- **UnityAuth API** on http://localhost:9090 (inside Docker http://unity-auth-api:9090) |
| 44 | +- **UnityAuth UI** on http://localhost:3001 (inside Docker http://unity-auth-ui:3000) |
| 45 | +- **MySQL Database** is open on port `13306` in `localhost` (within Docker is port `3306` |
| 46 | + with host name `unity-auth-db`) |
18 | 47 |
|
19 | | -### Hosts File Updates |
| 48 | +#### Hosts File Updates |
20 | 49 |
|
21 | | -For consistent internal-external service name resolution, add these to your `/etc/hosts` file |
| 50 | +When using Docker environment, add these to your `/etc/hosts` file |
| 51 | +for consistent internal-external service name resolution: |
22 | 52 |
|
23 | 53 | ```txt |
24 | 54 | 127.0.0.1 unity-auth-api |
25 | 55 | 127.0.0.1 unity-auth-ui |
26 | | -127.0.0.1 libre311-api |
27 | | -127.0.0.1 libre311-ui |
28 | 56 | ``` |
29 | 57 |
|
30 | 58 | You can log in with these accounts. |
|
0 commit comments