This guide will help you run the DBA Agent project locally.
- Node.js 18+ and npm
- Already installed: ✅ Node.js v24.10.0, npm v11.6.0
- Java 17 or higher
- Maven 3.6+ (or use Maven wrapper)
cd /path/to/deepsql
npm installThis will install:
- axios (API client)
- react-force-graph-2d (visualization)
- All other Next.js dependencies
cd /path/to/deepsql
docker compose up -d postgresDefaults used by the backend:
- DB:
dba_agent - User:
postgres - Password: (empty)
cd backend
mvn clean install
mvn spring-boot:runcd backend
# First time: Make wrapper executable (macOS/Linux)
chmod +x mvnw
./mvnw clean install
./mvnw spring-boot:run- Open the
backendfolder in IntelliJ IDEA or Eclipse - Import as Maven project
- Run
DbaAgentApplication.java
Create a .env.local file in the root directory:
NEXT_PUBLIC_API_URL=http://localhost:8080For the backend, set encryption key (optional, defaults to a test key):
export ENCRYPTION_KEY=your-secure-encryption-key-herecd backend
./mvnw spring-boot:run
# Or if Maven is installed:
mvn spring-boot:runBackend will start on: http://localhost:8080
cd /path/to/deepsql
npm run devFrontend will start on: http://localhost:3000
-
Backend Health Check: Open
http://localhost:8080/api/connectionsin your browser- Should return an empty array
[](no connections yet)
- Should return an empty array
-
Frontend: Open
http://localhost:3000- Should see the DBA Agent interface
- Click the Settings icon (⚙️) in the left panel
- Select MySQL or PostgreSQL
- Enter your database connection details:
- Connection Name (e.g., "My Production DB")
- Host (e.g., localhost)
- Port (3306 for MySQL, 5432 for PostgreSQL)
- Database Name
- Username
- Password
- SSL (if needed)
- Click "Test Connection" to verify
- Click "Save Configuration" to save and trigger automatic schema scan
- View ER diagram and dependency graph in the Preview tab
- Check DBA stats in the Analytics tab
Java not found:
- Install Java 17+:
brew install openjdk@17(macOS) - Or download from: https://adoptium.net/
Maven not found:
- Install Maven:
brew install maven(macOS) - Or use the Maven wrapper:
./mvnw(included in project)
Port 8080 already in use:
- Change port in
backend/src/main/resources/application.properties:server.port=8081 - Update frontend
.env.local:NEXT_PUBLIC_API_URL=http://localhost:8081
npm install fails:
- Try:
npm install --legacy-peer-deps - Or:
npm cache clean --forcethennpm install
Port 3000 already in use:
- Next.js will automatically use the next available port (3001, 3002, etc.)
API connection errors:
- Ensure backend is running on port 8080
- Check
NEXT_PUBLIC_API_URLin.env.local - Check browser console for CORS errors
Postgres.app trust error:
- If you see
Postgres.app failed to verify "trust" authentication, open Postgres.app settings and approve the permission prompt.
dbaagent/
├── backend/ # Java Spring Boot backend
│ ├── src/main/java/ # Java source code
│ ├── pom.xml # Maven dependencies
│ └── mvnw # Maven wrapper
├── src/ # Next.js frontend
│ ├── app/ # Next.js app router
│ ├── components/ # React components
│ └── lib/api/ # API client
└── package.json # Node.js dependencies
After setup:
- Connect to your first database
- Explore the schema visualizations
- Review DBA performance stats
- Test SQL queries in the SQL Runner tab
For questions or issues, check the code comments or review the implementation plan.