- Understand how this phase is structured
- Learn the outcomes of this phase
Welcome to Phase 4! At this point in the program, you've tackled two programming languages, JavaScript and Ruby, as well as mastering a frontend framework, React. Throughout our journey, we've focused on a specific kind of application architecture: creating a single-page application that consumes JSON data from a Web API. Finally, you were introduced to the process of creating your own API using Sinatra, a lightweight web framework used to create simple web applications.
In this phase, we're going to learn how to create an API server using a much more powerful tool, Ruby on Rails (or, as the cool kids say, just Rails). By building an API to serve JSON data in Rails, you'll have full control over the backend logic: from how requests are handled and how the response is generated, to how your models interact with the database using Active Record. By the end of this phase, you can truly claim your mantle as a full-stack developer!
This phase is structured to start small, and gradually build in complexity. Each module of content (a section of labs and readmes) ends with a quiz or "putting it all together" lab where you can check your understanding of the material. Here's what each module covers:
Learn how to use Rails as a backend framework to create a server, and how following conventions helps keep our code organized and efficient. You'll also see the full request-response cycle and how data flows through a Rails application.
Use Rails to build a RESTful API that can perform common CRUD operations with a database, and how to access all the data being sent to our Rails app as well as how to properly format a response with a JSON body and HTTP status codes.
Validations help keep our database clean, and prevent unwanted data from sneaking in. Learn how to use Active Model to add simple validations to your model, and how to respond to invalid data from users.
As full stack developers, it's always important to consider the frontend and the backend as you're building applications. Get a better understanding of how client-server communication happens via the request-response cycle, and how to debug common errors.
Building more complex applications requires a larger domain made up of several related models. Learn how to use Active Record in Rails to create associations between models, and how to follow RESTful conventions with multiple related models.
When designing web APIs, one important consideration is how our data is sent back to our users. Learn how to use a serializer to shape how your JSON data is structured in the response.
Authentication and authorization are two important topics in designing web applications. Learn how to use cookies to help identify users across multiple requests, and authorize users for access to specific actions on the server once they've logged in.
So far, we've been building applications locally โ but the end goal is to be able to deploy our projects to the web, so that anyone can view them! In this section, we'll discuss what the deployment process looks like and how to deploy a React/Rails API application to a server.
By the end of this phase, you should be able to:
- Create RESTful APIs
- Validate data
- Share data between a frontend JavaScript application and a backend API application
- Build authentication into APIs
- Deploy backend applications
We've got an exciting time ahead, so let's get started!