This document describes all services required for the DBA Agent application and how to manage them.
The DBA Agent application requires the following services:
| Service | Port | Purpose | Technology |
|---|---|---|---|
| PostgreSQL | 5432 | Backend database (stores connection configs, users, etc.) | Docker/PostgreSQL 18.1 |
| Valkey/Redis | 6379 | Cache layer | Docker/Valkey 9.0.1 |
| Backend | 8080 | Spring Boot API server | Java/Spring Boot |
| Frontend | 3000 | React/Vite web application | Node.js/Vite |
./scripts/check-services.shChecks if all services are running and displays their status.
./scripts/start-all.shStarts all services in the correct order:
- PostgreSQL & Valkey (via Docker Compose)
- Backend (Spring Boot)
- Frontend (Vite/React)
./scripts/start-all.sh --restartStops and restarts all services.
./scripts/stop-all.shStops all running services.
Using Docker Compose (Recommended):
# Start PostgreSQL
docker compose up -d postgres
# Check status
docker compose ps
# View logs
docker compose logs postgres
# Stop PostgreSQL
docker compose stop postgresUsing Local PostgreSQL:
# Start PostgreSQL service (macOS)
brew services start postgresql@18
# Create database
createdb dba_agent
# Check if running
pg_isready -h localhost -p 5432
# Connect to database
psql -h localhost -U postgres -d dba_agentConnection Details:
- Host:
localhost - Port:
5432 - Database:
dba_agent - Username:
postgres - Password:
postgres(default)
Using Docker Compose:
# Start Valkey
docker compose up -d valkey
# Check status
docker compose ps valkey
# Connect to Valkey
docker compose exec valkey valkey-cliUsing Local Redis:
# Start Redis (macOS)
brew services start redis
# Check if running
redis-cli pingConnection Details:
- Host:
localhost - Port:
6379
Start Backend:
cd backend
./mvnw spring-boot:run
# OR
mvn spring-boot:runBackend runs on: http://localhost:8080/api
Health Check:
curl http://localhost:8080/api/actuator/healthLogs:
- Console output (if run directly)
backend-dev.log(if run in background)
Start Frontend:
npm install # First time only
npm run devFrontend runs on: http://localhost:3000
Logs:
- Console output (if run directly)
frontend-dev.log(if run in background)
Frontend (3000)
└──> Backend (8080)
├──> PostgreSQL (5432)
└──> Valkey/Redis (6379)
Startup Order:
- PostgreSQL & Valkey (can start in parallel)
- Backend (waits for PostgreSQL)
- Frontend (waits for Backend)
# Check specific port
lsof -i :8080
lsof -i :3000
lsof -i :5432
lsof -i :6379
# Kill process on port (if needed)
lsof -ti:8080 | xargs kill -9Backend:
tail -f backend-dev.logFrontend:
tail -f frontend-dev.logDocker Services:
docker compose logs -f postgres
docker compose logs -f valkey-
Port Already in Use
- Use
./scripts/start-all.sh --restartto restart services - Or manually kill the process:
lsof -ti:PORT | xargs kill -9
- Use
-
PostgreSQL Connection Failed
- Ensure PostgreSQL is running:
pg_isready -h localhost -p 5432 - Check Docker:
docker compose ps - Verify database exists:
psql -h localhost -U postgres -l | grep dba_agent
- Ensure PostgreSQL is running:
-
Backend Won't Start
- Check Java version:
java -version(needs Java 17+) - Check Maven:
mvn -version - Check logs:
tail -f backend-dev.log
- Check Java version:
-
Frontend Won't Start
- Install dependencies:
npm install - Check Node version:
node -v(needs Node 18+) - Check logs:
tail -f frontend-dev.log
- Install dependencies:
DB_URL- Database connection URL (default:jdbc:postgresql://localhost:5432/dba_agent)DB_USERNAME- Database username (default:postgres)DB_PASSWORD- Database password (default:postgres)
VITE_API_URL- Backend API URL (default:http://localhost:8080)
For production, services should be:
- Running as system services (systemd, launchd, etc.)
- Behind a reverse proxy (nginx, Apache)
- Using environment-specific configuration files
- Monitored with health checks and logging
See SELF_HOST_GUIDE.md for the Docker Compose stack: host sizing, the production environment reference, TLS and reverse-proxy setup, health checks, upgrades, and backup and restore.