A React + Vite application that displays organizational hierarchy with tree view and chart view. Designed to be embedded inside Oracle APEX.
- Tree View — Expandable tree with levels, designations, and employees
- Hierarchy Chart — Visual top-to-bottom org chart with clickable designation cards
- Employee Details — Click a designation to see all employees in a grid
- Employee Redirect — Click an employee to open their APEX profile page
- Search — Server-side search by name, ID, designation, or company
- Pagination — Load more support for large datasets
- Responsive — Mobile-friendly UI with touch support
# Clone the repository
git clone <your-repo-url>
cd my-react-app
# Install dependencies using npm
npm install
# OR using bun
bun install# Start dev server with hot reload
npm run dev
# OR
bun run devThe app will be available at http://localhost:5173/.
# Build the production bundle
npm run build
# OR
bun run buildThis creates the dist/ folder:
dist/
├── assets/
│ ├── index-XXXXXXXX.js ← JavaScript bundle
│ └── index-XXXXXXXX.css ← CSS stylesheet
├── index.html
└── vite.svg
Tip: To get consistent filenames (no hash), update
vite.config.js:export default defineConfig({ plugins: [react()], build: { rollupOptions: { output: { entryFileNames: 'assets/app.js', assetFileNames: 'assets/app.[ext]', } } } })This produces
assets/app.jsandassets/app.css— no hash, so APEX file references never need updating.
Go to your APEX application → Shared Components.
Under Files and Reports, click Static Application Files.
Click Create File to add a new static file.
Upload the JavaScript bundle from dist/assets/:
After selecting the JS file, click Create to upload it.
Similarly, upload the CSS file from dist/assets/:
Click the Reference icon next to the JS file to copy its path (e.g., #APP_FILES#index-XXXXXXXX.js).
Click the Reference icon next to the CSS file to copy its path (e.g., #APP_FILES#index-XXXXXXXX.css).
Go to App Builder → your app → Create Page → Blank Page.
Name the page (e.g., "Organization Hierarchy").
In Page Designer, right-click Body → Create Region.
Set:
- Type:
Static Content - Source > HTML Code:
<div id="root"></div>This is where React mounts the app.
Set the region Template to Blank with Attributes for a clean layout.
In Page Designer, select the page root, then:
CSS → File URLs:
Paste the CSS reference path you copied in Step 3.8:
#APP_FILES#index-XXXXXXXX.css
JavaScript → File URLs:
Paste the JS reference path you copied in Step 3.7:
#APP_FILES#index-XXXXXXXX.js
Important: The JS file must load as
type="module".
If type="module" is not supported in File URLs, use Execute when Page Loads:
var script = document.createElement('script');
script.type = 'module';
script.crossOrigin = 'anonymous';
script.src = apex.env.APP_FILE_PREFIX + 'index-XXXXXXXX.js';
document.head.appendChild(script);Save the page (Ctrl+S) and click Run Page to see the React app inside APEX.
- Make code changes
- Run
npm run build(orbun run build) - Delete old files from Static Application Files
- Upload new files from
dist/assets/ - Update file references in Page Designer (if filenames changed)
- Save and run
| Issue | Solution |
|---|---|
| React app not rendering | Check browser console (F12). Ensure <div id="root"></div> exists and JS loads as type="module" |
| CORS errors | ORDS APIs must allow requests from your APEX domain |
| Employee links not working | App reads session from apex.env.APP_SESSION — only works inside APEX |
| Styles look broken | Set region template to Blank with Attributes to avoid APEX theme conflicts |
| Page reloads on button click | All buttons use type="button" and e.preventDefault() — should not happen |
src/
├── App.jsx ← Main app with tree view, search, tabs
├── App.css ← Main styles
├── main.jsx ← React entry point
├── components/
│ ├── OrgChart.jsx ← Hierarchy chart + employee panel
│ └── OrgChart.css ← Chart styles
- React 19 + Vite 7
- Oracle ORDS REST APIs
- Oracle APEX for hosting













