Skip to content

Architecture Overview

The API repository is the backend service for Agora Tutoring. It exposes a GraphQL endpoint, processes business logic, connects to storage/services, and serves webhook endpoints.

Users / Frontend (Next.js)
|
v
GraphQL API (Express + Apollo)
|
+--> MongoDB (core app data)
+--> Redis (pub/sub, real-time support)
+--> Firebase (auth-related services)
+--> Stripe (billing webhooks)
+--> SendGrid / Email services
+--> Jira webhook integration
  • index.js: starts the service, initializes database, binds to configured port.
  • src/server.js: creates HTTP server, GraphQL endpoint, WebSocket subscriptions, and webhook routes.
  • src/api/: GraphQL schema, modules, resolvers, directives, scalars, and loaders.
  • src/database/: models, validators, plugins, and DB startup logic.
  • src/helpers/ + src/utilities/: reusable helper and utility logic.
  • src/webhooks/: inbound handlers for external systems.
  • Domain modules keep GraphQL features grouped by business area.
  • Loaders reduce repeated DB reads and improve resolver performance.
  • Plugins centralize model-side behavior (e.g., related updates, hooks).
  • Separate webhook handlers keep third-party logic isolated from core API paths.