The backend of a web reminder system for an online school.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
ALI Hamza 9b681f5f5b
fix: update id for announcement channel:w
1 year ago
common all: clean up code and add roles struct. 2 years ago
db all: clean up code and add roles struct. 2 years ago
discord fix: update id for announcement channel:w 1 year ago
http all: clean up code and add roles struct. 2 years ago
.drone.yml docker: Import ASUBot Frontend 0.1.0 2 years ago
.gitignore update gitignore 2 years ago
Dockerfile docker: update frontend version 2 years ago
README.md http: add checks for incoming date validity. common: fix README typo 2 years ago
go.mod discord: Add reminder notifications and macros 2 years ago
go.sum discord: Add reminder notifications and macros 2 years ago
main.go all: clean up code and add roles struct. 2 years ago

README.md

ASUBot

Go Project for Discord bot + Web backend

Drone Build Status

Current list of HTTP API endpoints:

Note: URL parameters with ? at the end of them are optional. ? should not be included in the actual query.

Data Structures

  • Reminders
    • A data structure that holds a reminder that can be passed into HTTP API endpoints.
    • Fields:
      • id: The internal (in database) ID of the reminder (should be set to -1 if there is no associated database entry yet)
      • name: The name of the reminder as displayed to the user
      • desc: The description of the reminder
      • hour: The hour where the reminder should go off
      • min: The minute where the reminder should go off
      • repeat: A boolean that is true if this is a repeating reminder. false indicates that it is a one-shot that only notifies the user once.
      • days?: A list of boolean that denotes if the reminder should go off on a day in the week. Must be specified if repeat is true. (Order is Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday)
      • year: The year when the reminder goes off, or when a recurring reminder starts
      • month: The month of the year when the reminder of off, or when a recurring reminder starts
      • date: The day of the month when the reminder goes off, or when a recurring reminder starts
      • deleted?: A field that has the value true if the reminder is marked as deleted in the database. Used in /api/reminders/all with deleted=true to tell the client which reminders has been deleted. Reminders that are not deleted will not have this field.

Authentication

  • Logging In
    • URL: /api/login
    • Method: POST
    • URL Parameters: user, pass
    • Sample Data: user=sample&pass=sample
  • Logging Out
    • URL: /api/logout
    • Method: POST
    • URL Parameters: token
    • Sample Data: token=123456789012345678901234

Reminder Management

  • Get All Reminders
    • deleted denotes if deleted reminders should be returned. (Default does not include deleted reminders.)
    • URL: /api/reminders/all
    • Method: POST
    • URL Parameters: token, deleted?
    • Sample Data:
      • token=123456789012345678901234
      • token=123456789012345678901234&deleted=true
  • Create New Reminder
    • URL: /api/reminders/new
    • Method: POST
    • URL Parameters: token, reminder
    • Returns: The assigned ID of the resulting reminder.
    • Sample Data: token=123456789012345678901234&reminder=[URL-encoded JSON string containing a reminder object]
  • Edit Reminder
    • URL: /api/reminders/edit
    • Method: POST
    • URL Parameters: token, reminder
    • Returns: The ID of the reminder that was modified (inferred from reminder).
    • Sample Data: token=123456789012345678901234&reminder=[URL-encoded JSON string containing a reminder object]
  • Remove Reminder
    • URL: /api/reminders/remove
    • Method: POST
    • URL Parameters: token, id
    • Returns: The ID of the reminder that was removed (should be equal to id)
    • Sample Data: token=123456789012345678901234&id=5