mirror of
https://github.com/bestnite/igdb-database.git
synced 2025-04-26 21:25:54 +08:00
IGDB Database Collector
A service that collects and stores video game data from IGDB (Internet Game Database) into MongoDB. It provides both bulk data collection and webhook-based real-time updates.
Features
- Bulk collection of IGDB data
- Real-time updates via webhooks
- MongoDB storage
- Support for all IGDB endpoints
Prerequisites
- Go 1.24.1 or higher
- MongoDB
- IGDB API credentials (Client ID and Secret from Twitch)
Configuration
Create a config.json
file in the root directory with the following structure:
{
"address": "localhost:8080",
"database": {
"host": "localhost",
"port": 27017,
"user": "username",
"password": "password",
"database": "igdb"
},
"twitch": {
"client_id": "your_client_id",
"client_secret": "your_client_secret"
},
"webhook_secret": "your_webhook_secret",
"extral_url": "https://your-webhook-url.com"
}
Installation
# Clone the repository
git clone https://github.com/yourusername/igdb-database.git
# Install dependencies
go mod download
Usage
Running the Service
go run main.go
The service will:
- Connect to MongoDB
- Initialize IGDB client
- Fetch initial data if collections are empty
- Start webhook server for real-time updates
Dependencies
- go-igdb - IGDB API client
- mongo-driver - MongoDB driver for Go
License
This project is licensed under the MIT License - see the LICENSE file for details.
Languages
Go
100%