How works

In this post, I would like to tell you about my experience in developing an application for self-education —

The idea of the application is very simple. You choose interesting technologies, and we create for you a daily selection of video lessons. Here’s what it looks like:

The entire application is written in JavaScript. React.js is used on the client, Node.js is used on the backend. The client communicates with the server using Apollo GraphQL. We use a full stack from Apollo and are very pleased.

Client application

The structure of the application looks like this:

The application is based on the popular library for creating react-applications — create-react-app. Below, I will tell you more about each part of the application.

To create the user interface, we used the Material UI library — a first-class component library. This library has all the necessary components to create applications of varying complexity. I use it in all my projects and am very pleased.

We used React Styleguidist to create component documentation. Here’s what it looks like:

Especially important parts of the application are covered with tests. We use Jest to create tests and react-testing-library to test our components.

Server application

The structure of the application looks like this:

We use ApolloServer, Express.js, Agenda for queues. To configure the application for various environments, we use the npm package config — this is a very convenient library for configuration management. We decided to use MongoDB as a database for our application. The application uses the popular Mongoose library to work with the database. The application is hosted on the Digital Ocean cloud service. We use Digital Ocean Spaces to store images and other static files.

In my opinion, our way of organizing resolvers in our GraphQL server deserves special attention. In resolvers we try to have a minimal logic.

All business application logic is in Mongoose models. Here’s what it looks like. These are just some of the methods. In fact, they are much more.

This is approximately how GraphQL Server looks like. Please note — the viewer is the current authorized user.

Here is the GraphQL scheme. We use the same scheme for the user part and for administration. Perhaps in the future we will divide them into independent schemes.

To deploy the application, we use PM2. Advanced process manager for production Node.js applications. Load balancer, logs facility, startup script, micro service management, etc…

The source code of the project is placed on BitBucket. It’s great that they are allowed to create private repositories.

Well, perhaps that’s all I wanted to say in my first publication. If you have any questions, do not hesitate — write in the comments or email me to