If you want it right from the start, you can create an api only rails project: https://guides.rubyonrails.org/api_app.html
If you want it right from the start, you can create an api only rails project: https://guides.rubyonrails.org/api_app.html