DBScope is a full-stack application / REST API for exploring and managing external SQL databases without predefined entities for the target schema.
Core idea:
- metadata is loaded dynamically from external databases (schemas, tables, columns, PK/FK)
- data is read and written generically
- backend logic is not hardwired to one external database schema
The system uses two data layers:
- internal application DB (users, roles, connections, sharing, audit)
- external DB (user-defined SQL database)
Important
Currently only PostgreSQL is supported in the connector
- Login:
POST /api/auth/login(JWT access + refresh tokens) - Current user:
GET /api/auth/me - Logout:
POST /api/auth/logout - Roles:
ADMIN- full accessREAD_ONLY- read-only access
- Create/update/delete connections (ADMIN)
- Connection test
- Share connections from ADMIN to READ_ONLY users
- READ_ONLY users can work with shared connections
- List schemas
- List tables in a schema
- Table detail (columns, primary key, foreign keys)
- Read table data
- Pagination (
limit,offset) - Sorting
- Search
- Column filtering
INSERT,UPDATE,DELETE(ADMIN)- Dynamic row forms generated from table metadata
- Write actions are hidden for READ_ONLY users in the frontend UI
- Logs
INSERT/UPDATE/DELETE - Filters by
connectionIdandtable - Audit endpoint:
GET /api/v1/audit
- Export visible table data to CSV (frontend)
- Sidebar includes:
- app version,
- current date/time,
- last response time
- Modal pages for:
- Release Notes,
- Terms of Service,
- Privacy Policy
- Backend: Java 17, Spring Boot 4.0.3, Spring Web MVC, Spring Security, Spring Data JPA, JDBC, Bean Validation, Actuator, Springdoc OpenAPI (Swagger), Flexmark
- Frontend: React 19, TypeScript, Vite, Axios, React Router, TailwindCSS
- Database: PostgreSQL
- Containerization: Docker, Docker compose
- Internal DB (JPA): users, connections, sharing, audit
- External DB (JDBC): metadata + dynamic SQL
- Generic structures for external data:
Map<String, Object>List<Map<String, Object>>
| Service | Purpose | Container | Image/Build | Ports | Depends | Notes |
|---|---|---|---|---|---|---|
db |
Internal app PostgreSQL | dbscope-postgres-db |
postgres:16-alpine |
5431:5432 |
- | data persisted in db_data volume |
backend |
Spring Boot API | dbscope-backend |
build from Dockerfile |
8080:8080 |
db | prod profile, API under /api |
frontend |
React build served by Apache | dbscope-frontend |
build from frontend/Dockerfile |
80:80 |
- | UI at http://localhost |
DBScope/
|- src/main/java/cz/jpmad/dbscope
| |- api
| |- service
| |- model
| |- repository
| |- config
|- src/main/resources
| |- application.yml
| |- application-dev.yml
|- frontend/
| |- src/
| |- Dockerfile
|- docker-compose.yml
|- docker-compose.dev.yml
|- Dockerfile
|- pom.xml
|- .env
|- VERSION
- Docker + Docker Compose
- Java 17 (for local backend run without Docker)
- Node.js 20+ and npm (for local frontend run)
- Free ports:
80(frontend)8080(backend)5431(internal PostgreSQL on host)
- Enough RAM (8+ GB recommended, minimum 6 GB)
- Additional disk space (2 GB for deployment itself + free space for internal DB)
Warning
Before running in containers, create and populate .env files. One file belongs in the root directory of the project, the other in the /frontend directory
Start only PostgreSQL for development:
git clone https://github.com/petrsafrata/DBScope.git
cd DBScope
docker compose -f docker-compose.dev.yml up -dThen run backend locally:
.\mvnw.cmd spring-boot:runTip
Spring Boot uses the development settings from application.yml or application-dev.yml β no configuration is required.
Then run frontend locally:
cd frontend
npm install
npm run devWill typically run on http://localhost:5173 (or another port that Vite assigns)
Note
The frontend automatically communicates with the backend (localhost:8080)
For full container runtime, download the latest project release first:
Then run the full application using docker-compose.yml:
cd DBScope
docker-compose --env-file .env up -d --buildYou can also run only the backend API as a container image from GitHub Packages (GHCR).
In this mode:
- pull backend image from GHCR (for example:
ghcr.io/petrsafrata/dbscope-backend:<tag>), - create your own
docker-compose.yml, - include and configure a separate container for the internal application database,
- configure backend environment variables (DB/JWT/profile).
Example image pull:
docker pull ghcr.io/petrsafrata/dbscope-backend:v1.0.0Without an internal DB container (or an equivalent reachable DB service), backend API runtime will fail.
| Access Point | URL | Description |
|---|---|---|
| Frontend | http://localhost:80 |
Main user interface |
| Backend API | http://localhost:8080/api |
Backend REST API base path |
| Swagger UI | http://localhost:8080/api/swagger-ui/index.html |
Interactive API docs |
| OpenAPI JSON | http://localhost:8080/api/v3/api-docs |
OpenAPI specification |
| Actuator | http://localhost:8080/api/actuator |
Technical endpoints (health, info, metrics) |
| Internal PostgreSQL (from host) | localhost:5431 |
App internal DB mapped from container |
Note
Backend uses context path /api; business endpoints are versioned under /api/v1/....
Use Swagger UI for API documentation:
Main endpoint groups:
Auth- login, refresh, current user, logoutConnections- connection CRUD, test, sharingMetadata- schemas, tables, table detailsData- table reads and write operationsAudit- audit recordsInfo- version, release notes, terms, privacy
OpenAPI JSON:
- Check logs
docker compose logs backend
docker compose logs frontend
docker compose logs db- If the external DB runs on your host machine, do not use
localhostin connection settings. - Use host
host.docker.internal.
- Verify credentials.
- Check that frontend sends bearer token requests correctly.
- Verify JWT secret and token TTL configuration on backend.
- Free ports
80,8080,5431or adjust mappings indocker-compose.yml.
- Verify firewall, DB listener configuration (
listen_addresses), DB access rules (pg_hba.conffor PostgreSQL), and port.
- External DB connector is currently limited to
postgresql - Pagination is offset/limit without total count
- Audit UI currently emphasizes basic columns
- Flyway is disabled in current setup (
spring.flyway.enabled=false)
This project is open-source and released under the Apache License 2.0. You are free to use, modify, distribute, and use it commercially under the terms of the Apache 2.0 license. See the LICENSE file for full details.
Apache-2.0 β Copyright (c) 2025 Petr Ε afrata
