MCPcopy Index your code
hub / github.com/ReliefApplications/ems-backend

github.com/ReliefApplications/ems-backend @v2.17.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.17.0 ↗ · + Follow
755 symbols 3,814 edges 490 files 123 documented · 16%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

OORT Back-end

GitHub version CodeQL

Introduction

This back-end uses Node.js and runs an Express server. The app data is stored in a MongoDB database. It exposes a GraphQL API.

It was made for a Proof of Concept of a UI Builder for WHO.

To read more about the project, and how to setup the back-end, please refer to the documentation of the project.

Utilities

Docker-compose executes nodemon command, which provides an inspector tool.

9229 port is allocated to back-end inspection. You can use inspector with browser tools.

For Chrome, go to chrome://inspect) and click on inspect below the remote target.

Testing

In order to execute tests locally, you can execute the command:

docker-compose -f docker-compose.test.yml run test-server npm run test

Or this command:

npm run test

It is also possible to run tests on a single file, by passing it as a parameter:

docker-compose -f docker-compose.test.yml run test-server npm run test -- <path_to_file>

Or with this command:

npm run test -- <path_to_file>

You can also limit the tests to one specific folder. For example:

npm run test -- --testPathPattern=models

Note: If you're running the tests on Windows, make sure the test command in your package.json file is set up correctly. Here's the command that should be in the scripts section of your package.json file:

"test": "node --max-old-space-size=8192 ./node_modules/jest/bin/jest.js --logHeapUsage --forceExit"

Will only run tests in the models folder.

RabbitMQ

If management platform is not reachable at 15672, you can use this command ( while containers are running ):

docker-compose exec rabbitmq rabbitmq-plugins enable rabbitmq_management

Extension points exported contracts — how you extend this code

Request (Interface)
Express request interface definition
src/index.ts
ExportBatchParams (Interface)
* Export batch parameters interface
src/utils/files/resourceExporter.ts
SimpleOperator (Interface)
* Interface for a simple operator * If type is 'value', the operator is a constant, stored in the value field * If typ
src/const/calculatedFields.ts
Store (Interface)
Migration store interface
src/migrations/stateStore.ts
UserWithAbility (Interface)
User interface with specified AppAbility
src/server/apollo/context.ts
Filter (Interface)
Dashboard filter interface declaration
src/models/dashboard.model.ts
RecordWithError (Interface)
Interface for records with an error
src/schema/mutation/editRecords.mutation.ts
Template (Interface)
Template interface
migrations/1669104825942-generate-templates.ts

Core symbols most depended-on inside this repo

graphQLAuthCheck
called by 148
src/schema/shared/auth-check.util.ts
save
called by 102
src/migrations/stateStore.ts
extendAbilityForRecords
called by 32
src/security/extendAbilityForRecords.ts
startDatabaseForMigration
called by 28
src/migrations/database.helper.ts
create
called by 26
src/routes/activity/activity.service.ts
decodeCursor
called by 22
src/schema/types/pagination.type.ts
encodeCursor
called by 21
src/schema/types/pagination.type.ts
extendAbilityForContent
called by 20
src/security/extendAbilityForContent.ts

Shape

Function 536
Method 96
Interface 86
Class 27
Enum 10

Languages

TypeScript100%

Modules by API surface

src/utils/history/recordHistory.ts21 symbols
src/services/calculatedField.service.ts18 symbols
src/routes/activity/activity.service.ts16 symbols
src/server/apollo/dataSources.ts13 symbols
src/services/form.service.ts11 symbols
src/server/pullJobScheduler.ts11 symbols
src/routes/activity/activity.controller.ts11 symbols
src/models/referenceData.model.ts10 symbols
src/models/layer.model.ts10 symbols
src/schema/mutation/editResource.mutation.ts9 symbols
src/utils/user/userManagement.ts8 symbols
src/security/extendAbilityForRecords.ts8 symbols

Datastores touched

FormCollection · 1 repos
MigrationCollection · 1 repos
ReferenceDataCollection · 1 repos
(mongodb)Database · 1 repos

For agents

$ claude mcp add ems-backend \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact