Altcademy S Back-End Web Development Syllabus
Altcademy S Back-End Web Development Syllabus
Development Syllabus
Ruby Programming
Programming language for Ruby on Rails
Based on these, we chose Ruby on Rails because Ruby code is very readable and easy to
learn. Rails is based on conventions rather than configurations which means a lot of design
decisions are already made for you; it has a strong model view controller structure, which is
arguably the most important concept in back-end server applications; it’s easy to setup and to
get going; and has been around since 2005 and will likely stay around for years to come.
But why not JavaScript and Node.js? Yes, using JavaScript for back-end too means you only
have to learn one programming language. However, JavaScript back-end frameworks are
mostly configuration based which means they tend to require a lot of setup and decision
making. The other downside is JavaScript frameworks tend to go out of fashion every two to
three years. And you end up having to learn a brand new one when it is the hot new thing, and
repeat this process every now and then.
That’s not to say you shouldn’t learn a Node.js framework in the future. But learning all the
crucial concepts through Ruby on Rails will make future transitions much more manageable.
To learn Ruby on Rails, you first need to learn basic programming in Ruby. You won’t have to
dive too deep into Ruby programming as generic back-end web server applications rarely
requires advanced programming concepts.
● Values and Types - Back-end web development is all about dealing with data. So you
need to know the types of data you use in Ruby. A quick overview of Numbers, Strings
and Booleans is minimum. Also review the different operators for Numbers, such as +, -,
*, /, %, **. And how to concat strings in Ruby.
● Comparison and Logical Operators - Study how to compare values in Ruby using
comparison operators ==, >=, <=, !=. Learn to combine comparison operators using
logical operators and, or, not.
● Built-in Methods - Ruby comes with plenty of built-in methods for its data types.
Noteworthy ones include odd? and even? For Numbers; reverse and to_i for Strings. Get
comfortable manipulating different data types using methods and method chaining.
But different languages will have different strictness. A stricter programming language requires
the programmer to define more details in a program. Such as the datatype of the parameters a
function accepts, or how to handle errors when it happens.
More old school languages such as C++ and Java are stricter and harder to learn. While Ruby
and JavaScript are less strict and easier to pick up. You will learn the syntax of Ruby and how to
create basic programs.
● Variables - Variables are memory boxes used to remember values so they can be used
later. Learn to create variables in Ruby; assign and re-assign values to them; learn the
list of reserved words that cannot be used as variables names.
● Functions / Methods - Function is a box of program that takes inputs and returns an
output. In Ruby, functions are also called methods. Learn to define custom methods that
accept parameters and return outputs; and learn how to execute custom methods.
● Control Flow - Ruby executes programs in a top down flow. We can alter this flow by
adding control flow statements to our programs. These include conditional statements
that will only execute programs when certain condition is true; for loops and while loops
that let you repeat certain programs over and over again. Learn to incorporate control
flow into methods too.
● Ruby Best Practices - You will adopt a good best practice guide for code indentation
and variable naming convention. Keeping your code consistent and clean will make it
easy to read and extremely beneficial when it comes to bug finding.
● Array - Array are used to store a collection of data. Usually, you would keep data of the
same type in an array. You will learn to create arrays, read values, and manipulate
arrays. Also learn to use array methods such as push, pop, shift, unshift, and how to
iterate arrays using loops.
● Hashes - A hash, also called a dictionary, is a data structure used to store a collection of
arbitrary data. A hash is made up of properties, each property will have one key, and one
value. The key is used to retrieve the value, and each key needs to be unique in a hash.
You will learn how to create a new hash; how to read, add, and remove properties; and
how to iterate a hash.
👋 If you are looking for a full fledged program with mentorship and career guidance, check out
our Full-stack Web Development Program.
Back-end Development in Ruby on Rails
Storing and manipulating data permanently
A back-end web server application deals with data storage and business logic. It’s all about
creating, retrieving, modifying, and deleting data. Say a message board such as Twitter, where
the core business logic is tweet creation and tweet retrieval. But of course there are also other
things to consider, such as user authentication, data validation, and security.
So how does a back-end server application interaction work? Well there are three parts to it.
First, the party that wants to interact with the back-end has to send a request. This is usually a
person on a web browser. For example, Lily who wants to post a new tweet on her Twitter feed.
1. Lily types a message and clicks the tweet button. The JavaScript program in the browser
that handles this action translates it into a Post request and sends it to the back-end of
Twitter.
2. The Twitter back-end receives the request and starts processing it. It adds the tweet to
the database and does whatever tasks it needs to.
3. Twitter back-end then sends a response back to Lily’s browser. Most likely saying that
the tweet has been successfully added. Also, the data of the new tweet is usually sent
back with the response as well.
At this point, the job of the back-end is done. It is up to the front-end how to deal with the
response. If the tweet was successfully added, then the front-end will likely update Lily’s feed to
reflect that. Otherwise, it will show an error message.
But here’s the thing, a back-end server is only able to execute the tasks it is programmed for.
You cannot send a request to post a new tweet on your Twitter account to Google’s back-end
server. So, how do we know what kind of tasks a back-end server can carry out?
This is exactly the purpose of an Application Programming Interface (API). An API is a set of
definitions of routines. For a back-end web application, an API refers to the logic of all the
requests it is programmed to handle. APIs will generally come with API documentation too,
which is how other programmers can learn how to use a particular back-end API.
You will learn the model-view-controller (MVC) structure of a Ruby on Rails back-end
application. How to define routes for a back-end server. How to create, edit, delete data in a
database. How to process requests and send back responses. How to write application features
such as user authentication, photo upload, email sending. How to write automated tests. And
finally deploy your back-end application live onto the web.
● Third Party Services - After installing Rails, create your accounts for Heroku and
Amazon Web Services (AWS). Heroku is a minimal setup hosting service for web
applications, we will be deploying our back-end applications on Heroku. AWS is a suite
of tools for web hosting when you need fine control over your servers. We will use some
of its services for data storage.
The key difference between Ruby on Rails and other web frameworks is its convention over
configuration philosophy. In Ruby on Rails, much of the mundane decisions are already made
for you by ways of convention. So programmers can focus on things that actually matter, i.e. the
business logic.
● Database - Back-end applications’ primary task is permanent data storage. You will
understand the concept behind relational databases. Which is a type of database
structure popular for mission critical applications amongst financial institutions and large
internet companies. Also learn about database schema and migration.
● Model - Model is the first component of MVC. It's the core of data management in Rails
because it lives between the controller and the database. Rails has a feature called
Object-relational Mapping which lets you interact with the database without using the
database’s native programming language. Learn to create new models in Rails using the
generator command; add data attributes to migration files and run migration to edit the
database; and create a new data entry using the Rails console.
● Controller - Controller is the interface between model and view. When a request is sent
to the back-end, it will first be filtered by route management, then passed to the
corresponding controller for handling. In the controller file, you can define how you want
to handle and process the request. Learn to create controller methods and
corresponding route end points for GET/POST/PUT/DELETE requests; learn to test your
end points with the Postman app; learn to craft text and JSON responses directly in the
controller; and learn to read request params in the controller.
● Database Migrations - Migrations are a convenient way to alter database structure over
time in a consistent and simple manner. Traditionally, you have to write raw SQL to
modify the database schema. In Rails, you only need to write Ruby code to do the
migrations. Learn to add tables, attributes, and modify the database structure by using
migration.
● Associations - Association is a connection between two data tables. For example, you
can have a table for authors, and a table for books. And you can create a connection
between the books and their authors. This kind of connection is called an association.
Learn to add associations such as has_many, has_one, belongs_to to Rails models.
● Gemfile - The Gemfile allows us to define which Ruby libraries (gems) we want to use
for our Ruby project. Gemfile can be used for all Ruby projects, so it's not unique for
Rails. Learn how to read the Gemfile, and how to add gems to it.
● Testing - Automated testing is important in back-end applications. Often, test
specifications would be written for model, controller, and view, and the tests would be
run when changes are made to ensure everything works as expected. Learn to use the
rspec gem to add automated testing to your Rails application.
● Views - Back-end applications have the ability to return responses in different formats,
such as HTML, JSON, XML. The view component is in charge of determining the
response format. You will focus on using Rails as a pure API application and only write
responses in JSON for now. Learn to use the Jbuilder gem to construct JSON views.
● Environments - In Rails, there are three main environments: development, test and
production. Essentially, environments are segregated boxes where your actions in one
box don't affect other boxes. This allows you to do whatever you want in one
environment without worrying about messing up another environment. Learn to set up
different environment variables, gems, and behaviors for your Rails application.
👋 If you are looking for a full fledged program with mentorship and career guidance, check out
our Full-stack Web Development Program.
● User - User authentication starts with a user model. Websites often use the user model
to hold information such as contact email, username, first and last name, and password.
Learn to create a user model to store username and password for a ToDo list application
so users can sign up for an account.
● Session - Once users can sign up, they need to be able to sign in too. Signing in
requires a concept called session. A session is simply a database entry that records a
user’s unique sign in token which is also stored on a user’s browser. Everytime a user
makes a request from the browser, this token is sent together with the request. The
back-end application then checks and validates this unique token to authenticate the
user, before carrying out the tasks requested. Learn to implement the session system
and use it to ensure users are authenticated before carrying out tasks in other API
endpoints.
● Encrypting Passwords - If we store user passwords as plain text, we risk exposing
them if the server or database is compromised. This is especially damaging when users
use the same password across many different websites. Making their accounts on
multiple websites vulnerable. To combat this, we should encrypt the user’s password
stored in our database. Learn to use BCrypt to encrypt passwords for storing and
decrypt them when users login.