RedSkiesReaperr / notion-igdb-autocomplete

Fill video games informations in your Notion database (using IGDB)
11 stars 0 forks source link
igdb notion notion-automation notion-integration notion-template

Notion IGDB autocomplete CircleCI reddit thread Notion template DockerHub

This Go project aims to automate the completion of video game information in a Notion database. It simplifies the task of collecting and updating details of video games, including titles, franchises, genres, platforms, and release dates, by connecting to the Notion database.

demo

Key Features

Table of Contents

  1. Prerequisites
  2. Installation
  3. Configuration
  4. Running the Project
  5. Dependencies
  6. Contributing
  7. License

Prerequisites

Installation

This section is mandatory only if you want to download the source & run the code on your local machine. Either, you can directly go to the [Configuration section]()

To get started, you need to install Go, download the source code and install all the dependencies it needs to work properly.

Clone the Repository

$ git  clone  https://github.com/RedSkiesReaperr/notion-igdb-autocomplete
$ cd  notion-igdb-autocomplete

Install Dependencies

$ go mod download

Configuration

This section will help you to get all the mandatory variables from third party apps and create the base application configuration.

1. Create environment configuration file:

Create a .env file to save your configuration informations:

$ cp ./.env.example .env

2. Create a Notion database

If you start from scratch: Duplicate the Notion template and go to step 2

If you already have a Notion database: Continue to step 1

  1. Create a Notion database (or configure an already existing one) with the following properties:

    • Title: (type: Title)
    • Platforms: (type: Multi-select)
    • Genres: (type: Multi-select)
    • Franchises: (type: Multi-select)
    • Release date: (type: Date)
    • Time to complete (Main Story): (type: Text)
    • Time to complete (Main + Sides): (type: Text)
    • Time to complete (Completionist): (type: Text)
  2. Create a private Notion integration on your account by following the getting started page before the "Setting up the demo locally" step.

  3. Put your integration API secret as value of the NOTION_API_SECRET in your .env file.

  4. Go on your Notion databse, click on the "..." button and on the "copy link" option. As mentionned in environment variables section, Get the ID of your database and put it as value of the NOTION_PAGE_ID in your .env file.

At this point you should have a Notion database, with all mandatory properties. You should have created a private Notion integration connected with you database. You should have a .env file in your cloned project directory who have two values filled: NOTION_API_SECRET and NOTION_PAGE_ID

  1. Create a Twitch Developer application (needed to use IGDB API) by following the "Account Creation" of getting started page. This will give you steps to get your IGDB_CLIENT_ID & IGDB_SECRET. Afterward fill IGDB_CLIENT_ID & IGDB_SECRET in your .env file. If you need more detailed explanations, follow the 'More details about IGDB configuration' section below.

🎉 Congrats, configuration done! 🎉

More details about IGDB configuration

Once you are on the Twitch developers portal:

  1. On the left menu go in the "Applications" section
  2. Then click on the "Register your application" purple button
  3. In the registration form:
  4. Name field: you fill whatever you want.
  5. Second field (about OAuth things): http://localhost.
  6. Click on create button
  7. Once created it takes you to the applications listing, then click on "Manage" button for your newly created app.
  8. Under the captcha, you have a field "client identifier" (or something like that). This value is your IGDB_CLIENT_ID
  9. Click on the "New secret" button. It gives you the IGDB_SECRET

Running the Project

Running on Local Machine

  1. Compile the project:
    $ make build
  2. Run the generated binary:
    $ ./bin/app

By running the app this way you will get into a nicer and clearer TUI (text-based user interface) than the more conventional way to run. You can navigate through it by using your keyboard. It will also help you to have a better understanding of whats going on. Here is a sneak peak of this TUI: tui-demo

Running with Docker

  1. Pull the docker image:
    $ docker pull redskiesreaperr/notion-igdb-autocomplete:latest
  2. Create and run the container, send the config values as environment variables to the container:
    $ docker run \
    -e NOTION_PAGE_ID=your_notion_page_id \
    -e IGDB_CLIENT_ID=your_igdb_client_id \
    -e IGDB_SECRET=your_igdb_secret \
    -e NOTION_API_SECRET=your_notion_api_secret \
    -e REFRESH_DELAY=5 \
    redskiesreaperr/notion-igdb-autocomplete:latest

Build a release image

$ docker build \
    --platform linux/386,linux/amd64,linux/arm,linux/arm64 \
    -t image:tag \
    .

Dependencies

Thanks to all the authors who created and maintains the following packages:

Contributing

If you wish to contribute to this project, please follow these steps:

  1. Fork this repository.
  2. Create a branch for your feature: git checkout -b feature/feature-name
  3. Commit your changes: git commit -m 'Added a new feature'
  4. Push your branch: git push origin feature/feature-name
  5. Open a Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details. Feel free to open issues or submit feature requests if you have ideas to enhance this project.