Skip to main content

Structure

This document describes high-level code structure of the project. You'll find this part useful when you want to get started to contribute to Raccoon.

High level View

The core structure of Raccoon is the server itself. After the server is started, data flows from websocket to worker to publisher. websocket manages websocket server, handle incoming connection, and incoming request. worker acts as a buffer and interface for various types of server and publisher down the roadmap. publisher contains logic to publish the events to the downstream pipeline. high-level All the components above are initialized on app. app package is the starting point of Raccoon.

Code Map

This section talks briefly about the content of various important packages. You can use this to guess the code location when you need to make changes.

service

Contains all backend related code including code related to websocket, rest and grpc. It also has code pertaining to the http server that serves both WebSocket and REST APIs.

service/rest

Contains server-side code along with request/response handler for the REST endpoint.

service/rest/websocket

Contains server-related code along with request/response handlers and connection management.

service/gRPC

Contains server-side handlers for gRPC server.

worker

Buffer from when the events are processed and before events are published. This will also act as interface that connects server and publisher.

publisher

Does the actual publishing to the downstream message queue. Currently Supports:

  • Apache Kafka
  • Google Cloud Pub/Sub
  • Amazon Web Services Kinesis

app

The starting point of Raccoon. It initializes server, worker, publisher, and other components that require initialization like a metric reporter.

config

Load and store application configurations. Contains mapping of environment configuration with configuration on the code.

serialization

Contains the common serialization code for both JSON and protobuf along with common interface.

deserialization

Contains the common deserialization code along with common interface.

identification

Contains the code for connection identification.

Code Generation

Request, Response, and Events Proto

Raccoon depends on Proton repository. Proton is a repository to store all Raystack Protobuf files. Code to serde the request and response are generated using Protobuf. You can check how the code is generated on Makefile.