/IRC

Primary LanguageC++

πŸ’»IRC

C++ 42

A lightweight Internet Relay Chat (IRC) server implementation in C++, developed as part of the 42 curriculum.

πŸ“‹ Overview

IRC is a server implementation that enables real-time communication between multiple clients. This project focuses on understanding network programming, socket communication, and implementing the IRC protocol specifications.

✨ Features

Server Capabilities

  • User authentication and registration
  • Channel creation and management
  • Private messaging between users
  • Channel operator privileges
  • Client connection handling

Command Support

  • /nick: Set or change nickname
  • /join: Join a channel
  • /privmsg: Send private messages
  • /quit: Disconnect from server
  • /part: Leave a channel
  • /topic: Set/view channel topic
  • /mode: Set channel/user modes
  • /kick: Remove user from channel
  • /invite: Invite user to channel

Network Features

  • TCP/IP socket communication
  • Multiple client connections
  • Real-time message broadcasting
  • Error handling and recovery
  • Protocol compliance

πŸš€ Getting Started

Prerequisites

  • C++ compiler (C++98 standard)
  • Make
  • POSIX-compliant operating system

Installation

# Clone the repository
git clone git@github.com:lciullo/IRC.git
cd IRC

# Compile the project
make

Usage

# Start the server
./ircserv <port> <password>

# Connect using a client (e.g., netcat)
nc localhost <port>

🎯 Project Objectives

  • Implement the IRC protocol according to specifications
  • Handle multiple client connections simultaneously
  • Manage channels and user permissions
  • Process IRC commands and responses
  • Ensure secure user authentication
  • Implement proper error handling
  • Handle network communication effectively

πŸ—οΈ Project Structure

ft_irc/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.cpp
β”‚   β”œβ”€β”€ Server.cpp
β”‚   β”œβ”€β”€ Client.cpp
β”‚   β”œβ”€β”€ Channel.cpp
β”‚   β”œβ”€β”€ Command.cpp
β”‚   └── Utils.cpp
β”œβ”€β”€ include/
β”‚   β”œβ”€β”€ Server.hpp
β”‚   β”œβ”€β”€ Client.hpp
β”‚   β”œβ”€β”€ Channel.hpp
β”‚   β”œβ”€β”€ Command.hpp
β”‚   └── Utils.hpp
β”œβ”€β”€ Makefile
└── README.md

🀝 Contributors

🧠 Learning Outcomes

This project provided valuable experience in:

  • Network programming and socket communication
  • Multi-client server architecture
  • Protocol implementation and compliance
  • Real-time data transmission
  • User authentication and security
  • Error handling in networked applications
  • Collaborative development practices

πŸ› οΈ Technical Implementation

  • Server class manages socket connections and client handling
  • Client class handles user state and authentication
  • Channel class implements room management and privileges
  • Command handler processes IRC protocol messages
  • Utils provide helper functions for common operations

πŸ“ License

This project is part of the 42 school curriculum.

🌟 Acknowledgments

  • IRC Protocol documentation
  • 42 School