https://github.com/jd-apprentice/libritos
📚 Libritos: Your Personal Reading Assistant with a User-Friendly Interface
https://github.com/jd-apprentice/libritos
Last synced: 7 months ago
JSON representation
📚 Libritos: Your Personal Reading Assistant with a User-Friendly Interface
- Host: GitHub
- URL: https://github.com/jd-apprentice/libritos
- Owner: jd-apprentice
- License: gpl-3.0
- Created: 2023-10-16T02:51:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-27T01:51:13.000Z (over 1 year ago)
- Last Synced: 2025-06-04T16:19:01.166Z (8 months ago)
- Language: Go
- Homepage:
- Size: 7.37 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 📚 Libritos
# Table of Contents 📚
- [About 📔](#about-)
- [Deployment 🚀](#Deployment-)
- [Requirements 📋](#requirements-)
- [Create a cloudflare account and add your domain.](#create-a-cloudflare-account-and-add-your-domain)
- [Migration](#migration)
- [Create a discord bot and add it to your server](#create-a-discord-bot-and-add-it-to-your-server)
- [Usage](#usage)
- [Discord Bot 🤖](#discord-bot-)
- [Web Application 🌐](#web-application-)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)
# About 📔
Libritos is a simple web application that allows you to search for books that you previously added from a discord bot.
The discord bot is set at a specific channel and it will listen to files such as pdf, epub, mobi, etc. and it will upload them to a server. The server will then process the file and add it to the database. The web application will then allow you to search for the book and download it.
# Deployment 🚀
## Requirements 📋
- Go >1.23 [Link](https://golang.org)
- Bun >1.1.28 [Link](https://bun.sh)
- Cloudflare [Link](https://cloudflare.com)
- Github [Link](https://github.com)
- Discord [Link](https://discord.com/developers/applications)
### Create a cloudflare account and add your domain.
The domain should point to the render deployment something like this

So in my case the website will be available at `https://libritos.jonathan.com.ar`
### Migration
In the root of the project run the following command
```bash
make migration
```
### Create a render account and add the repository
Create a `web service` and add my repository which is `https://github.com/jd-apprentice/libritos`


Base configuration would be something like this

Now for advance configuration is where we add our environment variables

Also remember to add the /health endpoint to the health check
Here is a table with the environment variables
| Name | Value | Example |
| ---- | ----- | ------- |
| DISCORD_TOKEN | Discord bot token from the developer portal | 123456789 |
| DISCORD_CHANNEL_ID | Discord channel id where the bot is allowed to receive files | 123456789 |
| ALLOWED_FORMATS | Allowed formats for the bot to upload | "application/pdf, application/epub+zip, application/x-mobipocket-ebook"
| BOOKS_TABLE | Name of the table where the books are going to be stored | books |
### Create a discord bot and add it to your server
In the discord developer portal create a bot

Under the `Bot` section we are going to retrieve the token

Bot is going to need the following permissions in the `OAuth2` section
- Read Messages/View Channels
- Send Messages
- Read Message History
- Use Slash Commands
Then in the `Bot` section make sure message intents are enabled like this

# Usage 📖
## Discord Bot 🤖
How to use the discord bot:
send a message with the following format
```
image:
description:
```
and a file attached to the message
`files must be smaller than 20MB`

if everything was okay you will see the `file saved` message

else you will see the proper validation that is stopping the file from being uploaded
## Web Application 🌐
Once the file is uploaded to the server you can see it in the web application

# Contributing 🤝
Contributions, issues and feature requests are welcome!
# License 📝
This project is [GPL-3.0](LICENSE) licensed.
# Contact 📧
Social media links and email address available at my [linktr.ee](https://linktr.ee/jd_apprentice)