Skip to content

A distributed Java chatroom with server–client communication and an integrated AI chatbot powered by Ollama, developed for the Parallel and Distributed Computing course at FEUP.

License

Notifications You must be signed in to change notification settings

AFNeves/JavaChatroom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Java Chatroom Application with AI Bot

This README contains the instructions to run the code for the second assignment of the course Parallel and Distributed Computing of the Bachelor in Informatics and Computing Engineering at the Faculty of Engineering of the University of Porto. The assignment involves creating a chatroom application using Java, where multiple clients can connect to a server and communicate with each other. The server uses an AI bot (Ollama) to respond to user messages.

Prerequisites

Before running the application, ensure you have the necessary software installed on your machine. Here is a list of the required software:

Starting the AI Bot (Ollama)

To use the AI chatbot in your application, you need to run the Ollama container. Follow these steps to set it up:

sudo docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama14 ollama/ollama

sudo docker exec -it ollama14 ollama run llama3

Note: If you already have a container named ollama14, you may need to remove it first:

sudo docker rm -f ollama14

Running the Java Application

To run the Java application, follow these steps:

Step 1: Open the project in IntelliJ IDEA

  • Open IntelliJ IDEA and load the project folder.

  • Make sure your project SDK is set to Java 21.

Step 2: Navigate to the src folder in terminal

Open a terminal and change directory to the src folder inside the project:

cd src

Step 3: Compile and run the Server

In one terminal, compile the Server.java file and then run the server application:

javac Server.java
java Server

Step 4: Compile and run one or more Clients

Open one or more additional terminals, navigate to the src folder, then compile and run Client.java:

javac Client.java
java Client

Step 5: Closing the application

  • To exit either the Server or Client programs, press CTRL+C in the terminal where they are running.

This assignment was developed by:

About

A distributed Java chatroom with server–client communication and an integrated AI chatbot powered by Ollama, developed for the Parallel and Distributed Computing course at FEUP.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages