The best thing you can do is to follow the github tutorials which are most likely to be up-to-date.
First you should follow the TLDR part.
Note that the frontend developpers need to know about the usage specification.
Finally you want to go through the documentation. Here are some samples that might help:
Routes
Rails.application.routes.draw do
# Stuff
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
devise_for :users
root to: "home#index"
# The API part
namespace :api, defaults: {format: :json} do
scope :v1 do
mount_devise_token_auth_for 'User', at: 'auth', skip: [:omniauth_callbacks]
resources :stuff, only: [:index, :show]
end
end
end
A controller:
module Api
class StuffsController < ApiController
before_action :authenticate_user!
...
end
end
API Controller
class ApiController < ApplicationController
include DeviseTokenAuth::Concerns::SetUserByToken
end
User model
class User < ActiveRecord::Base
# Include default devise modules.
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
include DeviseTokenAuth::Concerns::User
end
Finally don't forget to configure the gem in the corresponding initializer.