PolarLearn is a free and open-source learning platform designed to provide the best learning experience for students.
- Open Source: We are transparent about our code and we welcome contributions from the community.
- Lists: Learn with lists of flashcards, quizzes, and more.
- Forum: Ask questions, share knowledge, and connect with other learners with (almost) zero restrictions on what you can discuss, wether it's about your personal life, tech or recent news, we allow it
- And more coming soon!
If you want to set up PolarLearn for hosting, follow these instructions:
Note
If you want to deploy PolarLearn for your organization, it is highly recommended to use something more professional, like Dokploy or Kubernetes. This guide only shows how to get PolarLearn up and running, it does not show how to actually scale it for production workloads.
- PostgreSQL >=16
- NodeJS LTS
- (preferably) pnpm >=11.x.x
First install all the project dependencies:
pnpm iIf pnpm prompts you about unapproved builds, please approve them first before continuing.
Then, make a copy of .env.example and name it .env. Replace the variables accordingly:
DATABASE_URL: This is the PostgreSQL connection string.APP_BASE: This is the full URL of where PolarLearn gets reached. For example:APP_BASE=https://staging.internal.polarlearn.nl/, orAPP_BASE=http://localhost:5173.APP_LANG: Language of the app.nlis currently the only supported variable as we currently don't need other languages.SECRET: A long random string used for cryptographically signing authentication tokens and other things inside the app. You can generate it usingopenssl rand -base64 32.
-
SMTP_HOST: The domain or IP where your SMTP server (postfix, mailcow) resides. -
SMTP_PORT: The port used to reach the SMTP server. -
SMTP_SECURE: Wether to not send the email traffic in plaintext. -
SMTP_USER: Username for SMTP authentication. -
SMTP_PASS: Password for SMTP authentication. -
SMTP_FROM: From which e-mail address to send the emails (optional, depends on server) -
S3_BUCKET: Name of the storage bucket. -
S3_REGION: Region of the storage bucket (optional only if you're selfhosting, check the docs for your server/provider) -
S3_ENDPOINT: The endpoint for the S3 server, for examplehttps://cdn.polarlearn.nl. -
S3_ACCESS_KEY_ID: The access key ID for the S3 bucket. -
S3_SECRET_ACCESS_KEY: The access key for the S3 bucket. -
LOKI_HOST: URL where Loki resides. -
LOKI_BASIC_AUTH: The username and password used for authenticating with Loki. Example:polarnl-loki:superdupercoolpassword123
Generate the prisma client and synchronize the postgres database by executing:
pnpm dbsync
You are now ready to boot PolarLearn. You can do this in two ways:
Starting the development server:
pnpm dev
Do this when you're modifying PolarLearn's source code. This enables live refresh/hot module reloading. Do note this is slower.
Starting the production server:
pnpm build && pnpm start
Do this when you are testing or deploying PolarLearn. This will be faster than the development server, however you will not have HMR.
- Docker
- PostgreSQL >=16
Run:
docker run ghcr.io/polarnl/polarlearn-v2 \
-p 3000:3000 \
-e DATABASE_URL=postgresql://...Please refer to method 1 for the environment variables.
We welcome contributions from the community! If you would like to contribute, please check CONTRIBUTING.md for guidelines on how to get started.
This project is licensed under the Affero GNU General Public License v3.0 (AGPL-3.0). See LICENSE for more details.
If you have any questions or suggestions, feel free to reach out to us through our mail (andrei.k@polarnl.org), our Discord server (click the badge above), or shoot us an issue on GitHub!
