Distributed event reservation system implemented in C, using the Sockets interface for network communication through the UDP and TCP protocols.
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
.
βββ 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
makemake clientmake servermake cleanmake rebuildcd 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 -vOr using the global Makefile:
make run-serverIn 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 58053Or using the global Makefile:
make run-client- Login: Authentication or automatic registration of new users
- Logout: End session
- Change Password: Update password
- Unregister: Remove account
- 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
- Reserve: Reserve seats for an event
- My Reservations: List the user's reservations
Used for stateless and lightweight operations:
- Login/Logout
- Unregister
- Listing the user's own events
- Listing the user's own reservations
Used for more complex operations and data transfer:
- Event creation (file upload)
- Event closing
- General event listing
- Event viewing (file download)
- Reservations
- Password change
- UID: 6 digits (e.g.
123456) - Password: 8 alphanumeric characters (e.g.
Pass1234) - EID: 3 digits (001-999)
- 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)
- Name: Max. 24 characters (including
.xxxextension) - Size: Max. 10 MB (10,000,000 bytes)
- Allowed characters: Alphanumeric characters,
-,_,.
| 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 |
- Operating System: Linux (tested on Ubuntu/Debian)
- Compiler: gcc with C99/C11 support
- Libraries: Standard C library, POSIX sockets
- Make: GNU Make
For detailed information about each component, see:
- client/README.md: Full client documentation
- server/README.md: Full server documentation
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
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
- 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)
- Interactive command-line interface
- Local input validation
- Session state management
- File upload/download
- Commands with aliases (
myevents/mye, etc.) - Clear and informative error messages