This repository contains the source code of the Search Engine for Open Source Hardware that was developed as part of my master thesis: _Library of Open Source Hardware: Creating a Semantic Knowledge Base and Search Engine for Open Source Hardware.
The code is hosted on GitHub
- Install Requirements: Developing the application requires the following tools to be installed on your system:
- Clone Repository:
git clone https://github.com/aisbergg/losh.git cd losh - Install Go Dependencies:
go install # or via proxy¹ GOPROXY=https://proxy.golang.org,direct go install - Setup Dev Tools: This repository comes with tools, like code generators, that are required for development. You can install those by executing the following script:
./tools/setup-dev.sh
- Start Database: This project uses Dgraph as a database. Use the following command to spin up a new database using Docker:
./tools/start-db.sh
- Upload DB Schema: You have to upload the database schema manually since this step is not included in the application yet.
./tools/upload-db-schema.sh
- Discover Products And Fill Database: Let the crawler run for a few minutes to fill the database with product data. This is just so that you have some data to experiment with.
go run ./crawler/main.go discover -c ./crawler/config-dev.yml
- Build Web Assets: Web assets, such as images, CSS and JS, need to be prepared/compiled first before the web application can be run. This is done using Node.js and the Webpack Mix bundler.
cd web yarn install yarn run dev - Run Web Interface: Run the web application with Air, for live reloading:
air -c .air.toml
- Test Web Interface: Open the web interface in your browser at http://localhost:3000 and test the service out for yourself.
¹ By setting the environment variable GOPROXY, Go will use a module proxy to download the dependencies instead of fetching them directly from the source repository. The simple reason for that is to ensure long-term availability. So even if a source repository is vandalized or deleted, an archived copy will be downloaded from the proxy.
Add License Header to all Go Files:
addlicense -c "André Lehmann" -l apache -v -ignore tools/tool.go -ignore gqlgenc_tool.go **/*.goBuild and run the web application manually:
cd web
go build -trimpath -o ./build/losh-web ./main.go && ./build/losh-web config show -c config-dev.ymlAndré Lehmann ([email protected])