Home

Awesome

<p align="center"> <a href="" rel="noopener"> <img width=200px height=200px src="../assets/logos/logo.png?raw=true" alt="Project logo"></a> </p> <h3 align="center">audnexus</h3> <div align="center">

Status GitHub Issues GitHub Pull Requests License CodeFactor Grade Quality Gate Status

</div>
<p align="center"> An audiobook data aggregation API, combining multiple sources of data into one, consistent source. <br> </p>

📝 Table of Contents

🧐 About <a name = "about"></a>

Nexus - noun: a connection or series of connections linking two or more things.

Looking around for audiobook metadata, we realized there's no solid (or open) single source of truth. Further, some solutions had community curated data, only to close their API. As such, this project has been created to enable development to include multiple sources of audiobook content in one response.

This project also makes integration into existing media servers very streamlined. Since all data can be returned with 1-2 API calls, there's little to no overhead processing on the client side. This enables rapid development of stable client plugins. Audnexus serves as a provider during the interim of waiting for a community driven audiobook database, at which time audnexus will be a seeder for such a database.

🏁 Getting Started <a name = "getting_started"></a>

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Installing locally

Test an API call with

http://localhost:3000/books/${ASIN}

🔧 Running the tests <a name = "tests"></a>

Tests for this project use the Jest framework. Tests can be done locally in a dev environment:

After the tests have run, you may also browse the test coverage. This is generated in coverage/lcov-report/index.html under the project directory.

🎈 Usage <a name="usage"></a>

API usage documentation can be read here: https://audnex.us/

Pre-rendered HTML documentation is also included in docs/index.html.

HTML can be re-generated from the spec, using:

pnpm run build-docs

🚀 Deployment <a name = "deployment"></a>

Once you have Docker Swarm setup, grab the docker-compose.yml from this repo, and use it to start the stack. Using something like Portainer for a Swarm GUI will make this much easier.

The stack defaults to 15 replicas for the node-server container. Customize this as needed.

Environment variables to add:

Once the stack is up, test an API call with

https://${TRAEFIK_DOMAIN}/books/${ASIN}

Set up DB indexes to keep item lookups fast and to support searches.

  1. Connect to the DB either from inside the mongodb container terminal or a MongoDB Compass/MongoSH session.

  2. Switch to the correct DB:

    use audnexus
    
  3. Create the recommended indexes:

    db.authors.createIndex( { asin: 1, region: 1 } )
    
    db.books.createIndex( { asin: 1, region: 1 } )
    
    db.chapters.createIndex( { asin: 1, region: 1 } )
    
    db.authors.createIndex( { name: "text" } )
    

⛏️ Built Using <a name = "built_using"></a>

✍️ Authors <a name = "authors"></a>

🎉 Acknowledgements <a name = "acknowledgement"></a>