Skip to content

A GUI JavaFX server-client chat application integrated with a MySQL database

Notifications You must be signed in to change notification settings

papcaii/Project1

Repository files navigation

Project 1

Table of Contents

  1. Description
  2. Requirements
  3. Technology
  4. Setup Instructions
  5. Screenshots
  6. Contributors
  7. Progress
  8. Troubleshooting

Description

A JavaFX server-client chat application integrated with a MySQL database.

Requirements

Please refer to the Requirement document.

Technology

  • Language: Java
  • GUI: JavaFX
  • Database: Docker + MySQL
  • Build Tool: Maven
  • Public Localhost Port: Ngrok

Setup Instructions

Set up Database

[!] You have to do this if you want to run client on your own

Docker

  • Ensure Docker and Docker Compose are installed on your machine.
  • Run the following command in the directory containing the docker-compose.yml file:
docker-compose up -d
  • This will:

    • Create a MySQL server accessible at localhost:3307
    • Host Adminer (a database manager) at localhost:8081
  • Finally, browse to localhost:8081 (adminer)

    • Login with username and password init in the docker-compose.yml
    • Choose database chat-app then run the sql init command in the file sql-init.txt

Configuration Credentials

  1. Copy the sample configuration file:

    cp ./server/src/main/resources/config.sample.properties ./server/src/main/resources/config.properties
  2. Update the config.properties file with your database details:

    DATABASE_URL=jdbc:mysql://localhost:3307/chat-app
    DATABASE_USER_NAME=your-username
    DATABASE_PASSWORD=your-password
  • Replace your-username and your-password with the value you initialize in your docker-comse.yml

Make your chat app public to network

  • Install Ngrok from here.
  • Run the following command to expose the server port:
ngrok tcp 9001

Running the Application

On Linux/macOS (Terminal)

  1. Server
./server/run.sh
  1. Client
./client/run.sh

On Windows

Prerequisites Make sure you have the parent folder of sh.exe (including in GitBash) in your PATH

  1. Server
sh .\server\run.sh
  1. Client
sh .\client\run.sh

Screenshot

Contributor

Student ID Student Name
20225545 Nguyễn Quang Hưng
20225544 Hạ Nhật Duy

Progress

For now our progress will store in this Docs and Overleaf

Well, it will be deleted when this project is done

Troubleshooting

About

A GUI JavaFX server-client chat application integrated with a MySQL database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published