An open API service indexing awesome lists of open source software.

https://github.com/coldsmirk/vef-framework-go

A comprehensive, enterprise-grade web framework for Go that accelerates the development of scalable, maintainable applications
https://github.com/coldsmirk/vef-framework-go

approval-workflow cqrs crud dependency-injection enterprise fiber go golang orm rest-api web-framework

Last synced: 6 days ago
JSON representation

A comprehensive, enterprise-grade web framework for Go that accelerates the development of scalable, maintainable applications

Awesome Lists containing this project

README

          

VEF Framework Go


VEF Framework Mascot


An opinionated Go framework for enterprise applications, built with Fiber, Uber FX, and Bun.


Unified API resources, generic CRUD, authentication, RBAC, validation, caching, events, storage, MCP, and more.


English |
简体中文 |
Quick Start |
Documentation |
API Reference


GitHub Release
Build Status
Coverage
Go Reference
Go Report Card
Ask DeepWiki
License

VEF Framework Go combines dependency injection, HTTP routing, and data access into a cohesive application framework, with built-in support for API resources, authentication, RBAC, validation, caching, events, storage, MCP, and more.

> This README is intentionally brief. Detailed tutorials and reference material are available on the [documentation site](https://coldsmirk.github.io/vef-framework-go-docs).

> Development status: the project is still pre-1.0. Expect breaking changes while conventions and APIs continue to evolve.

## Why VEF

- One resource model for both RPC and REST APIs
- Generic CRUD primitives that reduce repetitive backend code
- Modular composition with Uber FX for clean wiring and extension
- Built-in auth, RBAC, rate limiting, audit, caching, events, storage, MCP, and other infrastructure you would otherwise assemble yourself

## Quick Start

Requirements:
- Go 1.26.0 or newer
- `CGO_ENABLED=1` and a C toolchain — the built-in expression engine links the cgo-based `zen-go` library, so the framework cannot be built with `CGO_ENABLED=0`
- A supported database such as PostgreSQL, MySQL, or SQLite

Install:
```bash
go get github.com/coldsmirk/vef-framework-go
```

Create `main.go`:

```go
package main

import "github.com/coldsmirk/vef-framework-go"

func main() {
vef.Run()
}
```

Create `configs/application.toml`:

```toml
[vef.app]
name = "my-app"
port = 8080

[vef.data_sources.primary]
type = "sqlite"
path = "./my-app.db"

# Additional named sources are optional; each one is reachable through
# datasource.Registry.Get(""). Example:
# [vef.data_sources.analytics]
# type = "postgres"
# host = "analytics.example.com"
# database = "warehouse"
```

This is the smallest runnable configuration. Sections such as `vef.monitor`, `vef.mcp`, and `vef.approval` are optional.

Run:

```bash
go run main.go
```

VEF loads `application.toml` from `./configs`, `.`, `../configs`, or the path pointed to by `VEF_CONFIG_PATH`.

## Core Concepts

- `vef.Run(...)` starts the framework and wires the default module chain: config, data sources (the registry and primary database connection), middleware, API, security, event, CQRS, cron, redis, mold, storage, sequence, schema, monitor, MCP, and app.
- API endpoints are defined as resources with `api.NewRPCResource(...)` or `api.NewRESTResource(...)`.
- Business modules are composed with FX options, for example `vef.ProvideAPIResource(...)`, `vef.ProvideMiddleware(...)`, and `vef.ProvideMCPTools(...)`.
- CRUD-heavy modules can build on the generic helpers in `crud/` instead of writing repetitive handlers from scratch.

Typical application layout:

```text
my-app/
├── cmd/
├── configs/
└── internal/
├── auth/
├── sys/
├── /
└── web/
```

## Documentation

- Documentation site:
- API reference:
- Repository knowledge map:
- Testing conventions: [TESTING.md](./TESTING.md)

If you need step-by-step guides, architectural deep dives, or feature-specific reference, prefer the [documentation site](https://coldsmirk.github.io/vef-framework-go-docs) rather than expanding this README.

## Development

Common verification commands:

```bash
go test ./...
go test -race ./...
golangci-lint run
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -test ./...
```

## License

Licensed under the [Apache License 2.0](./LICENSE).