{
  fetchgit,
  buildNpmPackage,
  pkgs,
  dataDir ? "/var/lib/gtcm-file-uploader",
}:
let
  repoSrc = fetchgit {
    url = "https://git.b4l.co.th/newedge/think-greaterchiangmai";
    rev = "6f8c8d7dfaf5a0c1eb2077de1d6fb35ceaf3d4ec";
    hash = "sha256-2mCdn8xGjWZrANclctGTmxQhkNc43VzlzMTVwVIFJcM=";
  };
  src = "${repoSrc}/upload-large-file";
in
buildNpmPackage {
  pname = "gtcm-file-uploader";
  version = "1.0.0";

  nativeBuildInputs = with pkgs; [
    nodejs
    breakpointHook
  ];

  inherit src;

  npmDepsHash = "sha256-JEp2F1CQfuV9fSYZRdRO+BiOE9dy1ReK6doJcqCuxu4=";

  buildPhase = ''
    npm install
  '';

  installPhase = ''
    runHook preInstall
    mkdir -p $out
    cp -r * $out
    ln -s ${dataDir}/.env $out/.env
    ln -s ${dataDir}/gtcm-file-uploader/uploads $out/src/be/uploads
    runHook postInstall
  '';
}
