Welcome to ChatOnlineApp! This README provides essential information to help you set up and use the application.
To run this application, you'll need the following software installed:
- Ruby 3.1.1
- Ruby on Rails 7.0.8 + Hotwire
- PostgreSQL
git clone git@github.com:Megonar/ChatOnlineApp.git
bundle install
To create and set up the database, follow these steps:
-
Create the database:
rails db:create
-
Apply database migrations:
rails db:migrate
-
Seed the database with initial data:
rails db:seed
rails server
To retrieve a list of all chats using the API, make a GET request to the following endpoint:
curl http://localhost:3000/api/v1/chats
To send a message to a chat using the API, make a POST request with the message text to the following endpoint, replacing CHAT_NAME
with the actual chat name:
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"text": "Your message text"
}' \
http://127.0.0.1:3000/api/v1/chats/CHAT_NAME/messages