Skip to content

Project Architecture

github-actions[bot] edited this page Nov 30, 2026 · 1 revision

API Architecture

Nebula API provides UTD data for others to use, including information on courses, professors, events, and more.

API Overview

Here's a quick look at Nebula API.

REST API

The Nebula API is a RESTful API. What's an API? What does RESTful mean?

Currently, the Nebula API offers data for the following through its endpoints:

  • Courses
  • Professors
  • Sections
  • Grades
  • Comet Calendar Events
  • Mazevo Events
  • Astra Events
  • Club Events - provided by UTD Clubs
  • Rooms
  • Discounts

Docs for each of these endpoints can be found on Our REST API Swagger page, which is generated from comments in the code.

Note

Nebula API powers only UTD Trends and UTD Rooms. UTD Clubs and Notebook have their own API internal to their own projects. In addition, the Clubs endpoints are powered by the internal Clubs database.

All of this information (except for the clubs endpoints) is gathered with API tools, which is responsible for scraping, parsing, and uploading the data to a Mongo database.

How does Nebula REST API work?

When a user sends a HTTP request, Gin handles the request by matching the URL request to one of our routes. For example, if a user sends a GET request to https://api.utdnebula.com/course, that request goes to the course route, found in rest/routes/courses.go.

Then, Gin passes the request's arguments to the appropriate controller (in rest/controllers). These arguments are used for filtering and limiting data, so the user gets exactly what they want.

The controller uses those arguments with Mongo's Go Driver to construct a query filter and execute it against the Mongo database. This process gets the user the exact data they requested.

The Mongo database then fetches the requested data with filters and returns the data back to the controller. The controller sends the data back to Gin. The controller can also provides Gin an HTTP status code indicating the requests outcome (such as if it was successful).

Gin creates a HTTP response with the data and HTTP status code.

Finally, Gin sends the HTTP response back to the user.

API Diagram

flowchart LR
    A[User] --HTTP Request--> B
    B[Gin] --*gin.Context--> C
    C[Controllers] --"Constructed 
    Query Filter"--> D
    D[("Mongo 
    Database")]
    D --Requested Data--> C
    C --"Data and 
    Status Code"--> B
    B --HTTP Response--> A
Loading

API Documentation

We currently use Swagger for our API documentation. Swagger automatically generates documentation for our API routes from comments in the code.

If you make any changes, make sure to run either the Makefile or build.bat to update the documentation.

Languages and Core Technologies

Golang

Tour of Go - Start here if you're new to Golang. Effective Go - Guide for writing clear Golang code. Go Documentation - For more technical details about Golang.

The main language we use for Nebula API and the API tools.

MongoDB

Go Mongo Driver Documentation - For using MongoDB with Golang.

Nebula API stores the majority of its data in a MongoDB database. We interact with the Mongo database with the Mongo Go driver.

Libraries

Gin

Documentation - For more information regarding Gin.

Gin is a HTTP web framework for Golang that allows to build the Nebula API.

Swagger

Our API Docs - Generated by Swagger.

Documentation - For more information regarding Swagger.

Swagger is responsible for auto-generating our documentation for our API endpoints.

Sentry

Documentation - Sentry for Golang.

Sentry provides performance and error monitoring to help us find and fix problems.

Google Cloud

Documentation - Google Cloud Services for Golang.

We use Google Cloud for our email and storage endpoints.

Next Step

See Project-Structure.md

Clone this wiki locally