Giter Club home page Giter Club logo

chat-easy's Introduction

Chat Easy

It's an experimental chat application api using ruby on rails. Used many other tools and technologies to make it more efficient and easy to use like: redis, sidekiq, docker, docker-compose, elasticsearch, etc.

Features

  • Users can create new application (new client account)
  • User can update application client name
  • User can list all applications
  • Users can create new chat room
  • Users can send messages to chat room
  • Users can see messages in chat room
  • Users can search messages in chat room

Installation

Prerequisites

  • Ruby 3.3.0
  • Rails 7.0.0
  • Redis
  • Sidekiq
  • MySQL
  • Docker
  • Docker Compose

Setup

  1. Clone the repository
git clone REPO_URL
  1. Install dependencies
bundle install
  1. Create database

Note: Make sure you have MySQL installed and running on your machine. and update the database.yml file with your database credentials.

rails db:create
rails db:migrate
  1. Start the server

Note: Make sure you have elasticsearch installed and running on your machine so that you can search messages.

rails s
  1. Start sidekiq

Note: Make sure you have Redis installed and running on your machine.

bundle exec sidekiq

Docker

You can also run the application using docker and docker-compose.

docker compose up --build

API Documentation

Create Application

[POST] /applications

{
  "name": "Application Name"
}

Update Application

[PUT] /applications/:token

{
  "name": "Application Name"
}

List Applications

[GET] /applications

Create Chat Room

[POST] /chats

{
  "token": "bdce0a6ebd1506248f77d77aa20c4581"
}

List Chat Rooms

[GET] /chats

Send Message

[POST] /chats/:chat_id/messages

{
  "token": "bdce0a6ebd1506248f77d77aa20c4581",
  "message": "Hello World",
  "chat_number": 1
}

List Messages

[GET] /applications/:token/:chat_number/messages

Search Messages

[GET] /applications/:token/:chat_number/messages/search?q=:query

License

This project is open-sourced software licensed under the MIT license.

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.