Skip to content

lotta-schule/lotta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lotta

Lotta is a simple-to use platform aimed at schools. Its comprehensible interface makes it easy for students and teachers to create a sophisticated webpage for their school, providing articles, files, messages and media in access-controlled spaces.

See https://lotta.schule for more information.

The latest git tag is the currently deployed version that also runs unmodified on our infrastructure.

Components

Webapp

Location: apps/webapp

The Webapp is a NextJS app that serves the application. Its primary purpose is serving the frontend.

Core

Location: apps/core

The Core is a Phoenix app that serves the backend, handles authentication and authorization, data storage and retrieval, real-time notifications, and more. The boundary to the outside wolrd consists primarily of a GraphQL API.

Hubert

Location: libs/hubert

Hubert is our component library. See our storybook to get an overview over the available components.

Theme

Location: libs/theme

Here lies the definition and schema lotta uses for theming.

Storybook Hubert

Location: apps/storybook-hubert

The storybook project for hubert. It's just for illustration purposes and drives the storybook for hubert.

Storybook-Addon-Theme

Location: libs/storybook-addon-theme

A storybook-addon which allows editing the lotta theme in storybook

Development

For monorepo managing, we use nx.

Prerequisites

  • Have nodejs installed (See .tool-versions) to see which one
  • Have elixir installed (See .tool-versions) to see which one. Take care to have the same version of OTP installed as well.
  • This is a monorepo taking advantage of pnpm workspaces. You will have to have pnpm installed on your machine.
  • Either have a local postgres database, redis cache, and a RabbitMQ broker running, or just have a docker daemon running. The services you'll need are defined in apps/core-api/docker-compose.services.yml.

We know getting started is not very easy at this point, but it has not been a priority yet. If you are interested in contributing, or have any questions, feel free to reach out to us.

Commands

  1. Install the necessary dependencies. In the project's root folder, run:
pnpm install
  1. Make sure you have the necessary services running. If you have docker installed, you can start them with:
docker-compose -f apps/core-api/docker-compose.services.yml up -d
  1. Run all available tests (this will take a few minutes, depending on the machine you run it on):
pnpm test
  1. Run all available linters / typecheckers:
pnpm lint
pnpm typecheck
  1. Start the Development environment:
pnpm dev:full

This will start:

  • The Hubert Storybook on localhost:6006. This project lists, shows and documents any components we have available in our component library Hubert.
  • The Lotta Core API. The main backend to a lotta project. By default, it'll start on localhost:4000 on your machine.
  • The Lotta Webapp. The main web frontend to a lotta project. This is what is usually referred to by lotta. By default, it'll start on localhost:3000 on your machine.

The easiest is to start by creating a new lotta tenant, or copying over the data from some prod or test system. As lotta recognizes its tenants via the host url, we suggest you use http://<tenant-slug>.local.lotta.schule:3000; It's pointed directly to your localhost, but with the extra of having a multitenant-capable hostname