Skip to content

About

πŸ“‘πŸŽŸοΈ Client-server event management system in C, built around socket-based communication and reservation handling.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Event Reservation Platform

Distributed event reservation system implemented in C, using the Sockets interface for network communication through the UDP and TCP protocols.


Project Description

This project implements a complete event reservation platform, composed of:

  • Event-reservation Server (ES): Centralized server that manages users, events, and reservations
  • User Application (User): Interactive client for communication with the server

The system supports:

  • User registration and authentication
  • Event creation and management
  • Reservation system with availability control
  • Transfer of event description files
  • Listing of events and reservations

Project Structure

.
β”œβ”€β”€ README.md              # This file
β”œβ”€β”€ Makefile               # Global Makefile (builds client and server)
β”œβ”€β”€ client/                # User application (client)
β”‚   β”œβ”€β”€ user              # Client executable
β”‚   β”œβ”€β”€ Makefile          # Client Makefile
β”‚   β”œβ”€β”€ README.md         # Detailed client documentation
β”‚   β”œβ”€β”€ downloads/        # Files received from the server
β”‚   └── src/              # Client source code
β”‚       β”œβ”€β”€ client.c
β”‚       β”œβ”€β”€ commands.c
β”‚       β”œβ”€β”€ commands.h
β”‚       β”œβ”€β”€ protocol.c
β”‚       β”œβ”€β”€ protocol.h
β”‚       └── constants.h
β”œβ”€β”€ server/               # Event-reservation Server
β”‚   β”œβ”€β”€ ES                # Server executable
β”‚   β”œβ”€β”€ Makefile          # Server Makefile
β”‚   β”œβ”€β”€ README.md         # Detailed server documentation
β”‚   β”œβ”€β”€ USERS/            # User database
β”‚   β”œβ”€β”€ EVENTS/           # Event database
β”‚   └── src/              # Server source code
β”‚       β”œβ”€β”€ server.c
β”‚       β”œβ”€β”€ commands.c
β”‚       β”œβ”€β”€ commands.h
β”‚       β”œβ”€β”€ protocol.c
β”‚       β”œβ”€β”€ protocol.h
β”‚       β”œβ”€β”€ database.c
β”‚       β”œβ”€β”€ database.h
β”‚       └── constants.h
└── SCRIPTS_25-26/        # Test scripts

Compilation

Build everything (client and server):

make

Build only the client:

make client

Build only the server:

make server

Clean build files:

make clean

Rebuild everything:

make rebuild

Running the Project

1. Start the Server

cd server
./ES [-p ESport] [-v]

Optional arguments:

  • -p ESport: Port where the server accepts requests (default: 58053)
  • -v: Verbose mode (prints debug information)

Example:

./ES -p 58053 -v

Or using the global Makefile:

make run-server

2. Start the Client

In another terminal:

cd client
./user [-n ESIP] [-p ESport]

Optional arguments:

  • -n ESIP: Server IP address (default: 127.0.0.1)
  • -p ESport: Server port (default: 58053)

Example:

./user -n 127.0.0.1 -p 58053

Or using the global Makefile:

make run-client

Main Features

User Management

  • Login: Authentication or automatic registration of new users
  • Logout: End session
  • Change Password: Update password
  • Unregister: Remove account

Event Management

  • Create: Create an event with name, date, seats, and description file
  • Close: Close an event (stop accepting reservations)
  • List: List all available events
  • Show: View event details and download the description file
  • My Events: List events created by the user

Reservation System

  • Reserve: Reserve seats for an event
  • My Reservations: List the user's reservations

Communication Protocols

UDP (Fast Operations)

Used for stateless and lightweight operations:

  • Login/Logout
  • Unregister
  • Listing the user's own events
  • Listing the user's own reservations

TCP (File Transfer)

Used for more complex operations and data transfer:

  • Event creation (file upload)
  • Event closing
  • General event listing
  • Event viewing (file download)
  • Reservations
  • Password change

Formats and Constraints

Identifiers

  • UID: 6 digits (e.g. 123456)
  • Password: 8 alphanumeric characters (e.g. Pass1234)
  • EID: 3 digits (001-999)

Events

  • Name: Max. 10 alphanumeric characters
  • Date/Time: dd-mm-yyyy hh:mm (e.g. 25-12-2025 20:00)
  • Seats: 10-999 (creation) or 1-999 (reservation)

Files

  • Name: Max. 24 characters (including .xxx extension)
  • Size: Max. 10 MB (10,000,000 bytes)
  • Allowed characters: Alphanumeric characters, -, _, .

Global Makefile Commands

Command Description
make or make all Builds client and server
make client Builds only the client
make server Builds only the server
make clean Removes all build files
make clean-client Removes only client build files
make clean-server Removes only server build files
make rebuild Cleans and rebuilds everything
make run-server Builds and runs the server in verbose mode
make run-client Builds and runs the client
make test Checks whether the executables were created
make help Shows help for the available commands

System Requirements

  • Operating System: Linux (tested on Ubuntu/Debian)
  • Compiler: gcc with C99/C11 support
  • Libraries: Standard C library, POSIX sockets
  • Make: GNU Make

Additional Documentation

For detailed information about each component, see:


Data Structure

User Database (USERS/)

USERS/
└── [UID]/              # Directory for each user (6 digits)
    β”œβ”€β”€ pass.txt        # User password
    β”œβ”€β”€ login.txt       # Active session indicator
    β”œβ”€β”€ CREATED/        # Links to created events
    └── RESERVED/       # Reservation files

Event Database (EVENTS/)

EVENTS/
└── [EID]/              # Directory for each event (001-999)
    β”œβ”€β”€ START           # Metadata (owner, name, date, seats)
    β”œβ”€β”€ RES             # Reserved seats counter
    β”œβ”€β”€ CLOSE           # Closing timestamp (if applicable)
    β”œβ”€β”€ DESCRIPTION/    # Event description file
    └── RESERVATIONS/   # Reservations by user
        └── [UID]       # Date/time and number of seats

Technical Characteristics

Server (ES)

  • Connection multiplexing with select()
  • Simultaneous UDP and TCP support on the same port
  • Multiple simultaneous TCP connections
  • Persistent filesystem-based database
  • Verbose mode for debugging
  • Graceful signal handling (SIGINT, SIGPIPE)

Client (User)

  • Interactive command-line interface
  • Local input validation
  • Session state management
  • File upload/download
  • Commands with aliases (myevents/mye, etc.)
  • Clear and informative error messages

About

πŸ“‘πŸŽŸοΈ Client-server event management system in C, built around socket-based communication and reservation handling.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages