English | 简体中文
Rabbit Admin is a backend management template based on Golang and Vue3.
In addition to the basic technology stack, it is mainly based on the author's other open source projects:
At present, the backend scaffolding is not yet stable, and I am still considering the design of certain modules.
Frontend technology stack:
- Vue3 + Vue Router + Pinia + VueUse
- UnoCSS + UnoCSS UI
- Eslint + @antfu/eslint-config + @unocss/eslint-config,no Prettier
Backend technology stack:
Run the backend project:
git clone https://github.com/szluyu99/rabbit-admin.git
cd rabbit-admin/cmd
# MySQL
# Create the database rabbit_admin
go run . -d mysql -n "root:123456@tcp(127.0.0.1:3306)/rabbit_admin?charset=utf8mb4&parseTime=True&loc=Local"
# Sqlite
# No other actions are required
go run . -d sqlite -n "rabbit_admin.db"
You can directly run the
run_mysql.sh
orrun_sqlite.sh
file.
After running the backend project, create a super administrator account: admin@test.com, 123456
# MySQL
go run . -d mysql -n "root:123456@tcp(127.0.0.1:3306)/rabbit_admin?charset=utf8mb4&parseTime=True&loc=Local" -superuser admin@test.com -password 123456
# Sqlite
go run . -d sqlite -n "rabbit_admin.db" -superuser admin@test.com -password 123456
You can directly run the
createsuper_mysql.sh
orcreatesuper_sqlite.sh
file.
Run the frontend project:
cd rabbit-admin/web
npm install -g pnpm
pnpm install
pnpm run dev
Visit http://localhost:5173
By default, only the super administrator user can manage the permission module.
After logging in with the super administrator account, you can create roles on the Role page, assign permissions to roles on the Permission page, and finally assign roles to users on the User page (or set the default role when creating a user on the Config page).
-
Run the project and create a super administrator account, then log in to the system.
-
Go to the Permission page and click the initialize button to initialize default permissions.
-
Go to the Role page and click the initialize button to initialize three default roles: admin, user, test.
- You can then assign permissions to roles and also assign roles to users on the User page.
- Go to the Config page to view the project's default configuration:
- USER_NEED_ACTIVATE: whether users need to be activated
- API_NEED_AUTH: whether APIs need to be authenticated. If set to false, all APIs do not require authentication.
- CREATE_DEFAULT_ROLE: the name of the default role when creating a user, which needs to exist in Role.
If using MySQL, you can directly import the
rabbit_admin.sql
.
- super user account: admin@test.com, 123456
- regular user account: user@test.com, 123456
-
Log out of the current account, or open a new browser (or incognito window) and register a new account, then log in.
-
The default permission level for a new account is "user" (set by
CREATE_DEFAULT_ROLE
in the Config page). -
If no permissions are assigned to a role by default, a newly created account can only access APIs with "Anonymous" permissions.