This is the final project of our Advanced Programming course at Shahid Beheshti University.
It’s a clone of the famous messaging application Telegram, developed in Java and designed with JavaFX.
The project implements both client-side and server-side logic, featuring real-time messaging, saved messages, contacts, groups, and channels.
Here is a list of concepts that were practiced and implemented throughout the project:
- Object-Oriented Programming (OOP) concepts
- Database design and integration
- Multithreading and concurrency control
- Socket programming for client-server communication
- Designing graphical user interfaces with JavaFX
- Data handling and persistence with PostgreSQL
- Real-time events and message synchronization
- Java (JDK 23 or higher)
- PostgreSQL (for database)
- JavaFX SDK (for GUI)
- IntelliJ IDEA
- Gradle as the build system
The project has 3 main parts:
-
Telegram Client
- JavaFX-based UI replicating Telegram’s layout (intro, login, chats, sidebar, overlays).
- Handles sending/receiving requests through sockets.
- Displays messages, saved chats, groups, and user profiles.
-
Telegram Server
- Multithreaded server managing client connections concurrently.
- Processes requests, accesses the database, and returns structured JSON responses.
- Includes a server log showing all events and queries in real-time.
-
Sockets
- All client-server communication is handled via sockets.
- Each request/response follows a structured JSON protocol.
- Supports multiple users communicating simultaneously.
The GUI was developed entirely with JavaFX, SceneBuilder, and custom CSS.
Features include:
- Light/Dark theme switching
- Responsive sidebar navigation
- Overlays (e.g., Saved Messages, My Profile, Blocked Users)
- Round avatars and icons styled to match Telegram’s UI
Implemented with PostgreSQL. Main tables include:
- users – stores account information
- messages – stores chat messages with sender, receiver, timestamp, and status
- private_chat – for one-on-one conversations (including Saved Messages)
- group_chat / channel – for group and channel features
- message_receipts – to track read/delivery status
(SQL schema files are provided in the project repo)
- Clone the repository.
- Set up the PostgreSQL database using the provided
init.sql. - In IntelliJ IDEA (with Gradle):
- Run
MainServerfirst. You should see🔁 All users set to offlinein the console. - Run
TelegramApplication. The intro screen (with “Start Messaging”) will appear.
- Run
- Login/Register to start chatting.
- Course Instructor: Dr. Saeed Reza Kheradpisheh
- Project Mentor: Farid Karimi
- Team Members:
Summer of 2025 (Version 1.0)
