Git Product home page Git Product logo

zeppelin-railway's Introduction

Deploy Zeppelin on Railway

Prerequisites

Link your Discord account to Railway from account settings [REQUIRED]

Run the /beta slash command in the Railway Discord Server

Setting up the Railway Project

Create a new project, provisioned with the MySQL Plugin Provision MySQL

Run Control/Command + K and select Metrofy

Fork this repo, we're gonna deploy it next

Creating the API Service

Select New Service and pick GitHub Repo, selecting your fork

Once the service has deployed (it may fail to build, that is ok), select it and go to Settings.

Rename the service if you would like and set the root directory to /api

OPTIONAL: FOR USERS WITH CUSTOM FORKS OF ZEPPELIN

Note: may not build, as patchfiles are based off of upstream

Create a variable name GIT_REPO and set it to the url to your custom fork of Zeppelin

 # Optional, for advanced users (replace with your custom fork)

 GIT_REPO=https://github.com/Dragory/ZeppelinBot.git

Create a variable named KEY and set it to 32 random characters

# Example (don't use this):

KEY=eilegiluegoigefiugsdzdiuggfweaiug

Create a variable named STAFF and set it to your Discord Snowflake

# Replace with your snowflake

STAFF=524722785302609941

Copy the following variables into the api service (tip: Bulk Import)

DB_PASSWORD=${{ MYSQLPASSWORD }}
DB_USER=${{ MYSQLUSER }}
DB_HOST=${{ MYSQLHOST }}
DB_PORT=${{ MYSQLPORT }}
DB_DATABASE=${{ MYSQLDATABASE }}
PROFILING=false
PORT=8800
OAUTH_CALLBACK_URL=https://${{ RAILWAY_STATIC_URL }}/auth/oauth-callback

These variables will require you to create a Discord Application

Go to the OAuth tab and copy these values

CLIENT_SECRET=<OAuth Client Secret>
CLIENT_ID=<OAuth Client ID>

Creating the Bot Service

Deploy your fork again by creating a new service, like you did for the api

Rename the service if you would like and set the root directory to /bot

Create the following variables

# Pick a root server to add the bot to

SERVER_NAME=<Server Name>
SERVER_ID=<Server Snowflake>
OWNER_ID=<Server Owners User Snowflake>

# General vars

ACCOUNT_ID=<Your User Snowflake (from api step)>
TOKEN=<Bot Token>

Initializing the Database

Clone your fork of this repo, make sure Node.js and Railway CLI are installed

Open a terminal and enter the init-db folder

Run npm ci to install deps

Run railway run node . to set up the database, Control + C once it stops logging (i'll fix it later ok)

Creating the Dashboard Service

Deploy your fork again by creating a new service, like you did for the bot

Rename the service if you would like and set the root directory to /dashboard

Create a variable named API_URL and set it to the url Railway generated for the api service

# Make sure there is no trailing slash

API_URL=https://example.up.railway.app

# Also add PORT

PORT=80

Connecting the Dashboard and API

Go back to the api service and add a variable named DASHBOARD_URL set to the generated url for the dashboard

# Make sure there is no trailing slash

DASHBOARD_URL=https://example.up.railway.app

Setting up OAuth Callbacks

Go your bot's Discord Application

Under OAuth, add a callback url set to:

$API_URL + '/auth/oauth-callback'

EXAMPLE:
API_URL=https://example.up.railway.app

CALLBACK=https://example.up.railway.app/auth/oauth-callback

zeppelin-railway's People

Contributors

nebulatgs avatar

Forkers

ecogit-stage

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.