These instructions mostly repeat the process scripted in the Dockerfile, with some minor adjustments for the local development.
Instructions below assume that they are launched from the repository root
These commands are expected to be run from the frontend
directory.
In order to build the frontend, you need to
- Install
node 20.x
. It can be done using nvm - Run
npm install
- Run
npm run local:1
to build the frontend code. - Run
npm run build:css
to only build the CSS.local:1
task also runs this command.
It is expected that frontend/assets/v1/dist
folder will contain the output artifacts.
The LMS uses Python 3.10, and there are dependencies that won't work with the newer Python versions out of the box. If your local system Python version is different, you can install Python 3.10 using pyenv tool.
Having installed Python, you need to create a virtual environment with pipenv
. Install pipenv using pip install pipenv
and run pipenv install -d
to install the dependencies, along with the dev packages (it installs django debug toolbar). Activate the virtual environment with pipenv shell
.
Copy the environment config: cp lms/settings/.env.example .env
and fill AWS.*
variables with some non-empty strings, e.g. AWS_S3_ACCESS_KEY_ID=asd
Append the localhost domain name at the end of the file, if you want to access the LMS in dev mode using "localhost:8001" URL:
LMS_DOMAIN=localhost
SITE_ID=1
ENV_FILE=.env python manage.py collectstatic --noinput --ignore "webpack-stats-v*.json"
Start PostgreSQL in a docker container:
docker run -d -p 127.0.0.1:5432:5432 --name lms-postgres -e POSTGRES_USER=csc -e POSTGRES_DB=cscdb -e POSTGRES_PASSWORD=FooBar postgres
Start Redis in Docker container:
docker run -d -p 127.0.0.1:6379:6379 --name lms-redis redis:6-alpine redis-server --appendonly yes
and apply migrations, that essentially create and initialize the database: ENV_FILE=.env python ./manage.py migrate
ENV_FILE=.env python manage.py runserver localhost:8001
Run tests using pytest.
If you want to run tests from some specific folders, append the folder names to the command: pytest apps/core
- Run https://code.jetbrains.team/p/edu/repositories/educational-server locally
- Set the
SUBMISSION_SERVICE_URL
andSUBMISSION_SERVICE_TOKEN
variables to the values from the.env.example
file - Enable internal mode in your IDE: https://plugins.jetbrains.com/docs/intellij/enabling-internal.html
- Install the JetBrains Academy plugin
- Open any JBA course
- Use the "Change Submissions Service URL" action to set the URL to
http://localhost:8080