archview

Examples

Two runnable demos in the repository.

The repo ships two example apps under examples/. Each mounts archview and demonstrates a different architecture.

gin-mvc

Modular MVC over ginuser and product modules, each wired repository → service → controller through interfaces.

go -C examples/gin-mvc run -buildvcs=false .
# open http://localhost:8080/graph

You'll see two swimlanes; each endpoint flows GET /users → (*UserController).List → (*userService).ListUsers → (*userRepository).FindAllUsers.

hexagonal

Ports & adapters over net/httpcatalog and billing bounded contexts. The catalog use case fans out to two outbound adapters (a Postgres repository and a gateway notifier).

go -C examples/hexagonal run -buildvcs=false .
# open http://localhost:8090/graph

Runs with ShowPorts, so the OrderRepository and ItemNotifier interfaces appear as port nodes.

cqrs

CQRS + command/query/event buses over net/http, run with DetectBuses. Each HTTP endpoint dispatches a command or query through a bus; handlers publish domain events to subscribers — and archview draws the precise routing.

go -C examples/cqrs run -buildvcs=false .
# open http://localhost:8095/graph

grpc

A gRPC OrderService in clean architecture. The RPC methods are detected as endpoints and flow through the server adapter → service → repository.

go -C examples/grpc run -buildvcs=false .
# open http://localhost:8096/graph

graphql

gqlgen-style resolvers in clean architecture. Query and mutation fields are detected as endpoints and flow through the resolver → service → repository.

go -C examples/graphql run -buildvcs=false .
# open http://localhost:8097/graph

echo

Modular MVC over echo with an /api group, showing how archview is used with echo: routes (incl. group prefixes) are detected, and archview is served on its own port — the cleanest way to mount it with any framework.

go -C examples/echo run -buildvcs=false .
# open http://localhost:9098/graph

Each example is a separate Go module with a replace directive pointing at the repo root, so they always build against your local copy.

On this page