Glowtype.me is a bilingual (English / Simplified Chinese) emotional type quiz site designed for young people. It offers a light, non-diagnostic way to reflect on feelings, plus optional anonymous chat and help resources.
frontend/: React + TypeScript + Vite SPA with react-i18next for i18nbackend/: Go (Gin) REST API providing quiz, scoring, glowtype content, AI chat, and admin paneldocs/: Comprehensive documentation
| Document | Description |
|---|---|
| DEPLOYMENT.md | Deployment guide, Docker setup, CI/CD |
| docs/DEVELOPMENT.md | Architecture, data models, API overview |
| docs/SECURITY.md | Authentication, 2FA, RBAC, audit logging |
| docs/ADMIN_GUIDE.md | Admin panel user guide |
| docs/API_REFERENCE.md | Complete REST API reference |
| docs/AI_INTEGRATION.md | AI provider setup and configuration |
| docs/SCORING_RULES.md | Quiz scoring system guide |
| docs/TROUBLESHOOTING.md | Common issues and solutions |
On a fresh Linux server with Docker available:
AI_API_KEY=your_key curl -fsSL https://raw.githubusercontent.com/soaringjerry/glowtype/main/scripts/remote_setup.sh | bashThe script will:
- Clone the repository to
~/glowtype - Create and configure environment files
- Auto-generate admin credentials and security keys
- Start Docker containers with Watchtower for auto-updates
After first start:
- Check
backend/.envfor the generatedADMIN_SUPER_PASSWORD - Login at
http://your-server:18081/admin - Change password and enable 2FA immediately
Override defaults with environment variables:
| Variable | Description | Default |
|---|---|---|
AI_API_KEY |
OpenAI-compatible API key | - |
AI_API_URL |
AI provider base URL | https://api.openai.com/v1 |
AI_MODEL |
AI model name | gpt-4o-mini |
GLOWTYPE_INSTALL_DIR |
Installation directory | ~/glowtype |
GLOWTYPE_BRANCH |
Git branch | main |
| Service | Host Port | Container Port |
|---|---|---|
| Backend | 18080 | 8080 |
| Frontend | 18081 | 80 |
Change in root .env:
GLOWTYPE_BACKEND_PORT_HOST=18080
GLOWTYPE_FRONTEND_PORT_HOST=18081cd backend
cp .env.example .env
go run ./cmd/glowtype-apiDefault: http://localhost:18080/api/v1
cd frontend
npm install
cp .env.example .env.local
npm run devDefault: http://localhost:5173
Configure VITE_API_BASE_URL in .env.local to point to the backend.
- Dashboard: Usage statistics, trends, geographic distribution
- Content Management: Quiz questions, glowtypes, scoring rules, AI prompts
- Glowpedia: Manage supportive content library
- User Management: Multiple admin roles with RBAC permissions
- Security: Two-factor authentication, audit logging
- AI Settings: Configure AI provider and rate limits (superadmin)
Automatic hourly backups are enabled by default:
BACKUP_ENABLED=1
BACKUP_INTERVAL_MINUTES=60
BACKUP_MAX_TOTAL_BYTES=5368709120 # 5GB
BACKUP_DIR=/data/backupFiles are named glowtype_<timestamp>.db. Restore by stopping the backend and replacing the database file.
- Two-Factor Authentication: TOTP with SHA-256, recovery codes, trusted devices
- RBAC: 6 roles with granular permissions
- Audit Logging: All admin operations recorded
- Privacy First: No PII collected, IP anonymized to region codes
See docs/SECURITY.md for details.
Set in backend/.env:
ADMIN_SUPER_PASSWORD=new_password
ADMIN_SUPER_PASSWORD_ROTATE=trueThen restart the backend.
Set in backend/.env:
ADMIN_LOGIN_RATE_LIMIT_DISABLE=1Restart, login, then re-enable rate limiting.
Superadmin can reset user 2FA in Admin Accounts page. If superadmin lost 2FA, directly update the database.
See docs/TROUBLESHOOTING.md for more.
MIT