Skip to content

Selleo/lms-core

Repository files navigation

Apps and Packages

  • 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

Install

To start with the setup make sure you have the correct NodeJS version stated in .tool-versions. For the node versioning we recommend asdf. At the time of writing this readme the version is 20.15.0

After these steps, run the following command

pnpm install

Now to configure our reverse proxy we need to install Caddy. You can do this using homebrew on mac.

Important

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

To do that proceed with the following

cd ./apps/reverse-proxy
caddy run

After running caddy proceed with the on screen instructions.

Last step is to go our NestJS app and configure its environmental variables and docker. So being in guidebook/apps/api run the following command

cp .env.example .env
docker-compose up -d

Migrations

Once the docker is up and running we need to run the migrations. To do that run the following command

pnpm db:migrate

Develop

Now in the main directory once you run pnpm dev it will run everything in parallel and you should be abble to acces your app on the following adresses!

Service URL
Web app https://app.guidebook.localhost
Api https://api.guidebook.localhost
Swagger https://api.guidebook.localhost/api

Commands

  • Database

    • generate migration

      pnpm db:generate
    • run migrations

      pnpm db:migrate

Important

Once migration is generated chagne its name to something more descriptive. Also make sure to change the migration name in _journal.json file under the tag key.

  • HTTP Client

    To generate the http client run the following command.

    pnpm generate:client

    This command automates the process of creating a TypeScript client for the API based on the Swagger specification.

  • Email Templates

    Email templates are generated on every start of turborepo. To generate them manually run the following command in packages/email-templates.

    pnpm build

    The mailhog service is available at mailbox.guidebook.localhost

  • Testing

    • Frontend:
      pnpm test:web
      pnpm test:web:e2e
    • Backend:
      pnpm test:api
      pnpm test:api:e2e

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.)