In this Lightning Talk at RailsConf 2021, Steffani Brasil shares insights on building Rails APIs, highlighting her experiences and addressing common concerns faced by developers. The talk centers around a conversational narrative with her friend Chidi, a fictional character from the show 'The Good Place,' who struggles with decision-making regarding whether to use the Rails API only mode for his project.
Key Points Discussed:
Introduction to Rails API Only Mode:
Steffani explains the Rails API only mode, designed for applications that require a backend serving JSON responses without the overhead of views and assets. She emphasizes that this mode is suitable for applications that interact with single-page applications (SPAs) or mobile native apps.Client Considerations:
The discussion posits essential questions for developers to consider:- Will the client be a SPA, mobile app, or another Rails application?
- Will the client handle the user interface while the Rails API merely serves JSON? If the answer is yes to any of these questions, choosing the API only mode might be beneficial.
Structure of Rails API:
Steffani describes the structure of a Rails API, pointing out that it is a lighter version of a standard Rails application.- It lacks views and helpers aside from mailer templates.
- Controllers are simplified to only render JSON responses.
Addressing Decision Paralysis:
Chidi's indecisiveness leads to a common concern: what if one realizes mid-development that more features are needed than initially anticipated? Steffani reassures developers that Rails is customizable, allowing for adjustments even after initial decisions are made. She encourages learning from these experiences as valuable opportunities for growth.Conclusion and Resources:
Steffani concludes by encouraging those interested in building Rails APIs to consider the points discussed and avoid indecision like Chidi’s. To aid in this process, she has created a cheat sheet available at a specified URL, which compiles the basic considerations addressed during her talk.
Overall, this talk succinctly communicates the essence of building Rails APIs while addressing the common anxieties surrounding decision-making in software development. The emphasis on practical experience and customization possibilities enhances the confidence of developers contemplating similar projects.