Web Client for Lotta Project
Lotta is a simple-to use platform aimed at schools. Its comprehensible interface makes it easy for pupils and teachers to create a sophisticated webpage for their school, providing articles, files and media in access-controlled spaces.
See https://lotta.schule for more information.
This repository contains the source code for the lotta web client.
The lotta web client is the web frontend which connects to a lotta api, mainly over graphql.
The latest tagged commit is deployed, as is.
We invite you to inspect the source code, but have not yet decided about the terms we want to apply, so please contact us if you have questions about licensing or contributing.
We will probably change this situation soon.
The project is a nextjs project.
The configuration is done via environment variables.
You can find the local configuration in .env.development
.
If you have an instance of the api running locally on port 4000 (default), the project should work without modification.
If you want to modify or add configuration, you can create an
.env
file containing your custom configuration.
These are the available options:
environment variable | desciption |
API_SOCKET_URL | Endpoint for the socket connetion |
API_URL | Endpoint for the API. |
APP_ENVIRONMENT | Name of the environment |
CLOUDIMG_TOKEN | API Token for the cloudimg CDN |
FORCE_BASE_URL | Base URL for fetching ugc from a different API. This can be useful because during development, the local url for images is passed to the cloudimg service, but - as local url - cannot be resolved, so no images are displayed. By providing an alternative (publicly available) endpoint just for images, you can ensure the images can be displayed. |
FORCE_TENANT_SLUG | Force a tenant slug. By default the slug is recognized via the URL. This can be useful when using http://localhost, for example. |
SKIP_HOST_HEADER_FORWARDING | Skips reusing the "host" header when making (server-side) requests from the webapp to the api server. When reaching an API from an external network, it can be possible the request will be blocked by the webserver when the host header does not match the receiving webserver. As the host header is used to recognize the tenant, you may want to also set `FORCE_TENANT_SLUG` when using this option. |
BROWSERLESS_CHROME_ENDPONT | For PDF generation, you will need a [browserless](https://browserless.io/) instance. You can either use the public instance by using the value `https://chrome.browserless.io` or you can provide an own instance at a given URL. If not provided, PDF generation will not be available. using this option. |
Start with npm start
.
Test with npm test
.
There is a storybook project for the component library (which is still
work in progress), start it with npm run storybook
.