Skip to main content

Overview

OpenSight is designed to be fully self-hosted, giving you complete control over your data and infrastructure. The platform consists of multiple services that work together to provide real-time data analysis and visualization capabilities.

Architecture

OpenSight uses a microservices architecture with the following components:

Core Services

Web Application

Next.js 14 frontend with React 18 and TypeScriptPort: 3000

API Server

Express backend with TypeScript for data processingPort: 4000

PostgreSQL Database

PostgreSQL 16 for persistent data storagePort: 5432

Redis Cache

Redis 7 for high-performance cachingPort: 6379

Service Dependencies

Deployment Options

The simplest way to deploy OpenSight is using Docker Compose, which handles all service orchestration automatically.
1

Clone the repository

git clone https://github.com/yourusername/opensight.git
cd opensight
2

Configure environment variables

cp .env.example .env
# Edit .env with your configuration
See Environment Variables for complete reference.
3

Deploy with Docker Compose

docker compose -f docker/docker-compose.yml up -d
4

Verify deployment

docker compose -f docker/docker-compose.yml ps
Expected output:
NAME                IMAGE                   STATUS
opensight-web-1     opensight-web:latest    Up 30 seconds
opensight-api-1     opensight-api:latest    Up 30 seconds
opensight-postgres-1 postgres:16-alpine     Up 30 seconds (healthy)
opensight-redis-1   redis:7-alpine          Up 30 seconds (healthy)
See Docker Deployment for detailed instructions.

Manual Deployment

For custom deployment scenarios, you can deploy each component separately:
1

Set up PostgreSQL and Redis

Install and configure PostgreSQL 16+ and Redis 7+ on your infrastructure.
2

Build the applications

npm install
npm run build
3

Run database migrations

npm run db:migrate
4

Start the services

# Terminal 1: Start API server
npm run start:api

# Terminal 2: Start web application
npm run start:web

System Requirements

Minimum Requirements

  • CPU: 2 cores
  • RAM: 4 GB
  • Storage: 20 GB SSD
  • OS: Linux (Ubuntu 20.04+, Debian 11+, or similar)
  • CPU: 4+ cores
  • RAM: 8+ GB
  • Storage: 50+ GB SSD
  • OS: Linux (Ubuntu 22.04+ or Debian 12+)

Software Requirements

  • Docker 24.0+
  • Docker Compose 2.20+
  • Node.js 20+
  • npm or pnpm package manager
  • PostgreSQL 16+
  • Redis 7+

Network Configuration

Default Ports

ServicePortProtocolRequired
Web UI3000HTTPYes
API Server4000HTTPYes
PostgreSQL5432TCPInternal
Redis6379TCPInternal

Firewall Rules

If you’re deploying behind a firewall, ensure the following ports are accessible:
# Allow HTTP traffic to web UI
sudo ufw allow 3000/tcp

# Allow HTTP traffic to API
sudo ufw allow 4000/tcp

# PostgreSQL and Redis should only be accessible internally
# Do not expose these ports to the public internet
Never expose PostgreSQL (5432) or Redis (6379) ports directly to the internet. These should only be accessible to the API server within your internal network.

Data Persistence

OpenSight uses Docker volumes for data persistence:
  • pgdata: PostgreSQL database files
  • redisdata: Redis persistence files
These volumes are automatically created and managed by Docker Compose. To back up your data:
# Backup PostgreSQL
docker compose -f docker/docker-compose.yml exec postgres pg_dump -U opensight opensight > backup.sql

# Backup Redis
docker compose -f docker/docker-compose.yml exec redis redis-cli SAVE

Health Checks

All services include health checks for monitoring:
# Check service health
docker compose -f docker/docker-compose.yml ps

# View logs
docker compose -f docker/docker-compose.yml logs -f

# Check specific service
docker compose -f docker/docker-compose.yml logs -f api

Health Check Endpoints

  • API Health: http://localhost:4000/health
  • PostgreSQL: Automatic via pg_isready
  • Redis: Automatic via redis-cli ping

Next Steps

Docker Deployment

Step-by-step guide for deploying with Docker Compose

Environment Variables

Complete reference for all configuration options

API Reference

Explore the API endpoints and integration options

Database Setup

Configure and manage your PostgreSQL database

Build docs developers (and LLMs) love