Skip to content

Selleo/lms-core

Repository files navigation

LMS Core Project

MIT License Node.js pnpm NestJS Remix PRs Welcome A modern, scalable Learning Management System built with cutting-edge technologies.

FeaturesGetting StartedDevelopmentContributing


Table of Contents


Features

  • Modern Tech Stack: Built with NestJS, Remix, and TypeScript
  • Monorepo Structure: Well-organized codebase using Turborepo
  • Development Ready: Complete development environment with Caddy for HTTPS
  • Database Setup: PostgreSQL with migration and seeding support
  • Email System: Built-in email templates and testing via Mailhog
  • Testing: Comprehensive test suite for both frontend and backend
  • API Documentation: Swagger integration with TypeScript client generation

Overview

Apps

  • api: A NestJS backend application working as API
  • web: A Vite Remix SPA
  • reverse-proxy: For domains and https during development

Packages

  • email-templates: A package for email templates
  • eslint-config: A package for eslint configuration
  • typescript-config: A package for typescript configuration

Getting Started

Prerequisites

Before you begin, make sure you have:

  • Node.js version 20.15.0 (stated in .tool-versions)
    • We recommend using asdf for version management
  • pnpm package manager
  • Caddy
  • Docker and Docker Compose

Installation

Install project dependencies:

pnpm install

Configure Caddy (first-time setup only):

cd ./apps/reverse-proxy
caddy run
# After running caddy just terminate the process with Ctrl+C

Important

First run has to be run by hand to configure caddy. Later on it will automatically start with the app start script.

Environment Setup

Configure environment variables for both applications:

cd apps/api
cp .env.example .env
cd apps/web
cp .env.example .env

Database Setup

Migrations

  1. Start the database:
docker-compose up -d
  1. Run migrations:
pnpm db:migrate

Database Seeding

Populate the database with initial data:

pnpm db:seed

Development

To start all applications in development mode:

pnpm dev

Available Services

After starting the development environment, you can access:

Service URL Description
Web App https://app.lms.localhost Frontend application
API https://app.lms.localhost/api Backend API url
Swagger https://api.lms.localhost/api API documentation
Mailhog https://mailbox.lms.localhost Email testing interface

Commands Reference

Formatting

  • Format all files with Prettier
    pnpm format
  • Check if all files are formatted with Prettier
    pnpm format:check
  • Lint all files in the web app with ESLint
    pnpm lint-tsc-web
  • Lint all files in the api app with ESLint
    pnpm lint-tsc-api
  • Fix linting errors in the web app
    pnpm lint-tsc-web --fix
  • Fix linting errors in the api app
    pnpm lint-tsc-api --fix

Database Commands

  • Generate new migration:
    pnpm db:generate

Important

After generating a migration:

  1. Change its name to something descriptive that explains what it does
  2. Make sure to update the migration name in apps/api/src/storage/migrations/meta/_journal.json under the tag key
  • Run migrations:
    pnpm db:migrate

HTTP Client Generation

  • Generate TypeScript API client based on Swagger specification:
    pnpm generate:client

Email Templates

  • Build email templates:
    cd packages/email-templates
    pnpm build

Email templates are automatically built when starting the development server. To test emails, check the Mailhog interface at mailbox.lms.localhost.

Testing

  • Frontend tests:

    pnpm test:web        # Unit tests
    pnpm test:web:e2e    # E2E tests
  • Backend tests:

    pnpm test:api        # Unit tests
    pnpm test:api:e2e    # E2E tests

Project Structure

lms-core
├── apps
│   ├── api
│   │   ├── src
│   │   └── test
│   ├── reverse-proxy
│   └── web
│       ├── app
│       │   ├── api
│       │   ├── assets
│       │   ├── components
│       │   └── modules
│       └── e2e
└── packages
    ├── email-templates
    ├── eslint-config
    └── typescript-config

Contributing

We welcome contributions to LMS Core! Please check our Contributing Guide (coming soon) for guidelines about how to proceed.

Legal notice

This project was generated using Selleo LMS which is licensed under the MIT license.

About Selleo

selleo

Software development teams with an entrepreneurial sense of ownership at their core delivering great digital products and building culture people want to belong to. We are a community of engaged co-workers passionate about crafting impactful web solutions which transform the way our clients do business.

All names and logos for Selleo are trademark of Selleo Labs Sp. z o.o. (formerly Selleo Sp. z o.o. Sp.k.)