Educational platform, that returns tailor-made content based on the student‘s learning profile and recommends new content on observed preferences.
Before you start with the installation, please make sure you have set up your environment according to the Apostrophe Documentation. This will save you a lot of headaches ;)
Clone the repository
git clone https://github.com/vincentrohde/bachelor.git
Install the dependencies.
npm install
First of all you need to connect with the cli of your Apostrophe container. To do so, enter the following command.
docker exec -it { your Apostrophe container id } /bin/bash
In the beginning, start by creating an admin account. The prompt will ask for a password of your choice. Make sure to remember your password!
node app.js apostrophe-users:add admin admin
Now you can run the server, like this.
node app.js
Once the server runs, the project is ready under this URL:
http://localhost:3000
The first thing you will have to do, is navigate to the login screen.
http://localhost:3000/login
Now you can login using the admin credentials you set up earlier.
Okay, now that you have everything up and running, it's time to create some content. By doing this, you will get a better understanding of the project's general concepts, when it comes to content management. In the next chapters the focus will be more on the stuff behind the scenes (the backend code).
The Tracker module watches the user's interaction with the site.
It collects various data, from content-elements (style, difficulty, practicality, type) and
posts/ favorites (id, tag (category)). These are stored and managed in two cookies:
learningStyle
(the student profile) and favorites
. These cookies are processed by the Preferences module.
Every content-element inside a post is equipped with a like widget. The user has the option to share his content preference, with the Tracker, by liking or disliking the element.
Each post can be saved by the user, through the favorite icon. Setting a post as a favorite will be picked up by Tracker. Favorites are the main source for content recommendation (posts on the front page).
The Preferences module generates user profiles, based on the data from the Tracker generated cookies. The learning-style profile is used by the Curator module to filter the content inside posts. While the favorites profile is used when querying from MongoDB.
The Curator module is used to filter content-elements from the response object for a Post page, based on the provided learning profile. The algorithm's priority of filtering is the following, from highest to lowest:
- Learning style
- Difficulty
- Practicality
- Media Type
The apostrophe-pages:beforeSend event is an event of the Apostrophe internal apostrophe-pages
module. It is the final event before sending out data to the client. This
project makes use of this event in two situations:
In both cases it is used to allow alteration of the response to the client.
When requesting Posts for the start page, a few filters are applied to the database request.
req.data.filteredPosts = await self.apos.docs.getManager('post')
.find(req)
.tags(tagPreferences)
// newest posts
.sort({ updatedAt: -1 })
.limit(5)
.toArray();
- Apostrophe v2
- Apostrophe Boilerplate v2
- Apostrophe Documentation
- MongoDB
- Lots of debugging, reading documentation and browsing issue threads ❤️