Skip to content

ChatRoom is a real-time communication application that enables users to interact in chat rooms. Built with React, Node.js, PostgreSQL, Socket.io and Express.js.

License

Notifications You must be signed in to change notification settings

sambbaahh/chatroom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

About The Project

ChatRoom is my personal project, focusing on real-time communication. The application allows users to create and join rooms to engage in conversations with others in real-time. In ChatRoom, you can manage various aspects of communication and provide users with a space to share their thoughts and discuss different topics.

In this personal project of mine, it's important to acknowledge that there may be bugs and areas where improvements are needed. In the world of programming, as in any creative endeavour, the pursuit of flawless perfection can be a highly demanding endeavour.

Project Goals

  • Implement JWT-authentication
  • Understand how Socket.io works
  • Learn more React, CSS, Node.js, Express.js and SQL

Built With

  • React
  • Node.js
  • PostgreSQL
  • Socket.io
  • Express.js

Getting Started

Prerequisites

Before you can get started, you should have Node.js and PostgreSQL installed.

  1. Clone the repository
    git clone https://github.com/sambbaahh/chatroom.git
  2. Navigate to the project's root directory
    cd chatroom

Server Installation:

  1. Navigate to the project's server directory

    cd server
  2. Install project dependencies

    npm install
  3. Create .env file

    PGUSER="YOUR_POSTGRESQL_USER"
    PGPASSWORD="YOUR_POSTGRESQL_PASSWORD"
    PGHOST="YOUR_POSTGRESQL_HOST_NAME"
    PGPORT=YOUR_POSTGRESQL_PORT
    PGDATABASE="YOUR_POSTGRESQL_DATABASE"
    ADMINPASSWORD="PASSWORD_FOR_ADMIN_USER"
  4. Generate public and private keypair for authentication

    node generateKeyPair.js
  5. Start in development mode (nodemon)

    npm run dev

    OR

    Start in production mode

    npm start

    At startup, the server will automatically create the database if it does not exist.

Client Installation:

  1. Open a new terminal window/tab

  2. Navigate to the project's client directory

    cd client
  3. Install project dependencies

    npm install
  4. Start the development server

    npm run dev

After following the installation steps, open your web browser and go to http://localhost:5173 to view the React project. Additionally, there is possibility to create a build of the React code and deploy it alongside the backend on the server.

With these steps, you have set up the server and client parts of the ChatRoom application. The server should be running on one terminal window/tab, and the client should be running on another.

Example with two user (Local environment)

Youtube video

Example with two user (Cloud environment)

Youtube video

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Sami Kukkonen - LinkedIn - samikukkonen00@hotmail.com

Project Link: https://github.com/sambbaahh/chatroom

Acknowledgments

Mantine - Amazing UI Component Library for React

JWT + Passport.js + Node.js Tutorial

About

ChatRoom is a real-time communication application that enables users to interact in chat rooms. Built with React, Node.js, PostgreSQL, Socket.io and Express.js.

Resources

License

Stars

Watchers

Forks

Packages

No packages published