Skip to content

aarc-xyz/service-open-auth-backend

Repository files navigation

Service Open Auth Backend

Discord Telegram

A backend service for OpenAuth, providing necessary APIs for user registration, login, authentication, and integration with blockchain protocols and other services.

Table of Contents

Overview

The Service Open Auth Backend is a crucial component of the OpenAuth ecosystem, handling server-side operations for authentication and blockchain interactions.

Installation

  1. Clone the repository:

    git clone https://github.com/aarc-xyz/service-open-auth-backend.git
    cd service-open-auth-backend
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    cp .env.example .env

    Edit the .env file with your specific configuration. See Environment Variables for details.

  4. Build the project:

    npm run build

Usage

Development

To start the development server with hot-reloading:

npm run start:dev

Production

To start the production server:

npm run start:prod

Project Structure

  • src/
    • modules/open-auth/: OpenAuth module (controllers, services, etc.)
    • abis/: ABI files for blockchain contract interactions
    • main.ts: Application entry point
  • test/: End-to-end tests

Environment Variables

Required Variables

Variable Description How to Obtain
DB_URL MongoDB connection string MongoDB Atlas
LOGGER_ENV Logging flag Set manually
OPENAUTH_SERVICE_PORT Service port Set manually
PLATFORM_CUSTOM_AUTH_SALT Custom auth salt Generate securely
STYTCH_PROJECT_ID Stytch project ID Stytch Dashboard
STYTCH_SECRET Stytch secret key Stytch Dashboard
LIT_API_KEY Lit Protocol API key Lit Protocol Dashboard
LIT_CHRONICLE_YELLOWSTONE_RPC Lit Protocol RPC URL Lit Documentation
LIT_CONTROLLER_PRIVATE_KEY Lit Protocol private key Generate securely
LIT_CREDITS_TOKENID Lit Protocol token ID Lit Documentation
TWILIO_ACCOUNT_SID Twilio account SID Twilio Console
TWILIO_ACCOUNT_SECRET_AUTH_TOKEN Twilio auth token Twilio Console
TWILIO_SERVICE_ID Twilio service ID Twilio Console
X_OAUTH_CALLBACK OAuth callback URL Set manually
X_OAUTH_CONSUMER_KEY Twitter OAuth consumer key Twitter Developer Portal
X_OAUTH_CONSUMER_SECRET Twitter OAuth consumer secret Twitter Developer Portal
PLATFORM_AUTH_VALIDATION_URL Auth validation URL Set manually
TELEGRAM_BOT_TOKEN Telegram bot token BotFather on Telegram

Blockchain RPC URLs

Obtain free RPC URLs from providers like Ankr. Required for various blockchain networks:

  • ETH_MAINNET_RPC_URL
  • ETH_GOERLI_RPC_URL
  • ETH_SEPOLIA_RPC_URL
  • POLYGON_MAINNET_RPC_URL
  • POLYGON_AMOY_RPC_URL
  • POLYGON_ZKEVM_MAINNET_RPC_URL
  • ARBITRUM_RPC_URL
  • ARBITRUM_SEPOLIA_RPC_URL
  • ARBITRUM_GOERLI_RPC_URL
  • OPTIMISM_MAINNET_RPC_URL
  • BASE_MAINNET_RPC_URL
  • BASE_TESTNET_RPC_URL
  • BSC_MAINNET_RPC_URL
  • BSC_TESTNET_RPC_URL
  • AVALANCHE_MAINNET_RPC_URL
  • AVALANCHE_FUJI_RPC_URL
  • LINEA_MAINNET_RPC_URL
  • LINEA_TESTNET_RPC_URL

Contributing

We welcome contributions! Please read our Contributing Guide for details on how you can help improve the Service Open Auth Backend.

For more detailed information or support, please reach out through our Discord or Telegram channels.

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for more details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages