Skip to content

ttkb-hcmut/bkhack

Repository files navigation

bkhack: Bách Khoa Hack

bkhack is an abstract, heterogeneous full-stack application, currently deployed as a social news website at Ho Chi Minh University of Technology.

The following paper provides more details:

            Develop an educational computer-science-oriented social news website for Ho Chi Minh University of Technology (pdf)
            Phát triển mạng xã hội giáo dục hướng Khoa học Máy tính tại Đại học Bách Khoa TP.HCM
            Lê Nguyễn Gia Bảo, Lê Công Minh Khang, and Hồ Gia Tường
            Undergraduate Thesis 2026
            Project Repository Thesis Paper (pdf) Live Deployment


Installation

Add the bkhack repository to OPAM:

opam remote add bkhack-repo git+https://github.com/ttb-hcmut/bkhack

Install the package:

opam install bkhack

Usage

bkhack is distributed as both reusable OCaml/Reason library. You can integrate it into your own Reason application:

(rule
 (alias bundle)
 (deps (:static (source_tree Static))
       ; ...
       (:src (alias core))
       (:serve (alias Service/default)))
 (action
  (run bkhack-tools.webpackgen
       -static %{static}
       ; ...
       -src %{src}
       -serve %{serve})
  ))
(melange.emit
 (alias core)
 ; ...
 (preprocess (pps ppx_comptime))
 (libraries bkhack))

Bundle the application for deployment:

dune build @bundle

This produces a _build/${context}/${src}/dist/ directory containing static HTML and JavaScript bundles suitable for deployment platforms such as Firebase Hosting or Netlify, and a _build/${context}/${src}/distserve/ directory containing a dockerized Elixir bundle suitable for deployment platforms such as GCP Compute Engine or Fly.io.

For demonstration, let's assume you want to run the website locally

(cp -rf _build/${context}/${src}/dist dist && pnpm exec live-server --cors dist 8080) &
({ cp -rf _build/${context}/${src}/distserve distserve && cp _build/${context}/${src}/distserve/config/shell.nix.ex distserve.nix ;} && nix-shell distserve.nix --run "cd distserve && mix deps.get && mix run --no-halt"); wait

Development

See ./doc/development.md for more details.


Try It Out

The current deployment is available here!

About

Abstract, heterogeneous full-stack application.

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Contributors