linux-do/credit
linux-do/credit has 354 GitHub stars and 60 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-17 03:45 UTC. Last push 2026-10-22.
What you can do
- 🔐 OAuth2 Authentication - Integrated with Linux Do community account system
- 🛡️ Risk Control - Comprehensive trust level and risk assessment system
- 📊 Real-time Monitoring - Detailed distribution statistics and user behavior analysis
- 🎨 Modern Interface - Responsive design based on Next.js 16 and React 19
Measured star growth
- in 24h
- 0
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
LINUX DO Credit
Developer ToolsREADME.md
OriginalLINUX DO Credit
🚀 Linux Do Community Credit Service Platform
📖 Introduction
LINUX DO Credit is a credit service platform built for the Linux Do community, aimed at providing a series of credit-related services and offering a foundational framework for credit circulation for community developers.
✨ Key Features
- 🔐 OAuth2 Authentication - Integrated with Linux Do community account system
- 🛡️ Risk Control - Comprehensive trust level and risk assessment system
- 📊 Real-time Monitoring - Detailed distribution statistics and user behavior analysis
- 🎨 Modern Interface - Responsive design based on Next.js 16 and React 19
- ⚡ High Performance - Go Backend + Redis Cache + PostgreSQL Database
🏗️ Architecture Overview
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Frontend │ │ Backend │ │ Database │
│ (Next.js) │◄──►│ (Go) │◄──►│ (PostgreSQL) │
│ │ │ │ │ │
│ • React 19 │ │ • Gin Framework │ │ • PostgreSQL │
│ • TypeScript │ │ • OAuth2 │ │ • Redis Cache │
│ • Tailwind CSS │ │ • Session Store │ │ │
│ • Shadcn UI │ │ • OpenTelemetry │ │ │
│ │ │ • Swagger API │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
🛠️ Tech Stack
Backend
- Go 1.26 - Primary development language
- GIN - Web Framework
- GORM - ORM Framework
- Redis - Cache and session store
- PostgreSQL - Primary Database
- OpenTelemetry - Observability
- Swagger - API Documentation
Frontend
- Next.js 16 - React Framework
- React 19 - UI Library
- TypeScript - Type Safety
- Tailwind CSS 4 - Styling Framework
- Shadcn UI - Component Library
- Lucide Icons - Icon Library
📋 Requirements
- Go >= 1.26
- Node.js >= 18.0
- PostgreSQL >= 18
- Redis >= 6.0
- pnpm >= 8.0 (Recommended)
🚀 Quick Start
1. Clone the Project
git clone https://github.com/linux-do/credit.git
cd credit
2. Configure Environment
Copy the configuration file and edit it:
cp config.example.yaml config.yaml
Edit config.yaml to configure database connections, Redis, OAuth2, etc.
3. Initialize Database
# Create database
createdb -h <host> -p 5432 -U postgres linux_do_credit
# If you need to specify encoding, use:
# psql -h <host> -p 5432 -U postgres -c "CREATE DATABASE linux_do_credit WITH ENCODING 'UTF8' LC_COLLATE='zh_CN.UTF-8' LC_CTYPE='zh_CN.UTF-8' TEMPLATE template0;"
# Run migrations (automatically executed when starting the backend)
4. Start Backend
# Install Go dependencies
go mod tidy
# Generate API documentation
make swagger
# Start backend service
go run main.go api
5. Start Frontend
cd frontend
# Install dependencies
pnpm install
# Start development server
pnpm dev
6. Access Application
- Frontend Interface: http://localhost:3000
- API Documentation: http://localhost:8000/swagger/index.html
- Health Check: http://localhost:8000/api/v1/health
- Readiness Check: http://localhost:8000/api/v1/ready
⚙️ Configuration
Main Configuration Options
| Option | Description | Example |
|---|---|---|
app.addr |
Backend service listening address | :8000 |
app.user_whitelist |
Allowed LINUX DO usernames; omitted or empty means unrestricted | ["alice", "bob"] |
worker.port |
Worker probe port | 8001 |
scheduler.port |
Scheduler probe port | 8002 |
oauth2.client_id |
OAuth2 Client ID | your_client_id |
database.host |
PostgreSQL database host | 127.0.0.1 |
database.port |
PostgreSQL database port | 5432 |
database.username |
PostgreSQL database username | postgres |
database.password |
PostgreSQL database password | password |
database.database |
PostgreSQL database name | linux_do_credit |
database.ssl_mode |
PostgreSQL SSL mode | disable |
database.application_name |
PostgreSQL application name | credit-server |
database.search_path |
PostgreSQL search path | public |
database.default_query_exec_mode |
SQL cache mode | cache_statement |
redis.host |
Redis server address | 127.0.0.1 |
For detailed configuration instructions, please refer to the config.example.yaml file.
Set a non-empty app.user_whitelist in config.yaml and restart the service to restrict endpoints protected by the LoginRequired middleware to the listed users, including existing sessions. Other logged-in users receive HTTP 403. Usernames must match exactly, including case and surrounding whitespace.
🔧 Development Guide
Backend Development
# Run API server
go run main.go api
# Run task scheduler
go run main.go scheduler
# Run worker queue
go run main.go worker
# Generate Swagger documentation
make swagger
# Format and check code
make tidy
Frontend Development
cd frontend
# Development mode (using Turbopack)
pnpm dev
# Build production version
pnpm build
# Start production service
pnpm start
# Lint and format code
pnpm lint
pnpm format
📚 API Documentation
API documentation is automatically generated by Swagger and can be accessed after starting the backend service:
http://localhost:8000/swagger/index.html
🧪 Testing
# Backend testing
go test ./...
# Frontend testing
cd frontend
pnpm test
🚀 Deployment
Docker Deployment
# Build image
docker build -t linux-do-credit .
# Run container
docker run -d -p 8000:8000 linux-do-credit
Production Environment Deployment
Build frontend resources:
cd frontend && pnpm buildCompile backend program:
go build -o credit main.goConfigure
config.yamlfor productionStart service:
./credit api
🤝 Contribution Guidelines
We welcome community contributions! Please read the following before submitting code:
Submission Process
- Fork this repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit changes (
git commit -am 'Add your feature') - Push to branch (
git push origin feature/your-feature) - Create Pull Request
📄 License
This project is open source under the Apache2.0 License.
🔗 Related Links
❤️ Acknowledgements
Thanks to all developers who contributed to this project and the support of the Linux Do Community!