Use the below command to create "API Only" project.
rails new my_api_project --api
Install JWT Gem
gem 'jwt'
Put the application controller in app/controllers/
In your /app/controllers/api/v1/users_controller.rb
# Project API users controller module
module Api
module V1
# Project API users controller class
class UsersController < ApplicationController
before_action :authorized, only: %i[update logout]
# Login function
def login
# your code goes here
end
end
end
end