Giter Club home page Giter Club logo

chat-server's Introduction

Web Chat Server (Instructions)

This was a university project, copying code not allowed

Authors

How to run

The guide on how to run this project will be assuming the user is using Intellij IDEA and GlassFish 7.0.0.

  • firstly clone the repo to your local computer
  • open the repo in Intellij
  • in the top right click the configuration drop down and 'Edit Configurations'
  • click 'Add Configuration' and select GlassFish local
  • type domain1 into the domain entry box
  • select the 'Deployment' tab and select <repository name>:war exploded
  • the glassfish server has now been set up, and you can click the green arrow in the top right
  • this should automatically open a tab in your browser but if it does not then navigate to http://localhost:8080/WSChatServer-1.0-SNAPSHOT/

How to use

Now that the server is running you should see a screen that looks like this dashboard.png To create and join a chatroom, simply click the create and join new room button. This will prompt you for a username and notify to everybody else in the room that you have joined. You can enter text into the text field by either typing text and pressing send or typing text and pressing 'enter' on your keyboard. Now you can begin messaging. If another user wishes to use the same room, open another tab and paste http://localhost:8080/WSChatServer-1.0-SNAPSHOT/. If the room the first user is in does not show up in the list of chat rooms, simply press the refresh button under the join room button and then click the button that appears to join the room. This will repeat the username setting process and now both users should be able to talk to each other. This process can be repeated by creating more chat rooms and swapping between rooms at the user's will. A notification will be sent to everybody else in a room whenever a user leaves and a set username prompt will always be shown when entering a room.

Here is an example of what it would look like to use our application usingRoom1.png

There is also an About Us page you can see if you click About in the top left aboutUs.png Clicking on our names takes you to our respective GitHub pages and clicking 'Chat Server' in the top left takes you back to the main chatting page.

Project Improvements

The most notable improvement we made was our user interface. We have implemented a beautiful interface that is easy on the eyes, and you can even toggle between dark and light mode. Here is an example of the light mode interface. usingRoom2.png Another improvement we made involves the creation of RoomServlet.java. This class handles a GET request from the client and sends a list of current active rooms in the form of a JSON. This aids the refresh() function in the main.js file which updates the list of rooms for all the clients. We also added room switching functionality so users can switch between rooms and communicate with users already in those rooms.

External Resources

The main dependencies we used for this project were jakarta for websockets and org.json for parsing JSON files on the server side. All the dependencies are listed in the pom.xml file which is in the root directory of the repository, and they have their relevant website links commented above them.

chat-server's People

Contributors

sheida-ebrahimi avatar

Stargazers

Bilal avatar

Watchers

 avatar

Forkers

sid-26

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.