Skip to content

jonathanmcmichael/SynchroScheduleViewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synchro Schedule Utility

Local Rust web app for exploring Bentley Schedules API data, focused on v10 schedules.

What it does

  • Lists schedules for an iTwinId
  • Highlights v10 schedules by type / isNextGen
  • Loads tasks for a selected schedule
  • Exports schedules or tasks from the browser as JSON or CSV
  • Uploads a Microsoft Project file to a v10 schedule using Bentley's TUS-based file upload flow
  • Starts a Microsoft Project synchronization job and polls the long-running operation

Stack

  • Rust
  • axum for the local web server
  • reqwest for Bentley API calls
  • Vanilla HTML/CSS/JS for the explorer UI

Requirements

  • Rust toolchain
  • A Bentley OAuth access token with the itwin-platform scope

This app does not perform the OAuth flow for you. It expects a bearer token pasted into the UI or provided through an environment variable.

Run

cargo run

Optional environment variables:

$env:BENTLEY_ACCESS_TOKEN="your-token"
$env:BENTLEY_CLIENT_ID="your-client-id"
$env:BENTLEY_CLIENT_SECRET="your-client-secret"
$env:BENTLEY_REDIRECT_URI="http://localhost:3000/signin-callback"
$env:BENTLEY_API_BASE_URL="https://api.bentley.com/"
$env:PORT="3000"

You can also put the same values in a local .env file at the repo root. The app now loads .env automatically on startup.

Then open:

http://127.0.0.1:3000

Bentley OAuth

You can still paste a bearer token manually, but the app now also supports Bentley sign-in for local use.

  1. Register a Bentley Web App
  2. Add redirect URI http://localhost:3000/signin-callback
  3. Set BENTLEY_CLIENT_ID and BENTLEY_CLIENT_SECRET
  4. Start the app with cargo run
  5. Click Sign in with Bentley

After Bentley redirects back, the callback page stores the access token in browser storage and the explorer reuses it automatically.

If Bentley returns a refresh_token, the browser now asks the local Rust server to renew the access token shortly before expiry, so you usually do not need to sign in again every hour.

Bentley flow used

The upload flow follows Bentley's current Schedules API docs:

  1. GET /schedules/?iTwinId={iTwinId}
  2. GET /schedules/{scheduleId}/tasks
  3. POST /schedules/{scheduleId}/files
  4. PATCH /schedules/{scheduleId}/files/{fileId}
  5. POST /schedules/{scheduleId}/imports/microsoft-project/synchronize
  6. GET /schedules/{scheduleId}/operations/{operationId}

Notes

  • Bentley labels the Schedules API Technical Preview in the current docs, so treat this as an internal tool rather than a production integration.
  • The upload UI applies one synchronization mode across all Microsoft Project sync options for now.
  • File upload currently sends the file as a single chunk after creating the TUS upload.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors