Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/songquanpeng/gin-template
用于 Gin & React 项目的模板. Template for Gin & React projects.
https://github.com/songquanpeng/gin-template
gin go react semantic-ui template
Last synced: 5 days ago
JSON representation
用于 Gin & React 项目的模板. Template for Gin & React projects.
- Host: GitHub
- URL: https://github.com/songquanpeng/gin-template
- Owner: songquanpeng
- License: mit
- Created: 2022-08-20T01:55:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-29T08:44:51.000Z (10 months ago)
- Last Synced: 2024-12-08T03:42:06.449Z (14 days ago)
- Topics: gin, go, react, semantic-ui, template
- Language: JavaScript
- Homepage: https://gin-template.vercel.app
- Size: 594 KB
- Stars: 242
- Watchers: 5
- Forks: 55
- Open Issues: 4
-
Metadata Files:
- Readme: README.en.md
- License: LICENSE
Awesome Lists containing this project
README
中文 | English# Gin Template
_✨ Template for Gin & React projects ✨_
Download
·
Tutorial
·
Feedback
·
Demo## Features
+ [x] Built-in user management.
+ [x] Built-in file management.
+ [x] [GitHub OAuth](https://github.com/settings/applications/new).
+ [x] WeChat official account authorization (need [wechat-server](https://github.com/songquanpeng/wechat-server)).
+ [x] Email verification & password reset.
+ [x] Request rate limiting.
+ [x] Static files caching.
+ [x] Mobile friendly UI.
+ [x] Token based authorization.
+ [x] Use GitHub Actions to build releases & Docker images.
+ [x] Cloudflare Turnstile user validation.## Deployment
### Manual deployment
1. Download built binary from [GitHub Releases](https://github.com/songquanpeng/gin-template/releases/latest) or build from source:
```shell
git clone https://github.com/songquanpeng/gin-template.git
go mod download
go build -ldflags "-s -w" -o gin-template
````
2. Run it:
```shell
chmod u+x gin-template
./gin-template --port 3000 --log-dir ./logs
```
3. Visit [http://localhost:3000/](http://localhost:3000/) and login. The username for the initial account is `root` and the password is `123456`.### Deploy with Docker
Execute: `docker run -d --restart always -p 3000:3000 -v /home/ubuntu/data/gin-template:/data -v /etc/ssl/certs:/etc/ssl/certs:ro justsong/gin-template`Data will be saved in `/home/ubuntu/data/gin-template`.
## Configurations
The system works out of the box.You can configure the system by set environment variables or specify command line arguments.
After the system starts, use `root` user to log in to the system and do further configuration.
### Environment Variables
1. `REDIS_CONN_STRING`: when set, Redis will be used as the storage for request rate limitation instead of memory storage.
+ Example: `REDIS_CONN_STRING=redis://default:redispw@localhost:49153`
2. `SESSION_SECRET`: when set, a fixed session key will be used so that the logged-in users' cookie remains valid across system reboots.
+ Example: `SESSION_SECRET=random_string`
3. `SQL_DSN`: when set, the target SQL database will be used instead of SQLite.
+ Example: `SQL_DSN=root:123456@tcp(localhost:3306)/gin-template`### Command line Arguments
1. `--port `: specify the port number, the default value is `3000`.
+ Example: `--port 3000`
2. `--log-dir `: specify the log dir, if not set, the log won't be saved.
+ Example: `--log-dir ./logs`
3. `--version`: print the version and exit.