Lumipat sa pangunahing nilalaman

API

Ang ChurchApps API ay isang modular monolith -- isang code base na nagsisilbi sa anim na data modules, bawat isa ay may sariling database. Ang architecture na ito ay nagbibigay sa iyo ng mga organizational benefits ng microservices (malinaw na boundaries, independent data stores) na may operational simplicity ng isang single deployment.

Modules

ModulePurpose
MembershipMga tao, grupo, sambahayan, permissions
AttendanceMga serbisyo, sesyon, check-in records
ContentMga pahina, sections, elements, streaming
GivingMga donasyon, pondo, payment processing
MessagingMga pag-usap, notipikasyon, email
DoingMga gawain, plano, 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 sa pamamagitan ng CustomAuthProvider
  • Deployment: AWS Lambda via Serverless Framework v3

Ports

ProtocolPortDescription
HTTP8084Main REST API
WebSocket8087Real-time socket connections

Lambda Functions

Kapag deployed sa AWS, ang API ay tumatakbo bilang anim na Lambda functions:

  • web -- Humawak ng lahat ng HTTP requests
  • socket -- Namamahala sa WebSocket connections
  • timer15Min -- Tumatakbo bawat 30 minuto para sa email notifications (ang pangalan ay historical)
  • timerMidnight -- Tumatakbo araw-araw para sa digest emails at maintenance tasks
  • timerScheduledTasks -- Tumatakbo araw-araw para sa due automations at overdue workflow processing
  • timerWebhooks -- Tumatakbo bawat minuto upang maghatid ng queued outbound webhooks

Shared Libraries

Ang API ay nakadepende sa dalawang shared ChurchApps packages:

Impormasyon

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

Sa Seksyong Ito

  • Local Setup -- I-clone, i-configure, at patakbuhin ang API nang lokal
  • 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 -- Push event notifications sa external systems
  • MCP Server -- Model Context Protocol endpoint na nagha-expose ng API sa AI assistants
  • Endpoint Reference -- Complete REST API documentation para sa lahat ng modules