# ginCore **Repository Path**: fileall/gin-core ## Basic Information - **Project Name**: ginCore - **Description**: gin框架封装的简易流程 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-10-27 - **Last Updated**: 2025-10-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Gin-Core A foundational development framework based on Gin, providing basic modules and features to accelerate the development of web applications. ## Features - Basic routing setup - JWT authentication support - Cross-origin request handling - Database initialization (MySQL) - Logging - Redis initialization - File storage configuration - Form validation - Custom response format - User registration and login - Image upload processing ## Installation 1. Ensure you have the Go language environment installed. 2. Clone the repository: ```bash git clone https://gitee.com/fileall/gin-core.git ``` 3. Install dependencies: ```bash go mod download ``` ## Configuration Edit the `config.yaml` file to suit your environment: ```yaml app: name: Gin Core env: dev port: 8080 timezone: Asia/Shanghai database: host: 127.0.0.1 port: 3306 user: root password: yourpassword dbname: gincore charset: utf8mb4 debug: true jwt: secret: your_jwt_secret timeout: 7200 # seconds storage: default: local disks: local: root: ./runtime/uploads ``` ## Running Run the following command in the project root directory: ```bash go run main.go ``` After the service starts, the default access address is `http://localhost:8080`. ## Usage ### User Registration Send a POST request to `/api/user/register` with the parameters: ```json { "username": "testuser", "password": "testpassword" } ``` ### User Login Send a POST request to `/api/user/login` with the parameters: ```json { "username": "testuser", "password": "testpassword" } ``` Upon successful login, a JWT token will be returned. ### Image Upload Send a POST request to `/api/upload/image`, including the token in the Header: ``` Authorization: Bearer ``` Include the `file` field in the form data. ## Directory Structure ``` ├── app │ ├── common │ │ ├── middleware # Middleware │ │ ├── model # Data models │ │ ├── utils # Utility functions │ │ └── validate # Form validation │ └── controller # Controllers │ └── api ├── config # Configuration files ├── coreGo │ ├── core # Core functionality │ ├── facade # Facade pattern implementation │ ├── global # Global variables │ ├── initialize # Initialization scripts │ └── lang # Language packages ├── route # Route definitions ├── runtime # Runtime data ├── main.go # Entry point └── go.mod # Go module configuration ``` ## Contributors Please read the CONTRIBUTING.md file to learn how to contribute code. ## License MIT License; please see the LICENSE file for details.