This device is not compatible.

PROJECT


Build an E-learning Website Using Elixir

In this project, we'll build an e-learning course catalog website that will include search functionality. We'll develop the web application using Elixir plugs, with PostgreSQL as the database. In the end, we'll have a fully functional e-learning website built on Elixir plugs.

Build an E-learning Website Using Elixir

You will learn to:

Understand the fundamentals of Plugs in Elixir

Create and use Ecto migrations

Bind PostgreSQL with the Elixir application

Write Embedded Elixir in HTML

Skills

Database

Web Development

Functional Programming

Prerequisites

Basic understanding of Elixir Plugs

Basic understanding of PostgreSQL

Technologies

Elixir

PostgreSQL

Project Description

In this project, we’ll develop an e-learning course catalog website using Elixir plugs. This website will also include search functionality. Each course will have a title, an image, an author name, a status indicating whether it is paid or free, a description, and a “Visit Website” button. The website will also allow users to search for the courses that are available in the search bar.

Below is a preview of the final layout of the catalog:

Interface of the project

We’ll build this project step-by-step. We’ll initially have to implement the course catalog. For the implementation, we’ll have to fetch the data from the seeds and insert it into the PostgreSQL database and then load it into active records.

Once the layout is ready, we’ll add search functionality to our web application. When a user searches for a course name, our application will search the keyword from all the course names and render the relevant courses.

Note: The sole motivation for using Elixir plugs is that they handle a lot more requests per second compared to Phoenix, as is shown by the table given below:

Framework Throughput (req/s) Latency (ms) Consistency (σ ms)
Gin 51483.20 1.94 0.63
Phoenix 43063.45 2.82 (1) 7.46
Express Cluster 27669.46 3.73 2.12
Martini 14798.46 6.81 10.34
Sinatra 9182.86 6.55 3.03
Express 9965.56 10.07 0.95
Rails 3274.81 17.25 6.88
Plug (1) 54948.14 3.83 12.40
Play (2) 63256.20 1.62 2.96

Note: This table is taken from the famous GitHub repository of Matthew Rothenberg. You can take a look at the repository yourself with this link.

Project Tasks

1

Creating Courses

Task 0: Initial Setup

Task 1: Create a Course Model

Task 2: Create Migrations

Task 3: Create a Schema and a Changeset

Task 4: Query the Database

2

Creating Views and Routes

Task 5: Create Views

Task 6: Add Routing

Task 7: Try it out

Task 8: Removing Errors

3

Adding a Search Functionality

Task 9: Add a Search Bar

Task 10: Search Query the Database

Task 11: Adjust Routing

Congratulations!