Introduction
Gin-Vue-Admin (GVA) is a full-stack admin development platform that pairs a Gin-based Go backend with a Vue 3 + Element Plus frontend. It provides code generation, role-based access control, and API management out of the box, letting teams scaffold enterprise backends in minutes rather than weeks.
What Gin-Vue-Admin Does
- Generates CRUD code (model, API, service, router, Vue page) from database tables
- Implements JWT authentication with token refresh and blacklisting
- Uses Casbin for fine-grained role-based access control policies
- Provides a visual API management interface for registering endpoints
- Includes file upload, Excel import/export, and email utilities
Architecture Overview
The backend follows a layered structure: router, middleware, API handler, service, and model. Gorm handles database operations supporting MySQL, PostgreSQL, and SQLite. The frontend is a standard Vite + Vue 3 SPA using Pinia for state and Element Plus for UI. Communication happens via RESTful JSON APIs with Swagger documentation auto-generated from code annotations.
Self-Hosting & Configuration
- Requires Go 1.21+ and Node.js 18+ with pnpm
- Database connection is configured in
config.yaml(MySQL, PostgreSQL, or SQLite) - Redis is optional, used for JWT blacklist and caching
- Run the initialization wizard on first start to create admin account and base data
- Deploy the Go binary behind Nginx with the Vue build served as static files
Key Features
- Visual code generator with template customization
- Dynamic menu and API permission assignment via web UI
- Operation logging and breakpoint-resume file uploads
- Plugin system for extending backend and frontend independently
- Multi-database support with runtime switchable data sources
Comparison with Similar Tools
- RuoYi — Java (Spring Boot) based, similar feature set for JVM teams
- vue-element-admin — Frontend only, no backend included
- go-admin — Lighter Go admin framework, less frontend polish
- Ant Design Pro — React frontend only, BFF pattern required
- Django Admin — Python-based auto-admin, less customizable UI
FAQ
Q: What databases are supported? A: MySQL, PostgreSQL, and SQLite via Gorm. The code generator works with all three.
Q: Can I use a different frontend framework? A: The backend is framework-agnostic REST. Community ports exist for React and other Vue UI libraries.
Q: How does the code generator work? A: It reads table schemas from the database and generates Go struct, service, router, API handler, and Vue page files using Go templates.
Q: Is it production-ready? A: Yes, many companies use GVA in production. It includes rate limiting, CORS, and security middleware by default.