No description
- JavaScript 50.2%
- Go 34.8%
- CSS 11.7%
- HTML 3.1%
- Dockerfile 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .forgejo/workflows | ||
| handlers | ||
| models | ||
| tools | ||
| web | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| CONFIG.md | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| IMPLEMENTATION.md | ||
| main.go | ||
| QUICK_REF.md | ||
| README.md | ||
🏆 Tierlist Maker
A full-featured web application for creating and ranking tierlists with OIDC authentication via Authelia.
Features
- 🔐 OIDC Authentication - Secure login via Authelia
- 📝 Tierlist Management - Create, edit, and delete tierlists (admin only)
- 🎨 Beautiful UI - Modern, responsive design with drag-and-drop ranking
- 📊 Stats & Rankings - View best-rated items and user preferences
- 👥 Multi-user - Each user can submit one ranking per tierlist
- 🛡️ Authorization - Admin-only panel with role-based access control
Data Persistence
Current Implementation: All data is stored in memory (RAM) only. This means:
- Data is lost when the server restarts
- No persistent storage across deployments
- Suitable for development/testing only
Future Enhancement: To add persistent storage, you can:
- Add a database (PostgreSQL, MySQL, MongoDB)
- Store tierlists, items, and rankings in the database
- Upload images to cloud storage (AWS S3, etc.) or local filesystem
- Implement data migration scripts
Quick Start
1. Clone & Setup
cd /path/to/tierlist
go mod download
2. Configure OIDC
Copy and edit the configuration file:
cp .env.example .env
Edit .env with your Authelia OIDC settings:
OIDC_ISSUER=https://your-authelia-domain.com
OIDC_CLIENT_ID=tierlist
OIDC_CLIENT_SECRET=your-generated-secret
OIDC_REDIRECT_URL=http://localhost:8080/callback
ADMIN_USERS=your-username
See CONFIG.md for detailed configuration instructions.
3. Run Server
# Load environment variables and start
export $(cat .env | xargs)
go run main.go
Visit http://localhost:8080 in your browser.
Project Structure
├── main.go # Server entry point
├── handlers/ # HTTP handlers and middleware
│ ├── auth.go # OIDC authentication
│ ├── api.go # REST API endpoints
│ └── *_test.go # Tests
├── models/ # Data models and store
├── web/ # Frontend assets
│ ├── index.html # Main tierlist UI
│ ├── admin.html # Admin panel
│ ├── app.js # Tierlist interaction
│ ├── admin.js # Admin functionality
│ └── style.css # Styling
├── .env.example # OIDC configuration template
└── CONFIG.md # Configuration guide
API Endpoints
Public
GET /api/tierlists- List all tierlistsGET /api/tierlists/{id}- Get tierlist details with stats
Authenticated
POST /api/tierlists/{id}/results- Submit ranking
Admin (authenticated + admin role)
POST /api/tierlists- Create tierlistPUT /api/tierlists/{id}- Update tierlistDELETE /api/tierlists/{id}- Delete tierlistPOST /api/tierlists/{id}/items- Add item to tierlist
Authentication Flow
- User clicks "Login" → redirected to OIDC provider
- After successful auth → redirected to callback
- Session stored in secure cookie
- Each request checks session before allowing access
Admin Features
- Create new tierlists with names and descriptions
- Edit tierlist metadata
- Delete tierlists (with confirmation)
- Add items to tierlists (with image URLs or base64)
User Features
- Browse available tierlists
- Rank items by dragging into S-F tiers
- View statistics (best-rated items, top picks by user)
- One submission per user per tierlist (replaceable)
Development
Run Tests
go test ./...
Build Binary
go build -o tierlist
Hot Reload (optional)
go install github.com/cosmtrek/air@latest
air
Configuration Details
See CONFIG.md for:
- OIDC provider setup
- Authelia integration instructions
- Environment variables reference
- Production deployment considerations
Security Notes
- Session cookies use secure settings (httpOnly, sameSite)
- OIDC tokens verified server-side
- Admin routes protected by role check
- Users limited to one submission per tierlist
- All user input is escaped to prevent XSS
Future Enhancements
- Database persistence (currently in-memory)
- Item editing/deletion
- Advanced statistics and visualizations
- Batch item imports (CSV, JSON)
- Social features (comments, sharing)
- Dark mode
License
MIT (or your preferred license)