Welcome to the Chat System RoR project! This is a chat application built using Ruby on Rails, with support for Elasticsearch, Sidekiq, and Redis.
- Ruby: 3
- Rails: 7.2
- MySQL: 8
- Elasticsearch: 8.15.1
- Sidekiq: For background processing
- Redis: For caching and Sidekiq
Follow these instructions to get a copy of the project up and running on your local machine.
-
Install Docker
Docker is required to run the application in containers. To install Docker, follow these steps:
- Windows and macOS: Download and install Docker Desktop from Docker's official website.
- Linux: Install Docker Engine following the instructions at Docker's official installation guide.
Make sure Docker is running by opening a terminal or command prompt and running:
docker --version
-
Clone the Repository
Clone the repository to your local machine:
git clone https://github.com/yourusername/chat_system_ror.git cd chat_system_ror
-
Build the Docker Images
Build the Docker images for the application:
docker-compose build
-
Start the Docker Containers
Start the containers in detached mode:
docker-compose up -d
-
Set Up Elasticsearch for Messages
For the first time setup, you need to create the Elasticsearch index for messages. Run:
docker-compose run web rails runner 'Message.__elasticsearch__.create_index!'
This command sets up Elasticsearch indexing for the
Message
model.
Once the setup is complete, the application will be running at http://localhost:3000. You can access the Sidekiq web interface at http://localhost:3000/sidekiq for monitoring background jobs.
Here's a Postman collection included for testing the API endpoints. Import the collection into Postman to get started with API testing.
To stop and remove the running containers, use:
docker-compose down