Jonathan is a developer from Plan ₿ Network and graduated from Cubo +, hater of shitcoins and lover of Bitcoin technology as well as self sovereignty
In Summary
How to Run Bitcoin Learning Management System Locally
- Linux machine with Docker and Docker Compose installed (it has been reported working on Windows too).
- sufficient
nodejsversion (tested: 22.12.0) pnpminstalled on your system.- Git configured for cloning repositories.
Clone the repository to your local machine:
cd bitcoin-learning-management-system
git clone https://github.com/PlanB-Network/bitcoin-learning-management-system cd bitcoin-learning-management-system
.env.example file:cp .env.example .env
-
Edit the
.envfile, deleting the .example part of the name, now you have to include dummy keys for required variables. Example:⚠️ This is a mandatory step, skipping it will result in errors such connection refusal between some of the containers.Don't forget to add your dedicated Github PAT too in the file# Dummy Keys for External Services SBP_API_KEY=dummyApiKey SBP_HMAC_SECRET=dummyHmacSecret STRIPE_SECRET=sk_test_dummySecretKey12345 STRIPE_ENDPOINT_SECRET=dummyEndpointSecret12345 SENDGRID_KEY=dummySendgridKey
Be sure to have installed a suitable nodejs version. As of 2024-12, v22.12.0 (LTS) has been proven working.nvm installation method.sudo apt install libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++ libpixman-1-dev
../bitcoin-learning-management-system/ folder, run the following command to install pnpmpnpm install
Inside your
../bitcoin-learning-management-system/ folder, start the development environment with Docker:docker compose up --build -V
docker compose up -d --build -V
Once the containers are running, access the frontend at:
[http://localhost:8181](http://localhost:8181)
pnpm run dev:db:migratepnpm run dev:db:migrate
To import data into the database, make a request to the API:
curl -X POST http://localhost:3000/api/github/sync
If you encounter access issues with the
cdn and sync volumes, run:docker exec --user=root bitcoin-learning-management-system-api-1 chmod 777 /tmp/{sync,cdn}
curl -X POST http://localhost:3000/api/github/sync
If you need to use a fork or a specific branch:
- Edit the
.envfile to update the following variables:
DATA_REPOSITORY_URL=https://github.com/<your-username>/bitcoin-educational-content.git DATA_REPOSITORY_BRANCH=<your-branch> PRIVATE_DATA_REPOSITORY_URL=https://github.com/<your-username>/planB-premium-content.git PRIVATE_DATA_REPOSITORY_BRANCH=<your-branch>
docker compose down -v docker compose up --build -V
curl -X POST http://localhost:3000/api/github/sync
docker compose down
docker container prune -f docker volume prune --all
docker-compose up --build -V curl -X POST http://localhost:3000/api/github/sync
Author
This tutorial has been written by Jonathan Ramos
You can say thanks by tipping the professor.
Credits
This tutorial has been proofread by jramos0
Even if this content is in its original language, human review is necessary to ensure its accuracy.
jramos0514 sats257 satsEvery content on the platform is the result of a collaborative effort: each lesson, translation, and revision is made possible by the work of contributors. For this reason, we are always looking for proofreaders who can review our content in many languages. If you want to participate in the proofreading process, please reach out in our Telegram group and read our tutorial. We remind you that this content is open-source - licensed under CC BY-SA - so it can be freely shared and used, as long as the original source is credited.
