📦 Installation

Table of contents

Prerequisites


1. Clone the repository

1
2
git clone git@github.com:guibranco/insightstream-api.git
cd insightstream-api

2. Restore dependencies

1
dotnet restore

3. Start Postgres, Redis, and LavinMQ locally

Any install method works — native packages, Homebrew, or containers. For a quick throwaway stack:

1
2
3
4
5
6
7
docker run -d --name insightstream-postgres -p 5432:5432 \
  -e POSTGRES_DB=insightstream -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres \
  postgres:16-alpine

docker run -d --name insightstream-redis -p 6379:6379 redis:7-alpine

docker run -d --name insightstream-lavinmq -p 5672:5672 -p 15672:15672 cloudamqp/lavinmq:latest

appsettings.Development.json already points at localhost for all three with matching credentials, so no further configuration is needed for local development.

4. Apply database migrations

1
2
3
dotnet ef database update \
  --project src/InsightStream.Infrastructure \
  --startup-project src/InsightStream.Api

This seeds a single admin user: admin / ChangeMe123!. There is no self-service “change password” endpoint by design — see the Deployment guide for the rotation procedure before you expose this anywhere public.

5. Run

1
dotnet run --project src/InsightStream.Api

The API starts on http://localhost:5000 by default (or whatever ASPNETCORE_URLS you set). The ingest consumer runs alongside it automatically as a hosted background service — no separate process needed for local development.

6. Verify

1
curl http://localhost:5000/health
1
GET /health  →  200 OK  {"success":true,"data":{"status":"Healthy", ...}}

Building from source (Release)

1
2
3
dotnet restore
dotnet build --configuration Release
dotnet publish src/InsightStream.Api -c Release -o ./publish

See Deployment for shipping the published output to a production VPS.