aws / aws/graph-explorer

Auto-load graph-explorer-config.json on startup

Open
#1,451 0 comments 0 reactions 0 assignees View on GitHub
customization enhancement infrastructure sharing usability
Dominant language
TypeScript
Stars
481
Forks
108
Avg merge
6d 8h
Merged PRs (30d)
5

Description

## Description

When deploying Graph Explorer via Docker, users can export their configuration (connections, styles, schemas, etc.) using Settings → General → Save, which creates a `graph-explorer-config.json` file. Currently, this file must be manually loaded via the UI each time, even when mounted as a volume in Docker.

While `defaultConnection.json` is automatically loaded for connection settings, the full backup configuration file (`graph-explorer-config.json`) containing styles, schemas, and other customizations is not automatically loaded on startup.

I'm frustrated when I have to manually click "Load" in the Settings UI every time I access Graph Explorer, even though I've mounted the config file as a Docker volume. This makes it difficult to use infrastructure-as-code approaches and share configurations across team members.

## Preferred Solution

Implement automatic loading of `graph-explorer-config.json` on application startup, similar to how `defaultConnection.json` is currently auto-loaded.

**Proposed Implementation:**

1. **Proxy Server**: Serve `graph-explorer-config.json` from `CONFIGURATION_FOLDER_PATH` (similar to `defaultConnection.json`)
- Add route: `GET /graph-explorer-config.json`
- Serve file from: `${CONFIGURATION_FOLDER_PATH}/graph-explorer-config.json`

2. **Frontend Auto-Load**: Before React initializes (in `storageAtoms.ts`), check if:
- No existing configuration exists in IndexedDB
- Backup config file is available at `/graph-explorer-config.json`
- If both conditions are met, automatically fetch and restore the backup using the existing `restoreBackup()` function

3. **Safety**: Only auto-load if IndexedDB is empty (no existing user data) to avoid overwriting user configurations

**Expected Behavior:**
- `defaultConnection.json` → ✅ Auto-loads (connections only) - already works
- `graph-explorer-config.json` → ✅ Auto-loads (full config) when IndexedDB is empty - new behavior

## Additional Context

**Current Behavior:**
- `defaultConnection.json` → ✅ Auto-loads (connections only)
- `graph-explorer-config.json` → ❌ Manual load required (full config with styles, schemas, etc.)

**Docker Compose Example:**

```docker
services:
graph-explorer:
volumes:
- ./config/graph-explorer:/graph-explorer-config
environment:
- CONFIGURATION_FOLDER_PATH=/graph-explorer-config
```

Contributor guide

Open the contributing guide

Research direction

Start by reading storageAtoms.ts, the existing defaultConnection.json startup loading path, and the restoreBackup() function. Then inspect the proxy server route that serves defaultConnection.json and add the parallel configuration-file behavior described in the issue. Done means a mounted graph-explorer-config.json is fetched and restored only when IndexedDB has no existing configuration, without overwriting user data.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, react, typescript
Domain
backend, devops, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.