CF

chenghonour/formulago

Database management

This page was translated automatically. Technical details may differ from the original. View the original

60 stars 17 forks Quality 59 Trend 22Apache-2.0

FormulaGo is an enterprise admin management application framework, AI-Native MCP Server. A powerful and streamlined backend management system framework supported by AI MCP.

Overview

It is a high-performance enterprise backend management framework, built on Hertz and Ent. Following the Clean Architecture / DDD design philosophy, it is an out-of-the-box RBAC permission management system. - — Built-in MCP (Model Context Protocol) service, enabling AI assistants like Claude to directly interact with backend data, ushering in the "AI management backend" era. - — Uses ByteDance's core framework Hertz, verified across tens of thousands of services. - — Four clear layers: Handler → Logic → Domain → Data. - — Ent generates type-safe Go database operation code. - — Casbin implements API-level granular permission management. - — Supports MySQL and PostgreSQL for automatic migration. - — Built-in login for Google, GitHub, and WeCom. - — Complete implementation of user, role, menu, dictionary, token, and log management. - Go 1.26+ - MySQL (or PostgreSQL) - Docker (optional, for local MySQL) Edit the configs/config.yaml configuration file. It is recommended to set sensitive information through environment variables to avoid submitting to git: FormulaGo has a built-in MCP (Model Context Protocol) server — turning the entire backend into a toolset that AI can call, opening a controlled data entry point for AI-native applications like Claude: - — For example, "Help me list the top 10 users" to query backend data without needing to teach it an HTTP interface. - — Users paste an address in Claude, and browser login authorization is automatically opened (PKCE protection), with no password management. - — Reuse the same set of JWT sessions and Casbin permissions: if you don't have permission on a webpage, AI can't change it either; Tokens must be issued via PKCE authorization stream to prevent "bare token direct connection" bypasses. - — Hang under the main Hertz service (/api/mcp), no separate port. hz update -I api -idl api/admin/admin.proto -model_dir api/model --unset_omitempty Below are the steps related to the admin management module; the steps for other modules are similar: 1. Create/modify schema in data/ent/schema/ 2. Run the ent code to generate 3.

Overview (machine translated)

English | Chinese

Introduction

FormulaGo is a high-performance enterprise backend management framework built on Hertz and Ent. Following Clean Architecture / DDD design philosophy, it is an out-of-the-box RBAC permission management system.

Front-end project address: formulago-front

  • AI-Native MCP Server — Built-in MCP (Model Context Protocol) service, allowing AI assistants like Claude to directly interact with backend data, ushering in the era of “AI management backend.”
  • High Performance — Uses ByteDance’s core framework Hertz, validated on tens of thousands of services.
  • Modular architecture — Four clear layers: Handler → Logic → Domain → Data.
  • Type-Safe ORM — Ent generates type-safe Go database operation code.
  • RBAC Permission Control — Casbin implements API-level granular permission management.
  • Multi-Database — Supports MySQL and PostgreSQL, automatic migration.
  • OAuth 2.0 Login — Built-in Google, GitHub, and WeCom login.
  • Out of the Box — Complete implementation of user, role, menu, dictionary, token, and log management.

Architecture

Technology Stack

Component Library
HTTP Framework Hertz
ORM Ent
Certification hertz-contrib/jwt
Permissions Casbin
MCP mcp-go
Database MySQL / PostgreSQL
Cache go-cache + Redis
Configuration koanf
Object Storage Alibaba Cloud OSS

Get Started Quickly

Prerequisites

  • Go 1.26+
  • MySQL (or PostgreSQL)
  • Docker (optional, for local MySQL)

1. Configuration

Edit the configs/config.yaml configuration file. Sensitive information is recommended to be set using environment variables to avoid submitting to git:

secret.sh has been added to .gitignore, so it will not be mistakenly submitted.

2. Start MySQL

3. Run

4. Initialize the database

Default administrator account: admin / formulago

Built-in features

Module Function Description
User management System user addition, deletion, modification, and lookup, role assignment
Role Management RBAC role CRUD, menu and API permission allocation
Menu management Hierarchical menu tree, button-level permission identification
Dictionary Management Key-value pair dictionary maintenance, supports multi-level dictionary details

This page was translated automatically. Technical details may differ from the original.

Install

This server does not publish a one-line install command.

Open the repository installation guide New to MCP? Start with the mcpskill.org guide →