A modern traditional BBS implementation in Rust with intelligent telnet protocol support and adaptive terminal capabilities.
- Learn Rust network programming fundamentals
- Minimize external dependencies (except Crossterm/Ratatui for UI)
- Build incrementally with working software at each step
- Create something fun and nostalgic
- Add user-to-user messaging system
- Implement file library with upload/download
- Add online user tracking and directory
- Doors/Mods plugin support
- Add SSH support alongside Telnet
- System administration features
- Project setup
- Advanced telnet protocol support with RFC-compliant option negotiation
- Intelligent terminal capability detection and adaptive UI
- Multi-threaded connection management
- Configurable BBS system via
bbs.conf - Clean modular architecture
- Comprehensive testing framework (24 tests passing)
- Adaptive terminal width detection using NAWS (RFC 1073)
- Smart color support based on terminal capabilities
- Intelligent ANSI support detection and box style selection
- Configurable box-drawing system with automatic fallbacks
- Menu system with responsive layout
- Retro BBS-style interface with modern enhancements
- Main menu with user status display
- Bulletin board menu (FULLY IMPLEMENTED)
- User directory menu (placeholder)
- Private messages menu (placeholder)
- File library menu (placeholder)
- Feature-aware menus (hide disabled features)
- Secure password input with telnet echo negotiation (RFC 857)
- Terminal capability negotiation during session startup
- Advanced user session tracking with terminal state management
- User registration and persistent storage
- Secure authentication with masked password input
- Anonymous access control
- Connection timeout handling
- Graceful connection cleanup
- Auto-detection configuration options with manual overrides
- Responsive layout configuration with fallback options
- Full configuration via INI-style file with backward compatibility
- Server settings (ports, timeouts, connection limits)
- BBS branding and information
- Feature toggles
- Advanced UI customization (adaptive width, smart colors, ANSI detection)
- Secure user registration with masked password input
- User registration with validation
- User data persistence (file-based)
- User profiles and preferences
- Enhanced password authentication with telnet echo control
- Create and post new bulletins
- Read existing bulletins with content display
- Mark bulletins as read (per-user tracking)
- Bulletin statistics (total, unread count)
- Recent bulletins display with status indicators
- Sticky bulletin support
- Persistent storage (JSON-based)
- Anonymous and registered user support
- Full menu navigation and state management
- Responsive bulletin display with adaptive width
- Bulletin posting and reading with full menu navigation
- Private messaging system (basic implementation)
- File upload/download system
- Online user tracking
- User directory with search
- Full telnet protocol negotiation (RFC 854, 857, 1073, 1091)
- Terminal capability detection and adaptive rendering
- SSH support (alongside Telnet)
- System administration features
- Message threading and organization
- File categorization and search
- User permissions and groups
- Auto-detect terminal width using NAWS option (RFC 1073)
- Smart ANSI support detection from terminal type (RFC 1091)
- Intelligent color support based on terminal capabilities
- Graceful degradation for limited terminals
- Secure password input with telnet echo negotiation (RFC 857)
- Masked authentication during login and registration
- RFC-compliant telnet option handling
- Adaptive UI layouts that respond to terminal width
- Smart box drawing with ANSI fallbacks
- Dynamic color themes based on terminal capabilities
- Consistent experience across diverse terminal types
src/
├── main.rs # Server startup and connection handling
├── config.rs # Enhanced configuration with Phase 7 auto-detection
├── errors.rs # Custom error types
├── box_renderer.rs # Adaptive UI rendering system
├── session.rs # Session management with telnet capability detection
├── users.rs # User data types and validation
├── user_repository.rs # User storage and authentication
├── bulletins.rs # Bulletin data types and validation
├── bulletin_repository.rs # Bulletin storage and statistics
├── messages.rs # Private message data types
├── message_repository.rs # Message storage and management
├── services/ # Service layer for business logic
│ ├── mod.rs
│ ├── bulletin_service.rs
│ ├── message_service.rs
│ └── user_service.rs
└── menu/ # Responsive menu system
├── mod.rs # Menu traits and common types
├── menu_main.rs # Main menu implementation
├── menu_bulletin.rs # Bulletin board menu (FULLY IMPLEMENTED)
├── menu_user.rs # User directory menu
└── menu_message.rs # Private messaging menu
telnet-negotiation/ # RFC-compliant telnet library
├── src/
│ ├── lib.rs # Library entry point and exports
│ ├── protocol.rs # Telnet protocol constants (RFC 854)
│ ├── parser.rs # Command parsing and data separation
│ ├── negotiation.rs # Option negotiation state machine (RFC 1143)
│ ├── stream.rs # TelnetStream wrapper with high-level API
│ └── options/ # Specific option implementations
│ ├── mod.rs
│ ├── echo.rs # Echo option (RFC 857) for secure passwords
│ ├── terminal_type.rs # Terminal Type (RFC 1091) for capabilities
│ └── naws.rs # Window Size (RFC 1073) for responsive layout
└── examples/ # Protocol demonstration programs
- Single responsibility - Each module has a clear purpose
- Pure functions - Menu logic separated from I/O
- Configurable - Extensive customization without code changes
- Testable - Clean interfaces for unit testing
- Extensible - Easy to add new menus and features
Small improvements:
- Add event logging for observability
- Extract more traits for testability
- Better error handling with context
When adding notifications/real-time features
// Add this layer on top of current MVC
struct EventBus {
handlers: HashMap<TypeId, Vec<Box<dyn EventHandler>>>,
}
// Current code stays the same, just publishes events
session.handle_bulletin_submit(title, content)?;
event_bus.publish(BulletinPosted { id, author })?;When you want to add SSH, HTTP API, or WebSocket support, hexagonal architecture becomes valuable.
- Session layer knows about TCP streams
- Storage layer tied to JSON files
- Terminal rendering mixed with business logic
How It Would Look:
// Core domain - no external dependencies
mod domain {
pub struct BulletinService {
repo: Box<dyn BulletinRepository>,
}
impl BulletinService {
pub fn post_bulletin(&mut self, request: BulletinRequest) -> Result<BulletinId> {
// Pure business logic
}
}
}
// Adapters - handle external concerns
mod adapters {
struct TelnetAdapter;
struct SSHAdapter;
struct WebAdapter; // Future HTTP interface
struct JsonStorageAdapter;
struct DatabaseAdapter; // Future SQL storage
}crossterm- Terminal manipulation and input handlingjiff- Datetime handlingserde- Serialization- Standard library only for core networking and file I/O
git clone <repository>
cd <repository>
cargo runThen connect with:
telnet 127.0.0.1 2323On first run, a default bbs.conf file is created. Customize your BBS by editing:
[bbs]
name = "My Awesome BBS"
tagline = "The coolest retro BBS in cyberspace!"
sysop_name = "YourName"
[server]
telnet_port = 2323
max_connections = 50
[ui]
# User interface configuration
box_style = "ascii" # "ascii" (recommended for compatibility)
use_colors = false # Force colors on/off
# Phase 7: Clean width configuration
width_mode = "auto" # "auto" or "fixed"
width_value = 80 # Width in characters (fixed value or fallback for auto)
# Phase 7: Terminal capability detection
ansi_support = "auto" # "auto", "true", "false"
color_support = "auto" # "auto", "true", "false"
adaptive_layout = true # Enable responsive design
[features]
allow_anonymous = true
bulletins_enabled = true
file_uploads_enabled = trueClean Width Configuration:
width_mode = "auto"- Automatically detects client terminal width using NAWSwidth_mode = "fixed"- Uses fixed width specified inwidth_valuewidth_value = 80- Width in characters (fixed value or fallback when auto-detection fails)
Auto-Detection Options:
ansi_support = "auto"- Detects ANSI capabilities from terminal typecolor_support = "auto"- Enables colors based on terminal capabilitiesadaptive_layout = true- Enables responsive menu layouts
Manual Override Options:
- Use
"true"/"false"instead of"auto"to force specific behavior - All configuration is backward compatible with graceful fallbacks
- TCP socket programming with
std::net - Concurrent programming with threads (
ArcandMutex) - Terminal control and ANSI escape sequences
- File I/O and configuration parsing
- Error handling with custom types
- Modular architecture design
- Rust traits and polymorphism
- Data persistence and serialization
- Advanced telnet protocol negotiation (RFC 854, 857, 1073, 1091)
- State machines and protocol implementation
- Network protocol parsing and byte stream handling
- Adaptive system design with capability detection
- SSH implementation