Automatically discover, visualize, and explore database schemas with an elegant, interactive interface
Features • Quick Start • Tech Stack • Documentation • Developer • License
Database Ontology Mapper is a full-stack application that automatically extracts and visualizes database schemas from multiple MySQL/MariaDB databases. It provides an intuitive, Palantir-inspired interface for exploring complex database structures, making it perfect for:
- 📚 Documentation - Automatically generate visual documentation of your database architecture
- 🔍 Discovery - Understand unfamiliar database schemas quickly
- 🏗️ Architecture Review - Analyze relationships and data flow across multiple databases
- 🎓 Onboarding - Help new team members understand database structures
- 🔐 Auditing - Review database designs with read-only access
- 🔍 Automatic Schema Discovery - Extract tables, columns, keys, and relationships from MySQL/MariaDB databases
- 🌐 Multi-Database Support - Connect to and visualize multiple databases simultaneously
- 🔗 Relationship Mapping - Automatically detect and visualize foreign key relationships
- 🔐 Read-Only Access - Safe schema extraction using read-only database connections
- 🎨 Modern UI Design - Beautiful dark theme with glassmorphism effects inspired by Palantir
- 📊 Interactive Graph Visualization - Explore schemas with zoom, pan, and interactive nodes using ReactFlow
- 🔎 Smart Search - Find databases, tables, and columns instantly
- 📱 Responsive Design - Professional interface with smooth animations via Framer Motion
- 🎯 Multiple View Modes - Switch between hierarchical schema view and relationship-focused layouts
- 🚀 REST API - Programmatic access to all ontology data
- 🛠️ CLI Interface - Command-line tools for schema extraction and server management
- 🔄 Hot Reload - Development mode with auto-refresh
- 🐳 Docker Support - Containerized deployment options
- FastAPI - Modern, high-performance web framework for building APIs
- SQLAlchemy - Database toolkit and ORM for schema extraction
- Pydantic - Data validation using Python type annotations
- Click - Command-line interface creation
- React 18 - UI component library with hooks
- TypeScript - Type-safe JavaScript
- ReactFlow - Interactive graph visualization library
- Framer Motion - Animation library for React
- Vite - Next-generation frontend build tool
- Python 3.8+ with virtual environment
- Node.js 16+ with npm
- Docker (optional) for containerized deployment
- MySQL/MariaDB compatible
Get up and running in under 5 minutes!
# Clone the repository
git clone https://github.com/yourusername/Ontology.git
cd Ontology
# Backend setup
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Frontend setup
cd frontend
npm install
npm run build
cd ..# Copy environment template
cp env.example .env
# Edit .env with your database credentials# Extract schema information
python -m src.main extract
# Start the server
python -m src.main serve
# Open http://localhost:8000 in your browserThat's it! 🎉 You should now see your database schemas visualized in the browser.
- Python 3.8+
- Node.js 16+
- MySQL/MariaDB databases with read-only access
- Clone the repository:
git clone <repository-url>
cd Ontology- Create and activate a virtual environment:
python -m venv venv
# On Windows
venv\Scripts\activate
# On Linux/Mac
source venv/bin/activate- Install Python dependencies:
pip install -r requirements.txt- Configure database connections:
# Copy the example environment file
cp env.example .env
# Edit .env with your database credentials- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Build the frontend:
npm run buildEdit the .env file to configure your database connections:
# Database 1
DB_1_HOST=localhost
DB_1_PORT=3306
DB_1_NAME=database1
DB_1_USER=readonly_user
DB_1_PASSWORD=your_password
# Database 2
DB_2_HOST=db2.example.com
DB_2_PORT=3306
DB_2_NAME=database2
DB_2_USER=readonly_user
DB_2_PASSWORD=your_password
# Add more databases as needed (DB_3, DB_4, etc.)
# API Configuration
API_HOST=0.0.0.0
API_PORT=8000
# Output Configuration
OUTPUT_DIR=outputIt's recommended to use read-only database users for security:
-- MySQL/MariaDB
CREATE USER 'readonly_user'@'%' IDENTIFIED BY 'secure_password';
GRANT SELECT ON database_name.* TO 'readonly_user'@'%';
GRANT SELECT ON information_schema.* TO 'readonly_user'@'%';
FLUSH PRIVILEGES;First, extract schema information from your configured databases:
python -m src.main extractThis will:
- Connect to all configured databases
- Extract schema information (tables, columns, keys, relationships)
- Save the ontology data to
output/ontology.json
Options:
# Specify custom output directory
python -m src.main extract --output /path/to/outputLaunch the visualization server:
python -m src.main serveOptions:
# Custom host and port
python -m src.main serve --host 0.0.0.0 --port 8000
# Enable auto-reload for development
python -m src.main serve --reloadOpen your browser and navigate to:
http://localhost:8000
View ontology statistics:
python -m src.main stats- Search - Find databases, tables, and columns
- Stats - View database, table, and relationship counts
- View Modes - Switch between Schema and Relationships views
- Schema Explorer - Browse databases, tables, and columns in a tree view
- Expandable Nodes - Click to expand/collapse database and table nodes
- Badge Counts - See table and column counts at a glance
- Interactive Nodes - Click nodes to view details
- Zoom & Pan - Explore large schemas with smooth navigation
- MiniMap - Overview of the entire graph
- Schema View - Hierarchical layout showing databases and tables
- Relationships View - Circular layout emphasizing foreign key relationships
- Database Details - Host, port, table count, character set
- Table Details - Columns, primary keys, foreign keys, indexes
- Column Details - Data type, nullable, default value, constraints
- Relationship Info - Foreign key references and rules
The backend provides a REST API for programmatic access:
GET /api/ontology- Complete ontology dataGET /api/databases- List all databasesGET /api/databases/{name}- Get specific databaseGET /api/databases/{db}/tables/{table}- Get specific tableGET /api/relationships- All relationshipsGET /api/search?q={query}- Search databases, tables, columnsGET /api/stats- Ontology statistics
For frontend development with hot reload:
cd frontend
npm run devThis starts a development server at http://localhost:5173 with proxy to the backend.
Ontology/
├── src/
│ ├── __init__.py
│ ├── api.py # FastAPI backend
│ ├── config.py # Configuration management
│ ├── extractor.py # Schema extraction logic
│ ├── models.py # Pydantic data models
│ └── main.py # CLI entry point
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── api.ts # API client
│ │ ├── types.ts # TypeScript types
│ │ ├── App.tsx # Main app component
│ │ └── index.css # Global styles
│ ├── package.json
│ └── vite.config.ts
├── requirements.txt
├── .env.example
└── README.md
- Make sure you've run
python -m src.main extractfirst - Check that the
output/ontology.jsonfile exists - Verify database credentials in
.envare correct
- Verify database host and port are accessible
- Check that read-only user has proper permissions
- Ensure firewall rules allow connections
- Rebuild the frontend:
cd frontend && npm run build - Check that the API server is running
- Clear browser cache
Contributions are welcome and appreciated! Whether you're fixing bugs, adding features, or improving documentation, your help makes this project better.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure your code follows the existing style and includes appropriate tests.
Peyton Nowlin
- Email: Peyton@nowlinautomation.com
- Website: nowlinautomation.com
This project is licensed under the MIT License - see the LICENSE file for full details.
Copyright (c) 2024 Database Ontology Mapper
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
In plain English: You can freely use, modify, and distribute this software for any purpose, including commercial applications, as long as you include the original copyright notice.
- UI Design - Inspired by Palantir Foundry data visualization tools
- Graph Visualization - Powered by ReactFlow
- Icons - Lucide React icon library
- Built With - React, TypeScript, FastAPI, SQLAlchemy