# tool-go **Repository Path**: winddsnow/tool-go ## Basic Information - **Project Name**: tool-go - **Description**: No description available - **Primary Language**: Go - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-24 - **Last Updated**: 2026-06-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Tool Go — Developer Toolbox
The Swiss Army Knife for Developers — Toolbox + Admin Panel + RBAC Permission System
--- **Tool Go** is a full-stack developer toolbox and admin management system. It integrates 12 commonly-used development tools (JSON Formatter, Regex Tester, Base64, Hash Encryption, etc.) with a complete RBAC permission management system, serving both as an everyday productivity tool and an extensible admin platform. Built with **GoFrame v2 + Vue 3 + TypeScript + Element Plus**, the backend follows GoFrame's RESTful API design, the frontend uses Vite for blazing-fast builds, and supports enterprise-grade features like dynamic menus, button-level permission control, and JWT dual-token authentication. > This project was developed collaboratively by developer **winddsnow** and AI large language models (**MiMo v2.5 Pro**, **DeepSeek V4**). The AI models actively participated in architecture design, code implementation, debugging, and feature iteration throughout the entire development process — a practical demonstration of human-AI collaborative development. ## Highlights - **12 Developer Tools** — JSON Formatter, Text Diff, Regex Tester, Base64, Hash, Password Generator, UUID, QR Code, and more — all client-side - **Dynamic Menu System** — Data-driven menus, different roles see different sidebars, 3-level support (Directory / Menu / Button) - **Fine-grained RBAC** — Role → Menu + Role → Permission code, button-level control (e.g. `user:create`, `role:delete`) - **JWT Dual-Token Auth** — Access Token (15min) + Refresh Token (7 days, HttpOnly Cookie), auto-refresh on 401 - **Security Hardening** — Login rate limiting (5 req/min/IP), CSP headers, XSS protection, password MD5+Salt hashing - **Admin Panel** — User, Role, and Menu management with visual permission assignment - **Instant Usability** — New users auto-assigned basic role, login and use the toolbox immediately ## Tech Stack ### Backend | Technology | Description | |------------|-------------| | **GoFrame v2** | High-performance Go web framework, RESTful API, ORM, middleware | | **PostgreSQL** | Relational database, 7 core tables | | **JWT** | golang-jwt/jwt/v5, dual-token authentication | | **Swagger** | Auto-generated API docs (dev mode) | ### Frontend | Technology | Description | |------------|-------------| | **Vue 3** | Composition API, reactive, component-based | | **TypeScript** | Type safety, compile-time error checking | | **Vite** | Lightning-fast builds, HMR in dev | | **Element Plus** | Enterprise-grade UI component library | | **Pinia** | Lightweight state management with persistence | | **Vue Router** | Dynamic routes, menu-driven registration | ## Features ### Toolbox (12 tools, client-side) | Category | Tools | |----------|-------| | Text | JSON Formatter, Text Diff, Regex Tester, Case Converter | | Encoding | Base64 Encoder/Decoder, Hash (MD5/SHA1/SHA256) | | Generation | Password Generator, Mock Data Generator (9 types), UUID Generator, QR Code Generator | | Conversion | Timestamp Converter (16 timezones) | ### Admin Panel - **Dashboard** — System stats (users, roles, visits) - **User Management** — CRUD, role assignment, paginated search - **Role Management** — CRUD, menu assignment, permission assignment, paginated search - **Menu Management** — Dynamic menu tree CRUD (directory/menu/button) ### Auth & Permissions (3-layer RBAC) - **JWT Auth** — Access Token (15min) + Refresh Token (7 days, HttpOnly Cookie) - **Role Control** — `super_admin` / `admin` / `user`, customizable - **Menu Permissions** — Different roles see different sidebar menus - **Button Permissions** — Fine-grained permission codes (e.g. `user:create`, `role:delete`) - **New users auto-assigned `user` role** ### Security - **Login Rate Limiting** — IP-based sliding window, 5 req/min - **CSP Headers** — Content-Security-Policy, X-Frame-Options, X-XSS-Protection, etc. - **Token Refresh** — 401 auto-refresh via Axios interceptor - **Password Hashing** — MD5 + Salt ## Quick Start ### Prerequisites - Go 1.22+ - Node.js 18+ - PostgreSQL 14+ ### Database Setup ```sql CREATE DATABASE tool_go_dev; ``` ```bash psql -U postgres -d tool_go_dev -f manifest/sql/init.sql ``` ### Backend ```bash go mod tidy go run main.go # Dev server :8000, Swagger at /swagger ``` ### Frontend ```bash cd web npm install npm run dev # Dev server :3000, Vite proxies /api → :8000 npm run build # Production build (vue-tsc typecheck + vite build) ``` ## Default Account | Username | Password | Role | |----------|----------|------| | walter | walter | Super Admin (super_admin) | > Seed data from `manifest/sql/init.sql`. Password hashing uses MD5 + Salt. ## RBAC Permission Model ### Roles | Role | Description | Visible Menus | Button Permissions | |------|-------------|----------------|-------------------| | super_admin | Super Admin | All | All 7 permissions | | admin | Admin | Toolbox, User Mgmt, Role Mgmt | user:create/delete/assign-roles, role:create/delete | | user | Regular User | Toolbox | None | ### Permission Codes | Code | Description | |------|-------------| | user:create | Create user | | user:delete | Delete user | | user:assign-roles | Assign roles | | role:create | Create role | | role:delete | Delete role | | menu:create | Create menu | | menu:delete | Delete menu | ## Configuration ### JWT ```yaml # manifest/config/config.yaml jwt: secret: "dev-jwt-secret-key-123456" # Change in production expires: "24h" issuer: "tool-go" ``` ### Environment Switch ```bash export GF_GENV=prod # Loads config.prod.yaml ``` ## Docker ```bash # Build image (GF_GENV=prod is baked in) docker build -f manifest/docker/Dockerfile -t tool-go . # Run (mount production config) cp manifest/config/config.prod.yaml.example manifest/config/config.prod.yaml # Edit config.prod.yaml with real DB connection and JWT secret docker run -d -p 8000:8000 \ -v $(pwd)/manifest/config/config.prod.yaml:/app/manifest/config/config.prod.yaml \ tool-go ``` ## Systemd Deployment (Recommended for Production) ### 1. Build ```bash go build -o tool-go main.go ``` ### 2. Deploy Files ```bash mkdir -p /opt/tool-go cp tool-go /opt/tool-go/ cp -r manifest /opt/tool-go/ cp -r resource /opt/tool-go/ # Configure production cp /opt/tool-go/manifest/config/config.prod.yaml.example /opt/tool-go/manifest/config/config.prod.yaml # Edit config.prod.yaml with real DB connection and JWT secret ``` ### 3. Create Systemd Service ```bash sudo tee /etc/systemd/system/tool-go.service <<'EOF' [Unit] Description=Tool Go Backend After=network.target postgresql.service Wants=postgresql.service [Service] Type=simple User=root WorkingDirectory=/opt/tool-go ExecStart=/opt/tool-go/tool-go Restart=always RestartSec=5 Environment=GF_GENV=prod StandardOutput=journal StandardError=journal NoNewPrivileges=true ProtectSystem=full ProtectHome=true [Install] WantedBy=multi-user.target EOF ``` ### 4. Start Service ```bash sudo systemctl daemon-reload sudo systemctl enable tool-go sudo systemctl start tool-go # Check status sudo systemctl status tool-go # View logs sudo journalctl -u tool-go -f ``` ## Collaborators This project was developed collaboratively by **winddsnow** and AI large language models. The AI models actively participated in architecture design, code implementation, debugging, and feature iteration throughout the entire development process. | Collaborator | Model | Contribution | |--------------|-------|--------------| | **winddsnow** | — | Project initiation, requirements, code review, testing | | **MiMo v2.5 Pro** | Xiaomi MiMo | Code implementation, feature development, debugging, documentation | | **DeepSeek V4** | DeepSeek | Architecture design, solution review, early feature development | > This project is a practice of human-AI collaborative development. AI models have significantly improved efficiency in daily coding, debugging, and documentation, while human developers play an irreplaceable role in requirements control, architectural decisions, and quality assurance. ## License MIT