Skip to content

AyaHusseinAly/containerized_chat_app_api

Repository files navigation

README

📎 Technologies

           

📎 Get this API running through:

after cloning this repo

  1. $ docker-compose build
  2. $ docker-compose up
  3. $ docker-compose run app rails db:migrate
  • Access API through:

    http://localhost:3001
    import app_chat_system_rails_5.postman_collection.json file from parent directory to postman desktop or check this link and click Run in Postman button

  • Access database through:

    localhost:3307
    Database: app
    User: user
    Password: password

📄 API documentation

https://documenter.getpostman.com/view/12933230/UyxdKUR9

📌 Create endpoints queuing system

in order to optimize time for serving chat and messages creation requests which is considered to be many and to be served concurrently.

1️⃣ a queuing system using Redis is used as temporary data store for generating the needed chat and message number for response without contacting the main database (MySQL)

2️⃣ Active Jobs is used to perform saving chats and messages from the temp data in redis later after serving the request and then update Applications and Chats coulmns chat_count and message_count is performed in the background

📎 Available End-points

Method URL Request Body
GET /applications/:application_token/chats/:chat_number/messages
POST /applications/:application_token/chats/:chat_number/messages {"msg_body": "value"}
GET /applications/:application_token/chats/:chat_number/messages/:id
PUT /applications/:application_token/chats/:chat_number/messages/:id {"msg_body": "value"}
GET /applications/:application_token/chats
POST /applications/:application_token/chats
GET /applications/:application_token/chats/:id
GET /applications
POST /applications {"name": "value"}
GET /applications/:token
PUT /applications/:token {"name": "value"}
GET /applications/:application_token/chats/:chat_number/search/messages?q=:query

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published