Architecture
NexAuth is built with a modular, event-driven architecture that supports multiplatform deployment and extensibility.System Architecture
Core Components
Authentication Layer
Handles all authentication operations with provider abstraction:PremiumAuthProvider- Mojang authenticationOfflineAuthProvider- Password-based authenticationFloodgateAuthProvider- Bedrock player authentication
Session Manager
Manages player sessions with persistence and validation:- Session persistence across restarts
- IP-based validation (optional)
- Cross-server session synchronization
- Automatic cleanup and expiration
Database Layer
Abstract database interface supporting multiple backends:- MySQLDatabase - Production MySQL/MariaDB
- PostgreSQLDatabase - PostgreSQL support
- H2Database - Testing and development
Event System
Event-driven architecture for extensibility:Platform Integration
Velocity Integration
Paper Integration
Data Flow
Authentication Flow
Session Validation Flow
Security Architecture
Password Security
Brute Force Protection
Performance Optimization
Caching Strategy
Async Operations
Extension Points
Custom Auth Providers
Event Listeners
Design Patterns
Provider Pattern
Provider Pattern
Authentication providers implement a common interface for extensibility.Benefits:
- Easy to add new authentication methods
- Runtime provider selection
- Testable components
Event-Driven Architecture
Event-Driven Architecture
Loose coupling through events for extensibility.Benefits:
- Plugins can react to auth events
- No modification of core code needed
- Async event processing
Repository Pattern
Repository Pattern
Database abstraction for backend independence.Benefits:
- Easy database backend switching
- Testable with mock repositories
- Centralized data access
Builder Pattern
Builder Pattern
Configuration builders for complex object creation.Benefits:
- Readable configuration code
- Immutable configuration objects
- Validation during build
Technology Stack
Core
- Java 17+
- Maven/Gradle
- SLF4J logging
Velocity
- Velocity API
- Velocity proxy integration
- Cross-server messaging
Paper
- Paper API
- Spigot API
- Bukkit API
Database
- HikariCP connection pooling
- JDBC
- Database migrations
Next Steps
Building from Source
Build and compile NexAuth for development.

