An open-source Org Chart made with NextJS and d3-org-chart
open-org-chart.mp4
- Dragable interface
- User search
- English/Portuguese
- Use it with CSV, Google Sheets or Google Admin API (Google Workspace Admin)
make setupThe 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 |
|---|---|---|
CACHE_ENGINE |
Cache engine of choice. Can be 'memory' or 'redis' | memory |
CSV_FILE_PATH |
Path to the CSV file containing the users data. Only used when USER_BACKEND_MODE is set to csv |
./csv_sample.csv |
DEBUG |
All log lines that match this expression will be thrown in STDOUT (Console). | * |
GADMIN_AUTH_CLIENT_SUBJECT |
An account with permissions to list users from the directory | admin@domain.com |
GADMIN_WORKSPACE_CUSTOMER_ID |
Your Google Workspace id (how to get it) | A0123b4c5 |
GADMIN_WORKSPACE_DOMAIN |
The domain used to filter users from a directory | domain.com |
GSHEETS_API_KEY |
API key to access the Google Sheets API | no default |
GSHEETS_SPREADSHEET_ID |
Id of the Google Sheets document | 13epIQsN6DqmAktLCSeIzSYpNR5LzVEnvZ2cbo5-KgyY |
LOG_LEVEL |
The log level of the application. Examples: info, debug, error, warn |
info |
NODE_ENV |
The environment the application is running on. Examples: development, production |
development |
REDIS_URL |
Id CACHE_ENGINE is set to "redis" then the complete URL with protocol, host and port |
redis://redis:6379 |
REDIS_CONN_TIMEOUT_MS |
Redis connection timeout (in milliseconds). | 5000 |
ROOT_NODE_ID |
The id (email) of the root node | email@domain.com |
SERVER_PORT |
The port the application will be listening to. | 3000 |
CACHE_TTL_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", "googleadmin" or "googlesheets" | csv |
First of all, install dependencies through your favorite package mananger (yarn is the default)
yarnThe command above will run a server on port 3000 and map port 9229 for debug attaching
yarn devThis repo comes with vscode launch file. Chose a debugging profile and hit F5 to start inspect server or attach through browser.
The present Dockerfile will generate a production optimized build and serve it through 0.0.0.0:3000 for the use to be able to reach it through the host machine against the application container.
make setupAnd run with
make startYou can select one of the following integrations to fetch users from:
- Set
USER_BACKEND_MODEtocsv - Use the
csv_sample.csvfile as a template to populate your org with data - Set the
CSV_FILEenvironment variable to the path of your CSV file if you wish to have a different path and/or name
- Set
USER_BACKEND_MODEtogoogleadmin - Set the
GADMIN_WORKSPACE_CUSTOMER_IDto your Google Workspace id (how to get it) - Set the
GADMIN_WORKSPACE_DOMAINto the domain you want to filter users from - Set the
GADMIN_AUTH_CLIENT_SUBJECTto an account with permissions to list users from the directory (part of GSuite Admins)
- Set
USER_BACKEND_MODEtogooglesheets - Copy this public spreadsheet -> https://docs.google.com/spreadsheets/d/13epIQsN6DqmAktLCSeIzSYpNR5LzVEnvZ2cbo5-KgyY/edit?gid=0#gid=0 and...
- ...set the
GSHEETS_SPREADSHEET_IDto the id of the Google Sheets document (part of the URL, as in the example above between/d/and/edit(may change in the future)) - Set the
GSHEETS_API_KEYto the API key to access the Google Sheets API
You can select one of the following cache engines to store users data:
- Set
CACHE_ENGINEtomemory - Set the
CACHE_TTL_Sto the expiration time for users cache entry to be valid (in seconds)
- Set
CACHE_ENGINEtoredis - Set the
REDIS_URLto the complete URL with protocol, host and port - Set the
CACHE_TTL_Sto the expiration time for users cache entry to be valid (in seconds) - Set the
REDIS_CONN_TIMEOUT_MSto the (socket) connection timeout. Ref.: [1] [2] [3].
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
Returns a liveness check if the application is running.
Returns a readiness check if cache is running and app is ready to deliver content.
- Enable security enforcement
- Loading indication
- Better Layout and module separation