Lumipat sa pangunahing nilalaman

API

Ang ChurchApps API ay isang modular monolith -- isang single codebase na nagsisilbi sa anim na natatanging module, bawat isa ay may sariling database. Ang architektura na ito ay nagbibigay sa iyo ng mga benepisyo ng organisasyon ng microservices (malinaw na hangganan, independyente na mga data store) na may operational simplicity ng isang deployment.

Mga Module

ModuleLayunin
MembershipMga tao, grupo, pamilya, mga pahintulot
AttendanceMga serbisyo, sesyon, mga record ng check-in
ContentMga pahina, seksyon, elemento, streaming
GivingMga donasyon, pundo, pagpoproseso ng bayad
MessagingMga pag-usap, notification, email
DoingMga gawain, mga plano, mga assignment

Tech Stack

  • Runtime: Node.js 22.x na may TypeScript (ES modules)
  • Framework: Express
  • Dependency Injection: Inversify (decorator-based routing)
  • Database: MySQL -- isang database bawat module, bawat isa ay may sariling connection pool
  • Auth: JWT-based authentication via CustomAuthProvider
  • Deployment: AWS Lambda via Serverless Framework v3

Mga Port

ProtocolPortPaglalarawan
HTTP8084Main REST API
WebSocket8087Real-time socket connections

Lambda Functions

Kapag na-deploy sa AWS, ang API ay tumatakbo bilang apat na Lambda functions:

  • web -- Humahawak ng lahat ng HTTP requests
  • socket -- Namamahal sa WebSocket connections
  • timer15Min -- Tumatakbo bawat 15 minuto para sa email notifications
  • timerMidnight -- Tumatakbo araw-araw para sa digest emails at maintenance tasks

Mga Shared Libraries

Ang API ay umaasa sa dalawang shared ChurchApps packages:

Impormasyon

Ang API ay gumagamit ng ES modules ("type": "module" sa package.json). Siguraduhin na ang iyong imports ay gumagamit ng ES module syntax.

Sa Seksyong Ito

  • Local Setup -- Clone, configure, at patakbuhin ang API locally
  • Database -- Database-per-module architecture, schema scripts, at data access patterns
  • Module Structure -- Controllers, repositories, models, at authentication
  • API Keys -- Personal access tokens para sa scripts at connectors
  • Connected Apps (OAuth) -- Multi-tenant OAuth flow para sa third-party apps
  • Webhooks -- Itulak ang event notifications sa external systems
  • MCP Server -- Model Context Protocol endpoint na naglalantad ng API sa AI assistants
  • Endpoint Reference -- Kumpleto REST API documentation para sa lahat ng module