This is the repository for the PlanB Network website. The goal of this project is to create a free, open-source, and community-driven platform to learn about Bitcoin.
The repository holding the data for this project is here.
We are looking for contributors! If you want to help or learn more about the project, please reach out to us on Twitter or Discord.
We use Turbo to manage the monorepo and Docker to run the development environment.
Follow the next steps to run the project locally, on a linux machine.
Do it.
Duplicate the .env.example file and rename the duplicate .env
.
To start the development environment, run :
pnpm install
docker compose up --build -V
This will start all the necessary containers.
On the first run, you will need to run the DB migrations.
To do so, run go to the database folder with then run the migration script :
cd packages/database
pnpm run db:migrate
Once the containers are up and running, you can access the front at http://localhost:8181
. The app will automatically reload if you change any of the source files.
In order to sync the database with the data from the data repository, you can make a request to the API with curl -X POST http://localhost:3000/api/github/sync
. This will import all the data from the data repository into the database.
When running the sync locally, there is currently and access right issue with the cdn and sync volumes. To fix it, update the access rights with the following command :
docker exec --user=root sovereign-university-api-1 chmod 777 /tmp/{sync,cdn}
The central point for the database schema is this file : Schema.
For any update to it, you first have to update the schema.ts file.
Once updated, to reflect it in your database, run the following commands :
cd packages/database
pnpm run drizzle:generate
This will add a new migration script, then you hav to run it :
pnpm run db:migrate
Once the database is updated, update or create the associated types running :
cd packages/types
pnpm run types:generate
To open psql, run docker exec -it sovereign-university-postgres-1 psql -U postgres -d postgres