Simple Messenger Service

This app is intended to be a simple server of a CRUD app built with Ruby on Rails.

Version

  • Rails v6.1.7
  • Ruby v2.7.2
  • Database postgreSQL
  • Bundle v2.1.4

How to run locally

  • create .env, you can check .env.example
  • run bundle install
  • run rails db:create rails db:migrate
  • run rails s
  • for testing purposes, you can go to application_controller.rb and make @current_user = User.find(1)

DB Schema

Screenshot 2024-05-18 021440

Api Endpoint

Conversations

Method URL Explanation
POST /conversations Create conversation with desired title
GET /conversations Get all conversations that the authenticated user has
GET /conversations/:id Get conversation by id
PUT/PATCH /conversations/:id Update conversation by id
DELETE /conversations/:id Delete conversation by id

Messages

Method URL Explanation
POST /messages Create message to other user

Ruby GEM

  • gem "faker"
  • gem "dotenv-rails"
  • gem "fast_jsonapi"
  • gem "composite_primary_keys"

Tasks

The challenge is make sure when you run bundle exec rspec, all result is green (without error):)

Screenshot 2024-05-18 021440

Documentations

create_conv

Create conversation

get_all_conv

Get conversations

get_conv

Get conversation by id

update_conv

Update conversation by id

delete_conv

Delete conversation by id

create_message

Create message

Copyright

2024 © Muhammad Bangkit. All Rights Reserved.