Skip to content

A Java desktop messaging app inspired by Telegram – using JavaFX, PostgreSQL, and Java Sockets.

Notifications You must be signed in to change notification settings

PartowRoshani/Telegram-Final-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

242 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

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.


Objectives

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

Pre Requirements

  • Java (JDK 23 or higher)
  • PostgreSQL (for database)
  • JavaFX SDK (for GUI)
  • IntelliJ IDEA
  • Gradle as the build system

Database design

photo_2025-09-07_20-10-33


Implementation

The project has 3 main parts:

  1. 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.
  2. 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.
  3. Sockets

    • All client-server communication is handled via sockets.
    • Each request/response follows a structured JSON protocol.
    • Supports multiple users communicating simultaneously.

Creating GUI

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

Database Structures

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)


Presentation

Screenshot 2025-09-08 005216 Screenshot 2025-09-08 004526 Screenshot 2025-09-08 004157 Screenshot 2025-09-08 005228

How to Run the Code

  1. Clone the repository.
  2. Set up the PostgreSQL database using the provided init.sql.
  3. In IntelliJ IDEA (with Gradle):
    • Run MainServer first. You should see 🔁 All users set to offline in the console.
    • Run TelegramApplication. The intro screen (with “Start Messaging”) will appear.
  4. Login/Register to start chatting.

Contributors


Date/Time

Summer of 2025 (Version 1.0)


Resources

About

A Java desktop messaging app inspired by Telegram – using JavaFX, PostgreSQL, and Java Sockets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •