A web application that allows users to register accounts using invitation codes, download WireGuard VPN credentials, and provides administrators with minimal user management capabilities. The application will support bilingual interface (English and Farsi) and include comprehensive setup instructions for various devices.
- Provide a streamlined way for users to obtain WireGuard VPN credentials
- Enable minimal administrative control with hands-off user management
- Support both English and Farsi-speaking users (manual toggle)
- Ensure secure credential distribution and immediate revocation
- Keep costs minimal using open-source solutions
- Maintain user privacy with no email requirements
- Primary: ~50 individuals needing VPN access (free service)
- Geographic: English and Farsi-speaking regions
- Technical Level: Mixed (basic to intermediate)
- Devices: Multiple devices per user allowed
- Privacy: Anonymous registration (no email required)
- Primary: Single administrator (hands-off approach)
- Responsibilities: Generate invitation codes, view registered users, device counts, disable users when needed
- User Registration: Invitation code-based registration (no email required)
- Anonymous Access: Users create username/password only
- Login System: Secure authentication with session management
- Password Reset: Admin-assisted password reset (no email recovery)
- Multi-language Support: Manual toggle between English and Farsi
- Multiple Devices: Users can generate configs for multiple devices
- Credential Generation: Automatic WireGuard config generation per device
- Self-Service: Users can regenerate their own credentials
- Download Interface: Secure credential download (QR code + config file)
- Device Instructions: Step-by-step setup guides for:
- Windows
- macOS
- iOS
- Android
- Linux
- Credential Status: Active/Inactive status display
- No Expiration: Credentials remain valid until manually disabled
- User Overview:
- View all registered users
- See device count per user
- Disable user accounts (immediate termination)
- Invitation Management:
- Generate invitation codes
- View code usage status
- Simple Controls:
- One-click user disable/enable
- Basic user statistics
- No Logging: No activity logs or detailed monitoring
- Interface Language: Manual toggle between English and Farsi
- Instructions: Complete setup guides in both languages
- Admin Interface: Bilingual admin panel
- No RTL: Simple language toggle without complex RTL layout
- Framework: Next.js 14 with App Router
- Styling: Tailwind CSS + Shadcn UI components
- Animation: Framer Motion
- State Management: React Context/Zustand
- Internationalization: next-i18next or similar
- Database: SQLite with Drizzle (local file, free)
- Authentication: NextAuth.js (free, open-source alternative to Clerk)
- API: Next.js Server Actions
- File Storage: Local filesystem (no external storage needed)
- Server: WireGuard server on a cloud provider (e.g., Hetzner, AWS, etc.)
- Server Specs: Recommended 2 vCPU, 4GB RAM, 40GB storage
- Endpoint: Your server's domain (e.g., vpn.yourdomain.com)
- Port: 51820/UDP (configurable)
- Key Management: Automated key pair generation using Node.js crypto
- Config Generation: Dynamic WireGuard config creation
- Peer Management: Direct
wgcommands for peer addition/removal - Immediate Termination: Active connection termination on user disable
- IP Range: 10.0.0.0/24 for VPN clients (configurable)
- Hosting: Single Cloud Server (e.g., Hetzner, DigitalOcean)
- Domain: A domain you own (e.g., yourdomain.com)
- Server: Ubuntu 22.04 LTS (recommended)
- SSL: Cloudflare (Full SSL/TLS) or Let's Encrypt
- Reverse Proxy: Nginx
- Services: Next.js app + WireGuard server on the same machine
- As a user, I want to register with an invitation code so that I can access VPN credentials anonymously
- As a user, I want to create multiple device configs so that I can use VPN on all my devices
- As a user, I want to download my WireGuard config so that I can set up VPN
- As a user, I want to see QR codes so that I can easily configure mobile devices
- As a user, I want setup instructions in my language so that I can configure my device
- As a user, I want to regenerate my credentials so that I can refresh my access
- As an admin, I want to generate invitation codes so that I can control who registers
- As an admin, I want to view all users so that I can see usage
- As an admin, I want to disable users so that I can immediately revoke access
- As an admin, I want to see device counts so that I can monitor usage patterns
- Strong password requirements
- Invitation code validation
- Session management with secure tokens
- Rate limiting on authentication endpoints
- Secure key generation using cryptographically secure methods
- Encrypted storage of private keys
- Secure transmission of credentials (HTTPS only)
- Automatic credential cleanup on user deactivation
- Role-based access control
- Secure admin authentication
- Protected admin endpoints
- Invitation code expiration
- Page load times < 2 seconds
- Config generation < 5 seconds
- Support for ~50 concurrent users
- 99% uptime target (single server)
- Responsive design (mobile-first)
- Intuitive user interface
- Clear error messages
- Accessibility compliance (WCAG 2.1)
- No email collection
- Minimal user data storage
- Anonymous registration process
- No activity logging
- User registration rate via invitation codes
- Credential download completion rate
- Device setup success rate
- System uptime
- Response times
- Error rates
- WireGuard server installation and configuration
- User registration with invitation codes (NextAuth.js)
- Multi-device credential generation
- Download interface with QR codes
- English-only interface
- Basic admin panel
- Farsi language support (manual toggle)
- Comprehensive device instructions
- Self-service credential regeneration
- Immediate connection termination on disable
- UI/UX improvements
- Performance optimization
- Security hardening
- Documentation and setup guides
- WireGuard server integration complexity
- Key management security
- Single server dependency
- SQLite performance limitations
- User adoption challenges
- Server infrastructure costs
- Security vulnerabilities
- Admin generates codes: Random 8-character alphanumeric codes
- Code expiration: 30 days from generation
- Single use: Each code can only be used once
- User registration: Code + username + password
- No email: No email verification required
- User receives invitation code from admin
- User visits registration page
- User enters: invitation code, desired username, password
- System validates code and creates account
- User can immediately generate device credentials
- Clone the LeiaGuard repository and install dependencies
- Configure environment variables and database
- Install and configure WireGuard on Hetzner server
- Implement invitation code system
- Build credential generation functionality
- Create bilingual interface
- Server: Ubuntu 22.04 LTS on a cloud provider
- Domain: A domain you own
- SSL: Cloudflare (Full SSL/TLS) or Let's Encrypt
- CI/CD: Manual deployment via
deploy-hetzner.sh(can be adapted)