Giter VIP home page Giter VIP logo

guardian's Introduction

Guardian

build status lint status format status

GitHub GitHub issues GitHub contributors GitHub last commit

Getting Started

To start up a local Guardian server, you'll first need to clone and set up dependencies:

$ git clone https://github.com/hackclub/guardian.git
$ cd guardian && yarn

Environment setup

You'll need access to two Airtables (one is optional): one for the Links feature, and one for the CoC Reporting table.

signing_secret="secretwooowowoowobooimaghost"
token="xoxb-numbernumbernumber"
channel="channel to post CoC reports to"
links="channel to post & receive links to shorten"
link_db_key="airtable API key for links table"
link_db="airtable db id for links"

conduct_db_key="airtable API key for the CoC reports table"
conduct_db="airtable db id for CoC reports table"

url="whatever url you're hosting Guardian on (ngrok url locally)"

Commands

There's a number of useful scripts you can use for development:

  • yarn lint & yarn lint:check — runs ESLint (the suffix :check does not run actual formatting)
  • yarn format & yarn format:check — runs Prettier (the suffix :check does not run actual formatting)
  • yarn check & yarn check:fix — runs both linting & formatting

Project Structure

Guardian is laid out using a very simple module system. All bot features are stored in src/features, and each file exports a function with type signature:

// src/features/botFeature.ts
import { App, ExpressReceiver } from 'bolt'

const botFeature: (app: App, receiver?: ExpressReceiver): void
export default botFeature

To add a new feature, create a new file in src/features and add an export to src/features/index.ts. For the example above, you might add something like:

// src/features/index.ts
export const { default as botFeature } from './botFeature.ts`

to src/features/index.ts

guardian's People

Contributors

rishiosaur avatar cjdenio avatar

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.