events

command module
v0.0.0-...-8d27ea7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

README

Events

A tool to help you plan and manage a Zeus WPI event!

Features

The app automatically fetches all event and board data by listening to a GitHub webhook installed in the Zeus website repository. As a fallback, it periodically refetches the data.

Organizers

You can assign organizers to each event. Organizers are grouped by academic year and an organizer corresponds to a board member for that academic year.

Checks

Each event includes checks to track the progress of its organization. There are two types of checks: manual and automatic.

Manual Checks

Manual checks must be manually added and marked as done for each event.

Automatic Checks

Automatic checks are updated automatically. Currently, they include:

  • Is it added to the DSA website?
  • Is there an announcement written?
  • Has the event been covered in a mail?
  • Are there any posters for the event?
Announcements

You can write announcements for each event and schedule them to be send at a later date.

Mails

Similar to announcements, you can write and schedule emails. For each mail you can select with events are covered.

Posters

Each event can have 2 posters

  • Big -> Poster meant to print out and hang up to advertise for the event
  • Scc -> Poster displayed on cammie chat screen

The posters are automatically synced with the visueel repository in Gitmate.

If a poster is not yet in the visueel repository then a pull request will be created to add it after the event is finished. If the visueel repository has a poster and events has none or a different one then the events poster will be deleted and replaced by the one in the visueel repository.

More information can be found in the visueel repository

Powerpoints

You can generate a PowerPoint covering one or more events. If available it includes event posters and generates QR codes to the event's webpage.

Public API

There's a public API to get some basic events data. Click here to go to the swagger.


Development

In development, no roles or permissions are required to access the application. However, only board members will be visible as organizers.

Some modules require external API keys. The will fail to launch without them and by result the application will fail to start You can find each API key in the example env file. If you don't have an API key you should remove the startup of the relevant module inside the main file.

A more in depth explanation of this application can be found in the internal README.md.

Quickstart
  1. Install all tools listed in the asdf tool versions file.
    If using asdf, run asdf install.

  2. Install make.

  3. Run make setup to install:

    • Backend tools: Goose, Sqlc
    • Frontend dependencies
  4. Install Git hooks for code quality:

    git config --local core.hooksPath .githooks/
    
  1. Copy the example environment file

    cp .env.example .env
    

    Update values as needed.

  2. (Optional) Configure the development config file if you're not using the makefile.

  3. Migrate the database:

    make migrate
    
  4. Start the project

    make watch
    
Full Explanation
  • Backend: Golang
  • Frontend: React + Typescript

Workflows are used to ensure code quality. You can run them manually before each commit by installing the githooks

git config --local core.hooksPath

They rely on [golangci-lint], which is included in the asdf tool versions file.

A Makefile is used to simplify most tasks.

make setup

Installs:

  • goose manages the migrations
  • sqlc generates statically typed golang code from SQL queries
  • Frontend dependencies (manually: cd ui $$ pnpm install)

make migrate

Starts a postgres container and applies the migrations. If you want to use your own database you can run the migrations with

go run migrate.go

This uses the connection values specified in your config.

make watch

Starts the full Docker stack with hot module reloading (HMR) for both backend and frontend. It follows logs for the backend and frontend by default.

To view logs from other services (like the database):

docker compose up backend frontend db

[!NOTE] A restart is required after adding or removing dependencies

Useful make targets

Adding a migration

  1. Run make create-migration

[!NOTE] Nix users using devshell need to run goose -dir ./db/migrations postgres create my_migration_name sql

  1. Edit the newly made migration that can be found in the db/migrations folder
  2. Update the queries in the db/queries accordingly
  3. Run make query to generate the new table structs

Adding a new typed query (Sqlc)

  1. Add your new query to db/queries/{target}.sql

  2. Run

    make query
    

Check for dead code

  1. Run make dead

Generate swagger docs

This will also format the swagger comments

  1. Run make swagger
Running without docker

[!NOTE] Docker is strongly recommended for development

  1. Install Air for HMR

    go install github.com/air-verse/air@latest
    
  2. Update your config files as needed

  3. Start backend:

    air .
    
  4. Start frontend

    cd ui && pnpm run dev
    

Production

It is recommended to run the application using Docker.

Requirements

  • Postgres
  • Minio

[!NOTE] Set the environment to production and populate the production config file

This repository automatically builds and publishes a docker container. The container will run the migrations before starting the webserver.

Documentation

Overview

Package main runs all pending migrations

Directories

Path Synopsis
cmd
api command
Entrypoint for the events application
Entrypoint for the events application
docs
v1
Package v1 Code generated by swaggo/swag.
Package v1 Code generated by swaggo/swag.
internal
announcement
Package announcement sends announcements to mattermost
Package announcement sends announcements to mattermost
check
Package check provides an interface to register event checks
Package check provides an interface to register event checks
db/model
Package model contains all internal representations of various database related objects
Package model contains all internal representations of various database related objects
db/repository
Package repository provides all repositories
Package repository provides all repositories
dsa
Package dsa controls the syncronization between DSA and events
Package dsa controls the syncronization between DSA and events
mail
Package mail stands in for sending mails to Zeus WPI users
Package mail stands in for sending mails to Zeus WPI users
server/api
Package api contains all api routes
Package api contains all api routes
server/api/v1
Package v1 contains the first version of the public API
Package v1 contains the first version of the public API
server/dto
Package dto contains all data transferable objects
Package dto contains all data transferable objects
server/service
Package service provides all business logic required by the api and converts between dto and models
Package service provides all business logic required by the api and converts between dto and models
task
Package task provides an interface to schedule background delayed tasks
Package task provides an interface to schedule background delayed tasks
website
Package website scrapes the Zeus WPI website to get all event data
Package website scrapes the Zeus WPI website to get all event data
pkg
config
Package config provides all configuration related functions
Package config provides all configuration related functions
db
Package db provides logic to connect to a database
Package db provides logic to connect to a database
github
Package github interacts with the github API
Package github interacts with the github API
gitmate
Package gitmate interacts with the visueel gitmate repository
Package gitmate interacts with the visueel gitmate repository
image
Package image provides various image related functions
Package image provides various image related functions
logger
Package logger provides a logger instance
Package logger provides a logger instance
mattermost
Package mattermost interacts with a mattermost instance
Package mattermost interacts with a mattermost instance
utils
Package utils provides some general purpose functions
Package utils provides some general purpose functions
zauth
Package zauth interacts with the Zeus zauth service
Package zauth interacts with the Zeus zauth service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL