Skip to content

bhola-dev58/JLiveChats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

JLiveChats - Spring Boot Real-time Chat Application

Modern, professional real-time chat application built with Spring Boot 3.3.0 and WebSocket, featuring user authentication, live messaging, multi-user support, and real-time collaboration features.

v2.0 Released! πŸŽ‰ Multi-user presence, typing indicators, message reactions, and more!
See FEATURES_V2.md for detailed new features.

✨ Features

User Authentication

  • Login System: Secure user login with credentials validation
  • Registration: Create new accounts with email verification
  • Session Management: Automatic login state tracking
  • User Profiles: Display current user information

Real-time Chat (Multi-User)

  • Real-time Messaging: Send and receive messages instantly
  • Channel Support: Multiple channels for organized conversations
  • User Presence: See who's online in real-time
  • Online User Count: Active participant tracking
  • Message History: View recent chat history (50 messages)

Collaboration Features (v2.0)

  • Typing Indicators: See when others are typing in real-time
  • Message Reactions: Add emoji reactions to messages
  • User List: See all active users in sidebar
  • Online Status: Visual indicators for online/offline users
  • Auto-sync: Changes sync across all connected clients

User Interface

  • Modern Design: Professional gradient-based UI with blue and purple accents
  • Responsive Layout: Adapts to different screen sizes
  • Real-time Updates: No page refresh needed
  • Dark Sidebar: Easy-to-read chat list and user management
  • Message Bubbles: Clear sender identification
  • Smooth Animations: Professional fade-in and transitions

πŸ›  Tech Stack

  • Backend Framework: Spring Boot 3.3.0
  • Real-time Communication: WebSocket
  • Frontend: HTML5, CSS3, JavaScript
  • Build Tool: Maven 3.8+
  • Language: Java 17
  • Database: H2 (in-memory)
  • Server: Embedded Tomcat

πŸ“‹ Prerequisites

  • Java 17 or higher installed
  • Maven 3.8+ installed
  • Git (for cloning the repository)

πŸš€ Getting Started

Option 1: Run from Command Line

  1. Navigate to project directory:

    cd JLiveChats
  2. Build the project:

    mvn clean package
  3. Set environment variables (optional for OAuth):

    export GOOGLE_CLIENT_ID="your-client-id"
    export GOOGLE_CLIENT_SECRET="your-client-secret"
  4. Run the application:

    mvn spring-boot:run
  5. Access the application:

    • Open browser: http://localhost:8080

Option 2: Run JAR File

mvn clean package
java -jar target/jlivechats-1.0.0.jar

Option 3: Run in IDE

  1. Open project in IntelliJ IDEA or Eclipse
  2. Right-click on JLiveChatsApplication.java (in src/main/java/com/jlivechats/)
  3. Select "Run JLiveChatsApplication.main()"

🌐 Deployment

For complete deployment instructions to Render, Railway, Docker, or other platforms, see DEPLOYMENT.md.

Quick Deploy to Render (Free):

  1. Go to render.com
  2. Create new Web Service from GitHub
  3. Select this repository
  4. Set environment variables (see DEPLOYMENT.md)
  5. Deploy!

⚠️ Google OAuth Troubleshooting

If you're getting Error 400: redirect_uri_mismatch when signing in, see GOOGLE_OAUTH_FIX.md for detailed instructions on updating Google Cloud Console.

πŸ“š Version History & Detailed Features

For comprehensive details about v2.0 features (typing indicators, user presence, reactions), see FEATURES_V2.md

This includes:

  • Architecture and implementation details
  • WebSocket endpoints reference
  • Technical specifications
  • Future enhancements roadmap

πŸ” Default Test Users

The application comes with pre-configured test accounts:

Username Password Notes
bhola password123 Admin user
john john123 Regular user
jane jane123 Regular user

Or create new accounts using the registration screen.

πŸ“± UI Components

Login Screen

  • Email/Username input field
  • Password input field
  • Secure authentication
  • Link to registration screen
  • Beautiful gradient background

Registration Screen

  • Username input
  • Email address input
  • Password input with strength indicator
  • Password confirmation
  • Link back to login screen

Chat Interface

  • Left Sidebar:

    • Current user profile
    • List of available channels
    • Online users with status indicators
    • Logout button
  • Main Chat Area:

    • Channel header with description
    • Message display area with sender information
    • Message timestamps
    • Input field for new messages
    • Send button with keyboard shortcut (Enter)

🎨 Color Scheme

Element Color Hex
Primary Accent Blue #667eea
Secondary Accent Purple #764ba2
Background Dark Blue-Gray #2c3e50
Text Primary White #ffffff
Text Secondary Light Gray #e0e0e0
Borders Light Gray #e0e0e0

πŸ”„ Message Flow

  1. User logs in with credentials
  2. Authentication Service validates credentials
  3. User redirected to main chat interface
  4. Select a channel to view conversation
  5. Type message and press Enter or click Send
  6. Message added to Message Service
  7. Message displayed in chat area with timestamp

πŸ“¦ Project Structure

src/
β”œβ”€β”€ main/
β”‚   β”œβ”€β”€ java/
β”‚   β”‚   └── com/jlivechats/
β”‚   β”‚       β”œβ”€β”€ JavaFXApplication.java       # Main entry point
β”‚   β”‚       β”œβ”€β”€ ui/
β”‚   β”‚       β”‚   β”œβ”€β”€ LoginView.java           # Login screen
β”‚   β”‚       β”‚   β”œβ”€β”€ RegisterView.java        # Registration screen
β”‚   β”‚       β”‚   β”œβ”€β”€ ChatView.java            # Main chat interface
β”‚   β”‚       β”‚   └── SceneManager.java        # Scene navigation
β”‚   β”‚       β”œβ”€β”€ service/
β”‚   β”‚       β”‚   β”œβ”€β”€ AuthenticationService.java  # User authentication
β”‚   β”‚       β”‚   └── MessageService.java        # Message management
β”‚   β”‚       └── config/
β”‚   β”‚           └── (Spring configuration files)
β”‚   └── resources/
β”‚       β”œβ”€β”€ styles/
β”‚       β”‚   └── application.css           # JavaFX styles
β”‚       └── static/
β”‚           └── (Web resources, optional)

🎯 Usage

Login

  1. Start the application
  2. Enter username and password
  3. Click "Sign In" or press Enter
  4. Invalid credentials will show error message

Register New Account

  1. Click "Sign Up" link on login screen
  2. Fill in all fields (username, email, password)
  3. Confirm password matches
  4. Click "Create Account"

Send Messages

  1. Select a channel from left sidebar
  2. Type message in input field at bottom
  3. Press Enter or click Send button
  4. Message appears in chat with timestamp

Logout

  1. Click "Logout" button in top-left sidebar
  2. Redirected back to login screen

πŸ”’ Security Features

  • Password Validation: Passwords must be minimum 6 characters
  • Username Validation: Usernames must be minimum 3 characters
  • Email Validation: Email format validation on registration
  • Session Management: Current user tracking with AuthenticationService
  • Data Privacy: In-memory storage (no external database exposure)

βš™οΈ Configuration

Font and Styling

Edit src/main/resources/styles/application.css to customize:

  • Font families
  • Colors and gradients
  • Button styles
  • Text field styling

Window Size

Modify in JavaFXApplication.java:

stage.setWidth(1200);
stage.setHeight(700);
stage.setMinWidth(800);
stage.setMinHeight(600);

Default Channels

Edit in ChatView.java:

ObservableList<String> channels = FXCollections.observableArrayList(
    "#general", "#random", "#announcements", "#help"
);

πŸ› Troubleshooting

Application won't start

  • Ensure Java 17+ is installed: java -version
  • Check Maven is installed: mvn -version
  • Try: mvn clean install

JavaFX not loading

  • Verify JavaFX dependency in pom.xml
  • Run: mvn dependency:resolve

UI appears blank

  • Check screen resolution is at least 800x600
  • Verify CSS file is in resources/styles/

πŸ“ˆ Future Enhancements

  • WebSocket integration for real-time messaging
  • Database persistence (SQLite/PostgreSQL)
  • User avatar uploads
  • Message search functionality
  • Chat notifications
  • File sharing capability
  • Emoji picker
  • Dark/Light theme toggle
  • User preferences settings
  • Group chat support

πŸ“„ License

This project is open-source and available for educational purposes.

πŸ‘¨β€πŸ’» Author

Created by: Bhola Yadav
USN: 1CR23CS044
Section: K
Branch: Computer Science Engineering


Enjoy your new JLiveChats application! πŸŽ‰

About

JLiveChats is a Java-based real-time chating application that uses sockets to stream and visualize live data dynamically. Built with AWT/Swing for the UI and Java Sockets for network communication.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors