MCPcopy
hub / github.com/evan-buss/openbooks

github.com/evan-buss/openbooks @v4.5.0 sqlite

repository ↗ · DeepWiki ↗ · release v4.5.0 ↗
218 symbols 560 edges 60 files 62 documented · 28%
README

openbooks

NOTE: Going forward only the latest release will be supported. If you encounter any issues, be sure you are using the latest version.

Docker Pulls

Openbooks allows you to download ebooks from irc.irchighway.net quickly and easily.

openbooks screenshot

Getting Started

Binary

  1. Download the latest release for your platform from the releases page.
  2. Run the binary
  3. Linux users may have to run chmod +x [binary name] to make it executable
  4. ./openbooks --help
  5. This will display all possible configuration values and introduce the two modes; CLI or Server.

Docker

  • Basic config
  • docker run -p 8080:80 evanbuss/openbooks
  • Config to persist all eBook files to disk
  • docker run -p 8080:80 -v /home/evan/Downloads/openbooks:/books evanbuss/openbooks --persist

Setting the Base Path

OpenBooks server doesn't have to be hosted at the root of your webserver. The basepath value allows you to host it behind a reverse proxy. The base path value must have opening and closing forward slashes (default "/").

  • Docker
  • docker run -p 8080:80 -e BASE_PATH=/openbooks/ evanbuss/openbooks
  • Binary
  • ./openbooks server --basepath /openbooks/

Usage

For a complete list of features use the --help flags on all subcommands. For example openbooks cli --help or openbooks cli download --help. There are two modes; Server or CLI. In CLI mode you interact and download books through a terminal interface. In server mode the application runs as a web application that you can visit in your browser.

Double clicking the executable will open the UI in your browser. In the future it may use webviews to provide a "native-like" desktop application.

Development

Install the dependencies

  • go get
  • cd server/app && npm install
  • cd ../..
  • go run main.go

Build the React SPA and compile binaries for multiple platforms.

  • Run ./build.sh
  • This will install npm packages, build the React app, and compile the executable.

Build the go binary (if you haven't changed the frontend)

  • go build

Mock Development Server

  • The mock server allows you to debug responses and requests to simplified IRC / DCC servers that mimic the responses received from IRC Highway.
  • bash cd cmd/mock_server go run . # Another Terminal cd cmd/openbooks go run . server --server localhost --log

Desktop App

Compile OpenBooks with experimental webview support:

cd cmd/openbooks
go build -tags webview

Why / How

  • I wrote this as an easier way to search and download books from irchighway.net. It handles all the extraction and data processing for you. You just have to click the book you want. Hopefully you find it much easier than the IRC interface.
  • It was also interesting to learn how the IRC and DCC protocols work and write custom implementations.

Technology

  • Backend
  • Golang
  • Chi
  • gorilla/websocket
  • Archiver (extract files from various archive formats)
  • Frontend
  • React.js
  • TypeScript
  • Redux / Redux Toolkit
  • Mantine UI / @emotion/react
  • Framer Motion

Extension points exported contracts — how you extend this code

RequestHandler (Interface)
RequestHandler defines a generic handle() method that is called when a specific request type is made
server/websocket_requests.go
HandlerFunc (FuncType)
(no doc)
core/reader.go
ErrorTableProps (Interface)
(no doc)
server/app/src/components/tables/ErrorTable.tsx
BookTableProps (Interface)
(no doc)
server/app/src/components/tables/BookTable.tsx
FacetFilterProps (Interface)
(no doc)
server/app/src/components/tables/Filters/FacetFilter.tsx
FacetEntryProps (Interface)
(no doc)
server/app/src/components/tables/Filters/FacetFilter.tsx
TextFilterProps (Interface)
(no doc)
server/app/src/components/tables/Filters/TextFilter.tsx

Core symbols most depended-on inside this repo

Close
called by 13
mock/dcc_server.go
Write
called by 10
mock/dcc_server.go
IsConnected
called by 6
irc/irc.go
newErrorResponse
called by 6
server/messages.go
cols
called by 6
server/app/src/components/tables/BookTable.tsx
setActiveItem
called by 6
server/app/src/state/stateSlice.ts
terminalMenu
called by 5
cli/interactive.go
String
called by 5
server/messagetype_string.go

Shape

Function 105
Method 60
Struct 24
Interface 20
TypeAlias 6
Enum 2
FuncType 1

Languages

Go70%
TypeScript30%

Modules by API surface

server/messages.go15 symbols
server/routes.go10 symbols
server/irc_events.go10 symbols
irc/irc.go10 symbols
server/app/src/state/messages.ts9 symbols
core/search_parser.go9 symbols
server/app/src/state/stateSlice.ts8 symbols
cli/handlers.go8 symbols
server/server.go7 symbols
mock/irc_server.go7 symbols
cli/util.go7 symbols
server/websocket_requests.go6 symbols

Dependencies from manifests, versioned

git.wow.st/gmp/jniv0.0.0-2021061001170 · 1×
github.com/andybalholm/brotliv1.0.4 · 1×
github.com/dsnet/compressv0.0.2-0.20210315054 · 1×
github.com/golang/snappyv0.0.4 · 1×
github.com/inconshreveable/mousetrapv1.0.1 · 1×
github.com/inkeliz/gowebviewv1.0.1 · 1×
github.com/inkeliz/w32v1.0.2 · 1×

For agents

$ claude mcp add openbooks \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact