Technical document

Decision to build our own LMS from scratch

LMS: SaaS or in-house development? We first present the decision criteria, then explain the authentication design using Laravel Sanctum and the design of a student progress data model resilient to course revisions.
System Design / LMS~13 minPublication Date September 22, 2026Update date September 22, 2026
Decision to build our own LMS from scratch

Summary

Key points of this document

  • SaaS or in-house development? The premise is that "SaaS is the right answer for most companies."
  • We choose Laravel Sanctum for authentication.
  • We include status, completion timestamp, viewing position, and a snapshot of completion conditions. The last item is crucial. Course content is revised. When a lesson is added, should the "completion" of students who finished before the revision be maintained? To answer this, it's necessary to record "what the completion conditions were at the time of completion." If progress is merely held as the current state, the integrity of past records breaks with each course revision.

Overview

"Should an LMS be SaaS or custom-built?" This is a frequent question from companies with educational businesses. flares.jp chose to develop its own LMS from scratch using Laravel + React. We first present the decision criteria and then explain the core implementation: authentication design and the student progress data model.

SaaS or in-house development? The premise is that "SaaS is the right answer for most companies."

There are mature options like Teachable and Thinkific, or AirCourse and learningBOX domestically. For tens of thousands of yen per month, development costs are zero, and maintenance is zero. To overturn this premise, clear reasons are necessary.

There are three conditions that justify in-house development. First, when the LMS is central to the business and a source of differentiation. In our case, the combination of a Japanese-Vietnamese bilingual learning experience for foreign talent and management functions for receiving companies was the product itself, which existing SaaS could not express. Second, when there are deep integration requirements with other systems. Third, the changing structure of development costs. With AI agent-driven development, the implementation cost for mature domains like LMS has become a fraction of what it used to be.

If these three conditions do not apply, you should not build it yourself. In-house development based solely on "SaaS monthly fees are high" will almost certainly lead to regret due to underestimated maintenance costs.

We choose Laravel Sanctum for authentication.

Laravel's API authentication primarily offers Passport and Sanctum; Sanctum is the standard solution when combined with SPAs. All OAuth2 features are only necessary when exposing APIs to external developers; if only your own frontend is involved, Passport is overkill.

There are three key points for implementation. First, do not store tokens in local storage; use stateful authentication with HttpOnly cookies. This structurally eliminates the risk of tokens being stolen via XSS. Second, ensure consistency between CORS settings and SANCTUM","STATEFUL","DOMAINS. This is a typical reason for "it works locally but I can't log in on production." Third, role design. Control the three roles—student, corporate administrator, and system administrator—with middleware, and further enforce tenant boundaries with policy classes so that "only data from one's own organization is visible."*Multi-tenant data leakage is the most critical incident to prevent in an LMS. Authorization testing is given the highest priority in E2E testing.*The student progress data model is the core of LMS design.

The basic structure consists of courses, lessons, users, organizations, and lesson_user (an intermediate table for student x lesson) to record progress. The design's branching point lies in what to include in this intermediate table.

We include status, completion timestamp, viewing position, and a snapshot of completion conditions. The last item is crucial. Course content is revised. When a lesson is added, should the "completion" of students who finished before the revision be maintained? To answer this, it's necessary to record "what the completion conditions were at the time of completion." If progress is merely held as the current state, the integrity of past records breaks with each course revision.

Another design decision is how to handle aggregations. Real-time aggregation is sufficient until the number of students × lessons reaches several hundred thousand rows. We use aggregation tables only for report display on the administration screen and update them with daily batches. Rushing into denormalization from the start will lead to integrity bugs. Optimizing later is the correct order.

I will honestly write about what awaits after building it.

The tasks that arose after completion were not limited to feature additions. They included following major Laravel versions, addressing vulnerabilities in dependent packages, PHP version upgrades, optimizing video streaming costs, and minor UI improvement requests. These tasks, which one wouldn't need to worry about with SaaS, definitely occur.

Nevertheless, we can say that choosing in-house development was a good decision because the LMS is not only a "product for sale" but also a "proving ground for our company's technical capabilities." Many of the topics covered in the technical documents on this site originate from this LMS development.

There are 5 questions to answer before starting.

As material for decision-making, I list questions that should be answered before starting.

Can you write down three differentiation requirements? If not, SaaS is sufficient.

Have you compared the total costs for 5 years? Compare 5 years of SaaS fees with development costs + annual maintenance costs (15-20% of development costs) × 5 years.

  • Who specifically will be responsible for maintenance? If outsourced, what is the likelihood that company will still exist in 5 years?
  • Can you outline the response system in case of a security incident? Delays in vulnerability response are a business risk in themselves.
  • Is the first customer decided? The biggest failure is "built but can't sell," which is more frequent than technical failures.
  • I will answer questions about implementation details.
  • We do not recommend direct video streaming from your own servers. Hosting videos on external platforms with restricted access and having the LMS handle embedding and recording viewing positions is a realistic solution for smaller scales.

For certificate issuance, we separate completion judgment from certificate PDF generation. The certificate embeds the issue date, course version, and a verification ID, and we save the data at the time of issuance to ensure the same content is produced upon re-issuance.

The minimum configuration for a small start consists of four functions: authentication, course viewing, progress recording, and an administrator's progress list. Conversely, what you should NOT build from the start are notification features and analytics dashboards. Requirements will inevitably change once operations begin.

Placeholder string 31

Placeholder string 32

Technical documents

We will continue to increase technical documentation.

We will continue to organize our thoughts on AI, cloud, business app development, requirements definition, and operational design into documents.

Go to technical documentation list