Code Monkey home page Code Monkey logo

sovereign-university's Introduction

Plan B Network

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.

Development - Run the project locally

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.

Clone the repo

Do it.

Setup your environment variables

Duplicate the .env.example file and rename the duplicate .env.

Run the containers

To start the development environment, run :

  1. pnpm install
  2. docker compose up --build -V

This will start all the necessary containers.

Set up your database schema

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 :

  1. cd packages/database
  2. 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.

Import data from the data repository

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.

Sync issue

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}

Development - Manage the database

Update the schema

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 :

  1. cd packages/database
  2. 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 :

  1. cd packages/types
  2. pnpm run types:generate

Run SQL queries

To open psql, run docker exec -it sovereign-university-postgres-1 psql -U postgres -d postgres

sovereign-university's People

Contributors

trigger67 avatar louneskmt avatar kevinmulier avatar ac1dbunny21 avatar weblate avatar c00rni avatar jramos0 avatar guillaumehussong avatar max-lt avatar asi0flammeus avatar jimmydjabali avatar maheshchandra10 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.