How deydoux/42cursus-ft_irc works
Main Components
• IRC Server Core: This is the central component that listens for incoming TCP connections, manages sockets, and orchestrates command processing.
• Client Management: Classes (such as Client) handle the state, connection, and interactions of each IRC user.
• Channel Management: The Channel component manages channel creation, membership, and modes (like +i, +t, +k, +o, +l).
• Network and Connection Handling: Using TCP/IP sockets and poll(), this component integrates with the core to manage multiple simultaneous client connections.
• Logging and Utility Libraries: These modules (found in src/lib and bot/src/lib) are used for error logging, string manipulation, and various helper functions.
• Bot Functionality (Optional/Bonus): Located in the “bot” directory, this module serves as an IRC bot and may interact with the server to automate certain tasks.
Relationships and Interactions
• The IRC Server Core receives network connections and dispatches incoming messages to the Command Processor.
• The Command Processor interprets commands and forwards them to the appropriate Client, Channel, and Server classes.
• Client Management keeps track of connected users, while Channel Management holds channel states, including modes and operators.
• Utilities (logging, text formatting, etc.) support all these interactions, ensuring correct output, error handling, and debugging.
• The Bot module acts as an external client that connects to the server, issuing commands and interfacing with the server like any other client.
Architectural Patterns and Design Principles
• Modular Design: Each component – especially commands – is split into separate classes and files for maintainability.
• Separation of Concerns: Networking, command parsing, client management, and logging are clearly separated.
• Client-Server Model: The system strictly follows client-server principles where the server handles multiple client sessions concurrently.
• Extensibility: The use of distinct modules for commands and additional bot features provides clear extension points for future improvements.
Technologies and Frameworks
• C++98 Standard: The project is implemented in C++ using older standards, so modern facilities (or libraries) are not used.
• POSIX Sockets and poll() for network communication.
• Custom logging and utility libraries under src/lib and bot/src/lib.
• Makefiles and GitHub Actions (in .github/workflows) for building and CI, indicating integration with a continuous integration process.