Skip to content

FuelLabs/forum-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Forum Handler

This project uses Vercel serverless functions and is written in TypeScript. The project includes handlers for processing "post" and "topic" events.

Requirements

  • Node.js (v18 or later recommended)
  • npm (v6 or later recommended)
  • Vercel CLI (v32 or later recommended)
  • ngrok (v3 recommended)

Setup

  1. Clone the repository:

    git clone git@github.com:FuelLabs/forum-notifier.git
    
  2. Navigate into the project directory:

    cd forum-notifier
    
  3. Install the dependencies:

    npm install
    

Local Development

To start the local development server, run:

vercel dev

This starts the server on localhost:3000.

To expose your local server to the internet for testing with external services, use ngrok. First, install ngrok globally:

npm install -g ngrok

Then, in a separate terminal window, run:

ngrok http 3000

ngrok will provide a URL that you can use to access your local server from the internet.

To test your serverless functions, you can make POST requests to http://localhost:3000/api/handler (or the corresponding ngrok URL). The functions expect the x-discourse-event-type header to be set to either 'post' or 'topic'.

Deployment

To deploy your project to Vercel, run:

vercel

This command builds and deploys your project, and provides a live URL where you can access it.

Signature

Set the FORUM_SECRET env var to be the same as the discourse webhook secret.

Contributing

If you wish to contribute to this project, please first create an issue to discuss the change you wish to make before making a change.

To do

  • Basic function boilerplate
  • Test scripts
  • Notion Api
  • Handle Event Create ticket
  • Handle Event Update ticket
  • Handle Event New Comment
  • Handle Event Closed
  • Handle Event reOpen
  • Handle Event Admin Commented
  • TicketEvent logger
  • Standard http response object
  • Error codes and msgs constants
  • Data analytics for TicketEvent logs
  • Data analytics dashboard
  • Handle comments for old topics

About

This project uses Vercel serverless functions to handle Discourse web hooks to create tickets in a Notion database.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors