Skip to content
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
16ba58c
modifying the repo-selection screen and policy graph visualizer ui ac…
kazuhidetonylee Jun 2, 2026
75f09e3
adding bottom bar and center align the policy graph
kazuhidetonylee Jun 2, 2026
5602853
updating the frontned startup instructiong
kazuhidetonylee Jun 4, 2026
e60c22c
refactor code into components and pages
kazuhidetonylee Jun 9, 2026
03689d6
adding detailed fields in the panel
kazuhidetonylee Jun 9, 2026
071e508
revising components on the panel to resembel the prototype
kazuhidetonylee Jun 9, 2026
feacfd4
adding enhancements on the graph: move graph moveable and deletable
kazuhidetonylee Jun 9, 2026
6e99c55
adding commit strip for history page
kazuhidetonylee Jun 9, 2026
9258d64
implementing search on panel and policy graph
kazuhidetonylee Jun 10, 2026
aad6142
editing box component
kazuhidetonylee Jun 10, 2026
c5ae9c6
adding favicon
kazuhidetonylee Jun 10, 2026
5e79309
refactor the file structure and archive the unused pages from previou…
kazuhidetonylee Jun 10, 2026
3541a28
adding asc/desc option for sorting
kazuhidetonylee Jun 10, 2026
7574766
syncing order between the commit history and the commit panel
kazuhidetonylee Jun 10, 2026
c1b042b
fixing issues with graph formatting
kazuhidetonylee Jun 10, 2026
b1fb998
refactoring code into states and interfaes
kazuhidetonylee Jun 10, 2026
fea1b5a
defining color palette
kazuhidetonylee Jun 10, 2026
1d328de
adding auto collaps and responsiveness to menu
kazuhidetonylee Jun 10, 2026
69723a1
patching tailwind warnings
kazuhidetonylee Jun 11, 2026
33d7356
moving playground into archive
kazuhidetonylee Jun 11, 2026
68619f0
clean up unused states and interfaces
kazuhidetonylee Jun 11, 2026
7eee98f
adding comments for states
kazuhidetonylee Jun 11, 2026
1cedfb3
adding agents.md for frontend
kazuhidetonylee Jun 11, 2026
50da0f5
revising agents.md and adding roles to agents
kazuhidetonylee Jun 11, 2026
099dc41
changing the repo selector logic to bypass gitbot warnings
kazuhidetonylee Jun 11, 2026
1b7f29b
adding spinner for loading state
kazuhidetonylee Jun 11, 2026
4da0576
fixing drop down to menu to only display 3 items per page
kazuhidetonylee Jun 11, 2026
37dcdb2
fixing pagination to include 10 commit messages per page
kazuhidetonylee Jun 11, 2026
ed270fe
synching data between history and compare tab
kazuhidetonylee Jun 11, 2026
df568de
editing graph highliths
kazuhidetonylee Jun 11, 2026
572043a
change graph comprison from hard-coded to dynamic comparison
kazuhidetonylee Jun 11, 2026
457a210
comment on mock data
kazuhidetonylee Jun 11, 2026
d494422
adding decodede json and envelope example in metadata tab
kazuhidetonylee Jun 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:
frontend:
build:
context: .
dockerfile: frontend/Dockerfile.dev
ports:
- "3000:3000"
environment:
CHOKIDAR_USEPOLLING: "true"
WATCHPACK_POLLING: "true"
volumes:
- ./frontend:/app
- frontend_node_modules:/app/node_modules

volumes:
frontend_node_modules:
5 changes: 3 additions & 2 deletions docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Ensure that you have [Docker] installed on your computer before proceeding.
### Frontend

```bash
docker build -t visualizer-frontend -f frontend/Dockerfile .
docker run --rm -p 3000:3000 visualizer-frontend
docker compose up --build
# App at http://localhost:3000
```

Expand All @@ -36,6 +35,7 @@ proceeding.
First, build start the backend:

Go (Gin) on port 5000:

```bash
cd go-backend
go mod download
Expand All @@ -58,6 +58,7 @@ commits, view/compare metadata, and analyze changes.
## Frontend usage

From the home page:

1. Enter a repository:
- Remote: full Git URL (e.g., `https://github.com/gittuf/gittuf.git`)
- Local: absolute path to a local Git repo
Expand Down
8 changes: 8 additions & 0 deletions frontend/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:20-alpine

WORKDIR /app

COPY frontend/package*.json ./
RUN npm install

CMD ["npm", "run", "dev", "--", "--hostname", "0.0.0.0"]
103 changes: 62 additions & 41 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
# gittuf Metadata Visualizer (Frontend)

This directory contains the frontend for the gittuf metadata visualizer, written
in Next.js.
This directory contains the active frontend for the gittuf metadata visualizer,
written in Next.js.

## Features

- **Commit Visualization**: Browse repository commits and view associated
security metadata JSON.
- **JSON Tree View**: Interactive tree visualization of JSON structures using
ReactFlow.
- **JSON Diff Visualization**: Visual diff between two commits’ metadata with
statistics.
- **JSON Diff Statistics**: Summarize added, removed, changed, and unchanged
elements.
- **Analysis Dashboard**: Chart the evolution, structure distribution, and
change frequency across multiple commits.
- **Dynamic File Selection**: Switch between different metadata files (e.g.,
`root.json`, `targets.json`).
- **Repository Entry Flow**: Connect a remote repository, point at a local
repository, or launch the demo workspace from the home screen.
- **Policy Graph Workspace**: Explore one or more draggable policy graphs inside
the main visualizer canvas, with tabbed canvases along the bottom bar.
- **Graph Source Controls**: Inspect repository, policy ref, policy version,
metadata source, and active mode from the detail panel.
- **Policy Query Panel**: Query a branch and changed path to see the matched
rule, required approvals, and authorized users.
- **History Timeline**: Open a history view with sortable commits, a commit
strip, and graph canvases for browsing policy state across revisions.
- **Comparison Canvas**: Generate side-by-side base and compare graphs with
added, removed, modified, and unchanged diff highlighting.
- **Metadata and Settings Panels**: Review metadata status and summary views,
then adjust visible node/detail settings for the workspace.

## Tech Stack

- **Framework**: Next.js 15 (App Router)
- **Framework**: Next.js 16 (App Router)
- **UI**: Tailwind CSS, shadcn UI components, Radix UI
- **Visualization**: ReactFlow, Chart.js & react-chartjs-2, Framer Motion
- **Icons**: Lucide React
- **Language**: TypeScript
- **Linting**: ESLint (Next.js Core Web Vitals, TypeScript)
- **Testing**: (Add when available)
- **Testing**: Typecheck + lint today, broader automated UI tests still to be added

## Getting Started

Expand Down Expand Up @@ -66,35 +68,54 @@ Open [http://localhost:3000](http://localhost:3000) in your browser.
```
frontend/
├── app/
│ ├── globals.css # Tailwind & global styles
│ ├── layout.tsx # Root layout & metadata
│ └── page.tsx # Main page with commit form & tabs
│ ├── globals.css # Tailwind & global styles
│ ├── layout.tsx # Root layout & metadata
│ ├── page.tsx # Home route: repository entry + visualizer workspace
├── screens/
│ ├── repository/
│ │ └── repository-selector.tsx # Repository selection screen
│ └── visualizer/
│ ├── visualizer-workspace.tsx
│ ├── policy-graph-canvas.tsx
│ ├── history-canvas.tsx
│ ├── detail-content.tsx
│ └── panel-tabs/ # Detail panel tabs shown inside the workspace
├── components/
│ ├── collapsible-card.tsx
│ ├── commit-list.tsx
│ ├── commit-compare.tsx
│ ├── commit-analysis.tsx
│ ├── json-tree-visualization.tsx
│ ├── json-diff-visualization.tsx
│ └── ui/ # Reusable UI primitives (Button, Input, Card, etc.)
├── lib/
│ ├── mock-api.ts # Mock fetching commits & metadata
│ ├── json-diff.ts # JSON comparison utilities
│ ├── utils.ts # Helper functions
│ └── types.ts # Type definitions
├── public/ # Static assets
├── components.json # shadcn config
├── next.config.ts
│ ├── app/ # Shared app shell pieces
│ ├── common/ # Reusable non-route-specific feature components
│ ├── ui/ # shadcn/Radix-based UI primitives
│ └── visualizer/ # Shared visualizer controls and primitives
├── hooks/
│ └── visualizer/ # Visualizer-specific hooks
├── lib/ # Utilities, constants, demo fixtures, and API helpers
├── archive/ # Non-runtime historical code only; do not treat this as active architecture
├── public/ # Static assets served by Next.js
├── assets/ # Imported image assets used by the UI
├── components.json # shadcn config
├── next.config.mjs
├── package.json
└── tsconfig.json
```

## Usage

1. Enter a GitHub repository URL containing gittuf metadata (e.g.,
`https://github.com/gittuf/gittuf`).
2. Click **Fetch Repository** to load commits.
3. Select a commit to view its metadata or choose two commits to compare.
4. Switch between **Commits**, **Visualization**, **Compare**, and **Analysis**
tabs.
5. Toggle between `root.json` and `targets.json` using the file buttons.
1. Open the home route and enter a Git repository URL, choose a local
repository, or launch the demo workspace.
2. Explore the visualizer workspace, including the graph canvas, history strip,
and detail panel tabs.

## Contributor Notes

- Active runtime code lives in `app/`, `screens/`, `components/`, `hooks/`,
and `lib/`.
- `archive/` is intentionally kept only for historical reference and is not
part of the active frontend architecture.
- The current home flow is:
`app/page.tsx` -> `hooks/use-repository-session.ts` ->
`screens/repository/repository-selector.tsx` ->
`screens/visualizer/visualizer-workspace.tsx`
- The visualizer feature is organized by responsibility:
`use-visualizer-layout.ts`, `use-visualizer-tabs.ts`,
`use-visualizer-history-compare.ts`, and `use-graph-viewport.ts`
coordinate the workspace state, while the policy graph renderer is split
between canvas composition, SVG rendering, and per-lane rendering helpers.
17 changes: 17 additions & 0 deletions frontend/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ body {

@layer base {
:root {
--primary-color: #a2c5e8;
--secondary-color: #bad1ea;
--tertiary-color: #04080e;
--gray-highlight: #f3f4f4;
--dark-gray: #7e7e7e;
--light-gray: #f5f5f5;
--background-color: #dbe3e5;
--modified-color: #3989d9;
--logo-blue: #c5dee5;
--approve-color: #79bc89;
--reject-color: #cb5151;
--selected-color: #e8f4ff;
--selected-color-50: rgba(232, 244, 255, 0.5);
--approve-color-12: rgba(121, 188, 137, 0.12);
--reject-color-12: rgba(203, 81, 81, 0.12);
--modified-color-18: rgba(57, 137, 217, 0.18);
--grid-color: rgba(4, 8, 14, 0.06);
--background: 0 0% 100%;
--foreground: 0 0% 3.9%;
--card: 0 0% 100%;
Expand Down
29 changes: 15 additions & 14 deletions frontend/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import type React from "react"
import type { Metadata } from "next"
import { Inter } from "next/font/google"
import "./globals.css"

const inter = Inter({ subsets: ["latin"] })

import type React from "react";
import type { Metadata } from "next";
import "./globals.css";
export const metadata: Metadata = {
title: "gittuf Metadata Visualizer",
description: "Visualize and analyze gittuf's security metadata structure across repository commits",
generator: 'v0.dev'
}
title: "Gittuf Visualizer",
description:
"Visualize and analyze gittuf's security metadata structure across repository commits",
generator: "v0.dev",
applicationName: "Gittuf Visualizer",
icons: {
icon: "/favicon.png",
},
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<body>{children}</body>
</html>
)
);
}
Loading