TEAMMATES is a web application with the following main components:
The following additional components are used for testing:
TestNG (Java) and Jest (TypeScript).Selenium to interact with the application via a web browser.The diagram below shows how each component is organised into packages and the dependencies between them.
The UI component is the entry point for all requests received by the application. Incoming requests pass through custom filters (e.g. OriginCheckFilter) before being forwarded to the appropriate *Servlet for processing.
The frontend (ui::website) is not a Java package — it is an Angular application consisting of HTML, SCSS, and TypeScript files, built into standard HTML, CSS, and JavaScript for the browser.
The initial page request is handled as follows:
WebPageServlet returns the built single web page (index.html).Subsequent HTTP requests are handled as follows:
WebApiServlet uses ActionFactory to generate the matching Action object, e.g. GetFeedbackSessionsAction.Action object checks the user's access rights, performs the action, and packages the result into an ActionResult object.WebApiServlet returns the result to the browser.Static asset files (CSS, JS, images) are served directly.
The Web API is protected by two layers of access control:
We use the Template Method pattern to abstract the process flow into the Action classes.
Access control: The UI is expected to check access control using the GateKeeper class.
Transaction management: A Hibernate session and transaction is opened per request.
Request validation: Request parameters are validated at this layer.
The Logic component handles the business logic of TEAMMATES, including validating business constraints, sanitizing input from the UI, and integrating with third-party services such as email providers.
Package overview:
logic.api: Provides the API of the component to be accessed by the UI.logic.core: Contains the core logic of the system.logic.external: Holds the logic of external services integration.The Logic API is represented by the following classes:
Logic: A Facade connecting to the various *Logic classes to handle business logic and access the Storage component.UserProvision: Retrieves user information from request cookies.AuthProxy: Provides authentication-related services.EmailGenerator: Generates emails to be sent.EmailSender: Sends emails using the provider configured in the build configuration.TaskQueuer: Queues tasks for deferred execution.LogsProcessor: Handles advanced logging beyond the standard logger.RecaptchaVerifier: Verifies reCAPTCHA tokens.Many classes in this layer use environment-based implementations — connecting to real production services in staging/production and local alternatives in development.
API for creating entities:
InvalidParametersException.EntityAlreadyExistsException (escalated from Storage level).API for retrieving entities:
null, allowing read operations to double as existence checks.API for updating entities:
EntityDoesNotExistException.InvalidParametersException.API for deleting entities:
The Storage component performs CRUD operations on data entities. It contains minimal logic beyond what is directly relevant to persistence. Cascade operations are handled at the database level.
It is responsible for:
Logic component.Package overview:
storage.api: Provides the API accessed by the Logic component.storage.entity: Persistable entity classes.Represented by the *Db classes. These classes act as the bridge to the database.
API for creating: Duplicate entities will result in a Hibernate constraint violation exception.
API for retrieving: Returns null if the entity does not exist.
API for updating: Missing or invalid entities will result in a Hibernate exception.
API for deleting: Delete operations are passed directly to the database. Existence checks and silent delete behaviour are handled by the Logic component.
The Common component contains common utilities used across TEAMMATES.
Package overview:
common.util: Contains utility classes.common.exceptions: Contains custom exceptions.common.datatransfer: Contains data transfer objects.