Skip to content

roly151/libgen_mobile_app

 
 

Repository files navigation

LibGen Mobile


Looking for maintainers!

Due to my limited amount of time, I haven't been able to keep this project updated. The app and the server still are running and I plan it to keep like that, but currently, I'm not able to build more features. At least not at the required pace. So, contact me or simply fork and code. I'll remain aware and try to help with anything. Thanks.

F-Droid GitHub

This is a non-offical mobile client for Library Genesis service. It's an independent side project. And it's Open Source, so feel free to collaborate.

The app is built with Flutter and it's available in FDroid.

Currently, we're working mainly in Android version.

Versión en español

Features

  • Search books in SciTech or Fiction sections of Library Genesis, by title, author, series, publisher, ISBN or MD5
  • In SciTech, order results by relevance, title, year, pages or file size, and decide ordering criteria according to sorting option (newer firsts, smaller first, etc)
  • In Fiction, filter by file extension: Epub, Mobi, AZW, AZW3, FB2, PDF, RTF, and TXT; filter by a language among a large amount of options; and also, use the "Wildcard" option to search using each word as a wildcard
  • See detailed info about the books (depending on the metadata provided, some field may be not be present): cover image, title, author, description, table of contents, year, volume, series, edition, publisher, city, pages, language, ISBN, DOI, file size, and file extension
  • Show search history as suggestions
  • Switch between ligh and dark theme
  • Show info dialog
  • Available on multiple languages: German (DE), English (US), Spanish (ES), French (FR), Japanese (JP), Polish (PL), Portuguese (BR), and Chinese (CN, simplified)
  • And of course, download any book. Multiple download options are provided.

TODO

The following is a list of desired new features within the scope of the project. Notwithstanding, we're happy to hear new ideas and feeback.

  • Search books in other sections of LibGen (SciTech and Fiction already covered)
  • Allow for switching between languages, instead of only using the system's
  • Translate to other languages (see above the list of languages already covered)
  • UI improvements (smoother animations, colors, layout, fonts, etc)
  • Filter by file extension (already implement in Fiction, but it may require some extra work to do it in SciTech)

We recommend to submit first an issue to discuss ideas, instead of directly send a PR.

Environment

Flutter and Dart

  • Flutter: version 2.0.4 (channel stable)
  • Dart: version 2.12.2

Environment config

We're managing the different stages of the app (basically, development and production) throught compile time variables (check this article for information). The only environmental variable in use right now is LIBGEN_MOBILE_API. This allow us to pass a development and production API URL directly from CLI commands.

Also note that this app is using multiple flavors, therefore it has to be specifically referenced when running the app. Otherwise, you'll get the a "Gradle build failed to produce an .apk file" error.

To run the app with compile time variable plus the correct flavor, use the following command:

flutter run --dart-define=LIBGEN_API_URL=<VALUE> --flavor local

Finally, in VSCode, it could be useful define a launch.json file to debug. Such file would look like this:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "emulator",
            "request": "launch",
            "type": "dart",
            "args": [
                "--dart-define=LIBGEN_API_URL=http://10.0.2.2:3000",
                "--flavor",
                "local"
            ]
        },
    ]
}

Those flags also work with flutter build apk and others similar commands.

IMPORTANT

To use a phisical device to run the app, you'll need to pass the internal IP of the machine that's running the server as the value of LIBGEN_API_URL. "http://10.0.2.2:3000" will only provide access to emulators, as those are part of the same network.

Libgen API

Library Genesis doesn't provide a public API to work with, so we decided to build a backend service to consume. It's currently hosted in Heroku.

Check the repo to run your own instance and pass the corresponding URLs to the app throught compile time variables. It's an ExpressJS project; you just need to clone (or fork) the repo, install dependencies and run npm start.

During development, a forked version of this unofficial Libgen library has been used to get the data. This is the repo of our modified version.

Dependencies

The followings are all the official and third-party packages in use right now.

Internationalization

  • flutter_localizations:
    • sdk: flutter
  • intl: ^0.17.1

Additionally, for generating the needed boilerplate we used the VSCode plugin Flutter Intl. This way, is recommended using this plugin to automatically generate new code for new locales. Unfortunately, the offical docs seems to be outdated.

API requests

State management

Downloads

For downloading, we're using a fork of flutter_downloader package. Check pubspec.yaml for details.

Open download link in browser

Render HTML content

For rendering HTML, we're using a fork of simple_html_css package. Check pubspec.yaml for details.

Local storage

Code generation

Others

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 99.7%
  • Other 0.3%