Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.

Magic-Riddle-Technology/riddle-hack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rutter Hack

This tool helps us deliver quick solutions to merchants without an infrastructure overhead. We can import data from Rutter API into MongoDB, supporting transactions, orders, and payouts.

Prerequisites

  1. Install Bun runtime environment

    curl -fsSL https://bun.sh/install | bash

Setup

  1. Clone the repository

  2. Install dependencies:

    bun install
  3. Create a .env file based on .env.example:

    cp .env.example .env
  4. Configure your environment variables in .env with your specific values:

    • MONGODB_URI: Your MongoDB connection string
    • TRANSACTIONS_RUTTER_ACCESS_TOKEN: Access token for transactions (get from rutter)
    • ORDERS_RUTTER_ACCESS_TOKEN: Access token for orders (get from rutter)
    • PAYOUTS_RUTTER_ACCESS_TOKEN: Access token for payouts (get from rutter)
    • RUTTER_CLIENT_ID: Rutter API Client ID (get from rutter)
    • RUTTER_CLIENT_SECRET: Rutter API Client Secret (get from rutter)
    • RUTTER_API_VERSION: Rutter API version (get from rutter)

Usage

  1. Open src/import/index.ts

  2. Comment/uncomment the import functions you want to run:

    importTransactions().catch(console.error);
    //importOrders().catch(console.error);
    //importPayouts().catch(console.error);
  3. Run the import:

    bun run import

Creating New Scripts

When creating new files that interact with the database, remember to:

  1. Import the database initialization at the top of your file:

    import { initializeDB } from "../db";
  2. Initialize the database connection before performing operations:

    await initializeDB();

Environment Variables

See .env.example for all required environment variables. Make sure to set all required variables before running the application.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •