This Realtime Chat App is a web application that allows users to create chatrooms and communicate with each other in real-time. It utilizes Ruby on Rails for the backend, Action Cable for WebSocket communication, and Bootstrap for frontend styling.
- Chatroom Creation: Users can create new chatrooms with unique names.
- Real-time Messaging: Users can send and receive messages within chatrooms in real-time.
- Username Entry: Users can enter their usernames before sending messages.
- Responsive Design: The application is responsive and works well on various devices.
To run this application locally, follow these steps:
-
Clone this repository to your local machine:
git clone https://github.com/awahids/realtime_chat_app.git
-
Navigate to the project directory:
cd realtime_chat_app
-
Install dependencies using Bundler:
bundle install
-
Set up the database configuration:
-
Open
config/database.yml
file and update the database configuration to use PostgreSQL:default: &default adapter: postgresql encoding: unicode username: your_postgresql_username password: your_postgresql_password host: localhost port: 5432 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> development: <<: *default database: realtime_chat_app_development test: <<: *default database: realtime_chat_app_test
-
Replace
your_postgresql_username
andyour_postgresql_password
with your PostgreSQL username and password.
-
-
Create the PostgreSQL databases:
rails db:create db:migrate db:seed
-
Start the Rails server:
rails server
-
Access the application in your web browser at
http://localhost:3000
.
- After starting the Rails server, navigate to
http://localhost:3000
in your web browser. - Create a new chatroom by entering a unique name in the provided form and clicking "Create".
- Click on a chatroom name from the sidebar to join the chatroom.
- Enter your username and message content in the input fields provided and click "Send" to send messages.
- Messages will be displayed in real-time to all users in the chatroom.
- Ruby on Rails 7: Backend framework for building web applications.
- Action Cable: WebSocket framework for real-time communication.
- Bootstrap: Frontend framework for responsive styling.
- PostgreSQL 14: Relational database management system used for storing data.
Contributions to this project are welcome! Feel free to open issues or pull requests for bug fixes, feature enhancements, or other improvements.
This project is licensed under the MIT License. Feel free to use, modify, and distribute it as per the terms of the license.
This Realtime Chat App was created by AW. You can contact me at [awahid.safhadi@gmail.com] for any inquiries or feedback.