Full-stack legal document analysis platform: ASP.NET 9 backend, Angular 20 frontend, PostgreSQL database, OpenAI integration.
Repository: https://github.com/diyorrf/BISP
Prerequisites: Docker and Docker Compose.
git clone https://github.com/diyorrf/BISP.git
cd BISPCopy the example and fill in your secrets:
cp .env.example .envOpen .env and set the required values:
# PostgreSQL (used by both the db container and the backend connection string)
POSTGRES_PASSWORD=postgres
# JWT authentication
JWT_SECRET_KEY=your-secret-key-here
# OpenAI (REQUIRED — the app will not work without a valid key)
OPENAI_API_KEY=sk-your-openai-api-key-here
OPENAI_CHAT_MODEL=gpt-4.1-mini
OPENAI_EMBEDDING_MODEL=text-embedding-3-large
# Email (SMTP for sending verification codes)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_SENDER=your-email@gmail.com
EMAIL_USERNAME=your-email@gmail.com
EMAIL_PASSWORD=your-gmail-app-passwordImportant:
OPENAI_API_KEYandEMAIL_PASSWORDhave no defaults — the app will not start properly without them.For Gmail, use an App Password (not your regular password).
docker compose up --buildOn the first run, the database tables need to be created. Run this once:
docker compose exec backend dotnet ef database updateIf
dotnet-efis not available inside the container, apply migrations from your host machine (requires .NET 9 SDK):cd back dotnet ef database update -- --connection "Host=localhost;Port=5432;Database=LegalGuard;Username=postgres;Password=postgres"
- Frontend: http://localhost:4200
- Backend API: http://localhost:5041 (also accessible through Nginx at http://localhost:4200/api)
- PostgreSQL: localhost:5432 (user
postgres, password from.env)
The backend reads settings from two sources (in order of priority):
- Environment variables (highest priority) — set via
.env→docker-compose.yml appsettings.json(fallback) — used for local development without Docker
Environment variables use __ (double underscore) to represent nested config sections:
.env variable |
Maps to appsettings.json path |
|---|---|
ConnectionStrings__DefaultConnection |
ConnectionStrings.DefaultConnection |
OpenAI__ApiKey |
OpenAI.ApiKey |
JwtSettings__SecretKey |
JwtSettings.SecretKey |
EmailSettings__Password |
EmailSettings.Password |
When running with Docker, you only need the .env file — appsettings.json is not copied into the container.
When running locally without Docker, the backend reads from appsettings.json directly.
Run PostgreSQL 16 locally or in a standalone container:
docker run -d --name pg -e POSTGRES_PASSWORD=0549 -e POSTGRES_DB=LegalGuard -p 5432:5432 postgres:16-alpinecd back
cp appsettings.json.example appsettings.json # fill in your secrets
dotnet restore
dotnet ef database update
dotnet watch run --urls "http://localhost:5041"cd front
npm install
npm startApp runs at http://localhost:4200 and proxies API calls to http://localhost:5041.
| Directory | Stack | Description |
|---|---|---|
back/ |
ASP.NET 9 | Web API, EF Core, JWT, OpenAI |
front/ |
Angular 20 | SPA, Tailwind CSS, Lucide icons |
| (root) | Docker | docker-compose.yml for db, backend, frontend |
Browser → :4200 → Nginx (frontend container)
├── static files (Angular SPA)
├── /api/* → proxy → backend:5000
└── /ws/* → proxy → backend:5000 (WebSocket)
└── db:5432 (PostgreSQL)
All three services (database, backend, frontend) run in separate containers. Nginx serves the Angular app and reverse-proxies API and WebSocket requests to the backend.