Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/brunofurmon/open-org-chart

An open-source Org Chart made in react
https://github.com/brunofurmon/open-org-chart

Last synced: 2 months ago
JSON representation

An open-source Org Chart made in react

Awesome Lists containing this project

README

        

# open-org-chart

An open-source Org Chart made in react

## Installation

```sh
make setup
```

## Configuration

The application can be configured by setting environment variables. The default values are set on the `.env.default` file, and you should modify the `.env` file to override them.

| Variable | Description | Default Value |
| ------------------------- | --------------------------------------------------------------------------------------------------------------- | -------------------- |
| `NODE_ENV` | The environment the application is running on. Examples: `development`, `production` | `development` |
| `SERVER_PORT` | The port the application will be listening to. | `3000` |
| `LOG_LEVEL` | The log level of the application. Examples: `info`, `debug`, `error`, `warn` | `info` |
| `DEBUG` | All log lines that match this expression will be thrown in STDOUT (Console). | `*` |
| `ROOT_NODE_ID` | The id (email) of the root node | `[email protected]` |
| `WORKSPACE_CUSTOMER_ID` | Your Google Workspace id ([how to get it](https://support.google.com/a/answer/10070793)) | `A0123b4c5` |
| `WORKSPACE_DOMAIN` | The domain used to filter users from a directory | `domain.com` |
| `AUTH_CLIENT_SUBJECT` | An account with permissions to list users from the directory | `[email protected]` |
| `CACHE_ENGINE` | Cache engine of choice. Can be 'memory' or 'redis' | `memory` |
| `REDIS_URL` | Id `CACHE_ENGINE` is set to "redis" then the complete URL with protocol, host and port | `redis://redis:6379` |
| `ADMIN_USERS_TTL_CACHE_S` | Expiration time for users cache entry to be valid (when using memory, cache is perpetual until app termination) | `3600` |
| `USER_BACKEND_MODE` | User backend selection. Can be "csv" or "googleadmin" | `csv` |

## Running

### Development:

The command above will run a server on port 3000 and map port 9229 for debug attaching

```sh
make debug
```

This repo comes with [vscode launch file](.vscode/launch.json). `make debug` and hit F5 to Attach to node.

### Production:

Change the `DOCKER_STAGE ?= development` from "development" to "production" and then run the image build command

```sh
make build-docker-image
```

This should create a `build` folder where next will serve the pages.

And run with

```sh
make start
```

## API reference

### GET /[?debug=false]

Renders the organogram page

- _debug_ (default=false): If true, will render an intermediate node containing every account that has no original parent (manager) in the directory

### GET /healtcheck

Returns a liveness check if the application is running.

## Improvements (TODO):

- Enable security enforcement
- Loading indication
- Better Layout and module separation