feat: initial TrustOS platform scaffold

- FastAPI backend: auth, findings, dashboard, attack paths, footprint, AI translator, risk calculator, PDF report generator
- Next.js frontend: Vault dashboard, login, findings table, finding detail with AI coach, digital footprint, reports
- PostgreSQL data model: tenants, users, assets, findings, risk scores, audit reports, attack paths
- Docker Compose + Dockerfiles for all services
- Demo seed data: Acme Corp with 6 findings and 90-day risk score history
- AI Risk Translator (OpenAI/Anthropic) with plain-English business impact
- Role-based access: executive / it_admin / trustos_admin
- Scope-lock engine: authorization required before any assessment

Stage 1-8 complete: Phase 1 Vault Audit product ready
This commit is contained in:
drjones
2026-07-05 09:46:08 +00:00
commit 463dff883b
64 changed files with 11679 additions and 0 deletions

16
infra/Dockerfile.backend Normal file
View File

@@ -0,0 +1,16 @@
FROM python:3.10-slim
WORKDIR /app
RUN apt-get update && apt-get install -y \
libpango-1.0-0 libpangoft2-1.0-0 libpangocairo-1.0-0 \
libcairo2 libglib2.0-0 libharfbuzz0b libfontconfig1 \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

11
infra/Dockerfile.frontend Normal file
View File

@@ -0,0 +1,11 @@
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
EXPOSE 3000
CMD ["npm", "run", "dev"]

59
infra/docker-compose.yml Normal file
View File

@@ -0,0 +1,59 @@
services:
postgres:
image: postgres:16-alpine
container_name: trustos_postgres
environment:
POSTGRES_USER: trustos
POSTGRES_PASSWORD: trustos_dev
POSTGRES_DB: trustos
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U trustos -d trustos"]
interval: 5s
timeout: 5s
retries: 10
backend:
build:
context: ../backend
dockerfile: ../infra/Dockerfile.backend
container_name: trustos_backend
env_file:
- ../backend/.env
environment:
DATABASE_URL: postgresql+asyncpg://trustos:trustos_dev@postgres:5432/trustos
SYNC_DATABASE_URL: postgresql://trustos:trustos_dev@postgres:5432/trustos
STORAGE_PATH: /app/storage
ports:
- "8000:8000"
volumes:
- ../backend:/app
- storage:/app/storage
depends_on:
postgres:
condition: service_healthy
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
frontend:
build:
context: ../frontend
dockerfile: ../infra/Dockerfile.frontend
container_name: trustos_frontend
environment:
NEXT_PUBLIC_API_URL: http://localhost:8000
ports:
- "3000:3000"
volumes:
- ../frontend:/app
- /app/node_modules
- /app/.next
depends_on:
- backend
command: npm run dev
volumes:
pgdata:
storage: