Skip to content

Repository files navigation

VeTool

A scrim organizer for CS2 and Valorant with realtime lobbies, captain picks, and map veto.

Quick Start with Docker (Recommended)

The easiest way to run VeTool is using Docker:

# Start all services (database, Redis, API, web)
docker compose up -d

# View logs
docker compose logs -f

# Stop all services
docker compose down

Access the application:

The browser talks to the web origin only (/api/v1 and /hubs). Next.js proxies those to the API, so a Mac opening this host does not fetch localhost on the Mac.

Prerequisites

Docker Setup

  • Docker Desktop (includes docker-compose)
  • 4GB+ RAM allocated to Docker

Local Development Setup

  • .NET 8 SDK
  • PostgreSQL 16+
  • Redis 7+
  • Node 18+

Docker Configuration

Environment Variables

Copy .env.example to .env and update values as needed:

cp .env.example .env

Key environment variables:

  • POSTGRES_*: Database connection settings
  • REDIS_CONNECTION: Redis connection string
  • JWT__Secret: JWT signing secret (must be set so sessions survive API restarts)
  • CORS_ORIGINS: comma-separated browser origins (optional; any :3000 origin is already allowed)
  • API_BASE_INTERNAL: server-side API URL inside Docker (http://api:8080/api/v1). The browser uses same-origin /api/v1.

Docker Services

The docker-compose.yml includes:

  • postgres: PostgreSQL 16 database
  • redis: Redis 7 for caching and SignalR backplane
  • api: .NET 8 API backend (port 5001)
  • web: Next.js frontend (port 3000)

Development

Using Docker (Recommended)

# Build images
docker compose build

# Start in development mode
docker compose up -d

# Watch API logs
docker compose logs -f api

# Watch web logs
docker compose logs -f web

# Restart a single service
docker compose restart api

# Run migrations manually (if needed)
docker compose exec api dotnet ef database update

Local Development (Without Docker)

Database Setup

# Start PostgreSQL (via Docker for convenience). Compose publishes 5433 on the host
# so it does not collide with another local Postgres on 5432.
docker run -d --name vetool-postgres \
  -e POSTGRES_DB=vetool \
  -e POSTGRES_USER=vetool \
  -e POSTGRES_PASSWORD=vetool_dev_password \
  -p 5433:5432 \
  postgres:16-alpine

# Start Redis
docker run -d --name vetool-redis -p 6379:6379 redis:7-alpine

Migrations

# Install EF Core tools
dotnet tool install --global dotnet-ef

# Add migration (if needed)
dotnet ef migrations add MigrationName -p apps/domain/VeTool.Domain.csproj -s apps/api/VeTool.Api.csproj

# Apply migrations
dotnet ef database update -p apps/domain/VeTool.Domain.csproj -s apps/api/VeTool.Api.csproj

Run API

dotnet run --project apps/api/VeTool.Api.csproj
# API available at http://localhost:5001
# Health: http://localhost:5001/health

Run Web

cd apps/web
npm install
npm run dev:local
# Web available at http://localhost:3000

Testing

# Run all tests
dotnet test

# Run tests in Docker
docker compose exec api dotnet test

Troubleshooting

Port 5000 Already in Use

macOS uses port 5000 for AirPlay Receiver. The Docker setup uses port 5001 instead. If you need to change it, update docker-compose.yml and .env.example.

Port 5432 Already in Use

Compose publishes Postgres on host port 5433 (container still 5432) so it can start next to another local Postgres. The API container talks to postgres:5432 on the compose network. For dotnet run against compose Postgres, set POSTGRES_PORT=5433.

Database Connection Failed

Ensure PostgreSQL is running and connection settings are correct:

docker compose logs postgres

Redis Connection Failed

Check Redis is running:

docker compose logs redis

Web App Can't Connect to API

Verify the API is running and NEXT_PUBLIC_API_BASE environment variable is set correctly.

CI/CD

See .gitlab-ci.yml for GitLab CI/CD configuration. The pipeline includes:

  • Building Docker images for API and web
  • Running tests
  • Deploying to staging/production

License

MIT

About

A open source veto/lobby tool for CS2 and Valorant.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages