Skip to content

Developer Manual

Ronny edited this page Dec 3, 2021 · 3 revisions

Developer Manual

Basically HakuNeko consists of two components, a web-application that provides the full functionality and a desktop client that merely hosts the web-application and provides access to the underlying system (e.g. File/IO). The HakuNeko web-application is hosted on a server where updates and fixes are regulary deployed (rolling releases). The HakuNeko desktop client downloads the web-application everytime when it was updated and host it from a local cache directory. There is also a third component, which focuses on content delivery for very slow or resource consuming manga websites. For safety reasons this third component is not part of the public repository.

developer infrastructure
Figure 1. HakuNeko Infrastructure & Architecture (schematic)

1. Setup the Environment

This section describes the process of installing all system-wide tools, frameworks and libraries required for HakuNeko’s development. All steps are briefly explained, without going into details (e.g. operating system specific variations). For further information please visit the corresponding website.

git

The version control system required for HakuNeko is git. It is used to checkout the latest sourcecode of HakuNeko from GitHub, or commit changes to the repository. Download and install git for your operating system.

NodeJS & NPM

NodeJS is a JavaScript runtime that allows to execute applications written in JavaScript. NPM is a package manager for NodeJS that simplifies the process of downloading and installing JavaScript applications and libraries, which are published in a central repository. Download and install NodeJS and NPM for your operating system.

Editor or IDE (optional)

It is possible to only use a simple text editor, but it is more easier with a powerful source code editor or even an IDE. Use what you like, here are some examples: Visual Studio Code (my personal favorite), Atom, Brackets, WebStorm

2. Getting the Source Code

The source code for HakuNeko can be found in a public repository on GitHub. There is also a mirror on _Azure DevOps_, but developers are encouraged to use the one from GitHub as the upstream repository.

2.1. Fork

If you plan to make contributions without becoming a project member, it might be useful to create a fork of the project, before getting the source code. Many developers may disagree, but personally i dislike the overhead of the Fork & Pull Request Workflow for open source projects. If you are willing to contribute to a project, then you deserve it to become a member!

2.2. Clone the Repository

Open a terminal and run the following commands:

cd ~/Projects
git clone 'https://github.com/manga-download/hakuneko.git' hakuneko
  1. Change into the directory where you wanna checkout the source code

  2. Clone either the upstream repository or your fork into the hakuneko sub-directory

2.3. Workspace Structure

There are four folders (two projects) inside HakuNeko’s source directory.

assets

This folder contains resources for the documentation (e.g. screenshots).

client

This is the project folder for development of the desktop client.

web

This is the project folder for the development of the web-application.

doc

This folder contains resources for the documentation of both projects.

3. Install Dependencies

To run, build or deploy HakuNeko, it is required to install all project-based tools, frameworks and libraries. All dependencies will be installed using NPM, just run the standard command from the root directory. It will automatically recurse into the project directories and install all required packages.

cd ~/Projects/hakuneko
npm install
# Due to missing arm64 builds of older electron releases for Apple M1, it is necessary to install the Intel version, e.g.
npm install --arch=x64 electron@8.5.5

4. Run the Application

Start a local development version of HakuNeko that will use the current source code from the project folders (client, web) instead of the deployed web-application from the server.

cd ~/Projects/hakuneko
npm start