Oracle3
Oracle3: 예측시장 거래 엔진·MCP 서버
121 Platform은 현금·바우처 지원 절차를 간소화해 재난 피해자가 쉽고 안전하게 필요를 충족하도록 돕는 사용자 친화 도구
The 121 Platform is a user-friendly tool designed to streamline the Cash & Voucher Assistance (CVA) process, making it easy, safe, and fast for disaster-affected individuals to meet their own needs. I
금융TypeScript · HTMLGitHub @global-121온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
121 is an open source platform for Cash based Aid built for the Humanitarian sector by the Netherlands Red Cross.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
121 is an open source platform for Cash based Aid built for the Humanitarian sector by the Netherlands Red Cross. -- Learn more about the platform:
Static analysis, formatting, code-style, functionality, integration, etc:
The documentation of the 121 platform can be found on the Wiki of this repository on GitHub:
Note: These instructions target macOS and Linux. Windows is not officially supported, but may work with minor adjustments.
• Install Git:
• Install Node.js:
• Install the version specified in the .node-version-file.README 전문 보기 ↗121 is an open source platform for Cash based Aid built for the Humanitarian sector by the Netherlands Red Cross. -- Learn more about the platform: https://www.121.global/
See: status.121.global
Static analysis, formatting, code-style, functionality, integration, etc:
See also: Testing
The documentation of the 121 platform can be found on the Wiki of this repository on GitHub: https://github.com/global-121/121-platform/wiki
Note: These instructions target macOS and Linux. Windows is not officially supported, but may work with minor adjustments.
Install Git: https://git-scm.com/download/
Install Node.js: https://nodejs.org/en/download/
Install the version specified in the .node-version-file.
To prevent conflicts between projects or components using other versions of Node.js it is recommended to use a 'version manager'.
FNM (for macOS/Linux)
NVM - Node Version Manager (for macOS/Linux).
Install Docker
With these tools in place you can checkout the code and start setting up:
git clone https://github.com/global-121/121-platform.git
Navigate to the root folder of this repository:
cd 121-platform
Then install the required version of Node.js and npm:
If you use FNM: fnm use (And follow the prompts)
If you use NVM: nvm install
Now, make sure to run the following in the root folder to install the necessary pre-hooks:
npm install
Optionally, an additional post-checkout-hook can be enabled by running:
cp .husky/.local.post-checkout.example .husky/.local.post-checkout
This will ensure all local (development-)dependencies will be installed every time you switch branches.
You can remove the .local.*-script file again to disable this behavior.
Copy the centralized .env-file
cp -i services/.env.example services/.env
Each environment-variable is explained in the .env.example-file. See the comments above each variable.
The initially set values are the defaults that should enable you to do local development and run all (automated) tests.
To start all services, after setup, from the root of this repository, run:
npm run start:services
This will run Docker Compose in "attached" mode. The logs for all containers will be output to stdout.
To stop all services press ⌃ Control + C.
To see the status/logs of all/a specific Docker-container(s), run: (Where <container-name> is optional; See container-names in docker-compose.yml).
npm run logs:services <container-name>
To verify the successful installation and setup of services, access their Swagger UI:
Install dependencies for the portal, run:
npm run install:portal
Also, make sure to set the environment-variables. Run:
cp -i interfaces/portal/.env.example interfaces/portal/.env
To start the portal, from the root of this repository, run:
npm run start:portal
Or explore the specific options as defined in the package.json or README.md.
When started, the portal will be available via: http://localhost:8888
When you use VS Code, you can start multiple editor-windows at once, from the root of this repository, run:
npm run code:all
To start an individual interface/service in VS Code:
Run: (where <package> is one of portal, 121-service, mock-service)
npm run code:<package>
See for guidelines on how we work with environment-variables, at the top of: .env.example.
All (sensitive) tokens, access keys for third party APIs, infrastructure-specific hostnames and similar values should be injected in the application(s) via environment-variables.
⚠️ Make sure never to commit any such sensitive values! Always use the (ignored) local .env-file.
When making changes to the data-model of the 121-service (creating/editing any \*.entity.ts files), you need to create a migration script to take these changes into affect.
The process is:
Make the changes in the \*.entity.ts file
To generate a migration-script run: docker exec 121-service npm run migration:generate src/migration/<descriptive-name-for-migration-script>. This will compare the data-model according to your code with the data-model according to your database, and generate any CREATE, ALTER, etc SQL-statements that are needed to make the database align with code again.
Restart the 121-service through docker restart 121-service: this will always run any new migration-scripts (and thus update the data-model in the database), so in this case the just generated migration-script.
If more changes required, then follow the above process as often as needed.
Do NOT import any files from our code base into your migrations. For example, do NOT import seed JSON files to get data to insert into the database, since the migration may break if ever these seed JSON files change. Instead, "hard code" the needed data in your migration file.
Do NOT change migration files anymore after they have been merged to main, like commenting out parts of it, since there is a high probability this will result in bugs or faulty data on production instances. Instead, create a new migration file. The exception is bug fixing a migration file, for example if a file was imported that causes the migration to fail (see 5 above).
To run this file locally, do: docker exec -it 121-service npm run migration:run
If you want to revert one migration you can run: docker exec -it 121-service npm run migration:revert
If ever running into issues with migrations locally, the reset process is:
121-service database schema121-service containerInitialMigration-script, which creates all tablesWhen creating new sequences for tables with existing data be sure to also update it using setval (example) to the current max id.
See also TypeORM migration documentation for more info
NOTE: if you're making many data-model changes at once, or are doing a lot of trial and error, there is an alternative option:
services/121-service/src/ormconfig.ts set synchronize to true and restart 121-service.\*.entity.ts files are automatically updated in your database tables, which allows for quicker development/testing.synchronize back to false and restart 121-serviceTo test the migrations you are creating you can use this .sh script (unix only) ./services/121-service/src/migration/test-migration.sh example usage ./services/121-service/src/migration/test-migration.sh main feat.new-awesome-entity
This script performs the following steps:
All services use JSON Web Token (JWT) to handle authentication. The token should be passed with each request by the browser via an access_token cookie. The JWT authentication middleware handles the validation and authentication of the token.
To make development of all components of the 121-Platform easier, we recommend using VSCode with some specific extensions.
They are listed in .vscode/extensions.json-files, in each component's sub-folder, next to the root of the repository.
Main/root-folder
Generic extensions for code-style, linting, formatting, etc. Also GitHub Actions-workflow and Azure related ones.
Portal
Additional extensions for working with Angular, Tailwind, etc.
121-Service / Mock-Service
Additional extensions for working with Node.js, Jest Unit-tests, etc.
When you open a folder in VSCode and go to: "Extensions" and use the filter: "Recommended"(@recommended);
A list should be shown and each extension can be installed individually.
In VSCode, you can add a new recommended extension by selecting "Add to Workspace Recommendations" from the context-menu in the Extensions sidebar.
Make sure to add an extension to all (other) relevant extensions.json-files, so that it is available in all components of the 121-platform. Angular/CSS-specific extensions don't need to be shared, but TypeScript/Formatting/Developer-convenience-related ones do.
Workspace MCP servers are configured in .vscode/mcp.json for tools such as GitHub Copilot:
ado): Connects to the Red Cross Azure DevOps-organization. Authenticates using your local Azure credentials (e.g. az login)—no tokens or credentials are stored in the configuration.figma): Connects to the Figma remote MCP server. Authenticates via OAuth in your browser upon first use.Note on permissions: Both Azure DevOps and the Figma design project are internal Red Cross resources and are not publicly accessible. You will only be able to use these MCP servers if your account has been granted the appropriate permissions within the Netherlands Red Cross organization.
If the Swagger-UI is not accessible after installing Docker and setting up the services, you can take the following steps to debug:
docker compose ps to list running containers and their statusdocker compose logs -f <container-name> to check their logs/console output (or leave out the <container-name> to get ALL output)If the errors are related to not being able to access/connect to the database then reset/recreate the database by:
dropSchema: true in src/ormconfig.ts of the specific service.When considering upgrading the (LTS) version of the Node.js runtime, take into account:
When new Node.js dependencies are added to a service since it is last build on you local machine, you can:
Verify if everything is installed properly:
docker compose exec <container-name> npm ls
If that produces errors or reports missing dependencies, try to build the service from a clean slate with:
npm run install:services -- --no-cache <container-name>
Or similarly:
npm run start:services -- --force-recreate <container-name>
Azure Test Plan.npm test in each interfaces/*-folder.npm test in each services/*-folder.e2e/README.md/E2E testing suite.wiki/Creating and maintaining E2E tests.PATCH /registration etc.referenceIds) -> export included registrationsThese tests are still expensive (to bootstrap app + database)
There are a few reasons why we write unit tests cases:
How are Unit Tests affected when we make changes within the code in future?
We are using jasmine for executing unit tests within interfaces and jest within services. However, while writing the unit test cases, the writing style and testing paradigm do not differ since jest is based on jasmine.
See the Guide: Writing tests
Test coverage is collected and reported to the QLTY dashboard. This information is then used to determine whether a PR is decreasing test coverage or not.
Refer to the README file of the 121-service or the portal interface for more detailed information on how each coverage report is generated.
See notable changes and the currently released version on the Releases page.
This project uses the CalVer-format: YY.MM-MICRO.
This is how we create and publish a new release of the 121-platform. (See the glossary for definitions of some terms.)
main-branch what we want? Or a specific commit/point-in-the-past?)vX.X-X with the latest release in this URL: https://github.com/global-121/121-platform/compare/vX.X-X...mainversion-name for the upcoming release.version to create a new tag<version>.Only in rare, very specific circumstances it might be required to do a "hotfix-release". For example when:
mainmainThis follows a similar process to regular release + deployment, with some small changes.
<version> tag which contains the code that you want to hotfix.HEAD (e.g. hotfix/<vX.X-X>, with an increased final MICRO-number) and make the changes.hotfix/v*-branch as target, and publish it.main-branch.Note: 💡 Do not rebase/update the hotfix/v*-branch onto the main-branch until AFTER you have successfully deployed the hotfix to production.
The hotfix branch is created from a "dangling" commit, this makes the GitHub UI confused when you look at a PR between the newly created hotfix-branch and the main-branch. Any conflict warnings shown on GitHub are not relevant for the hotfix-deployment, they'll only need to be addressed to merge the hotfix into the main-branch afterwards.
The 121-Platform should be deployed to:
This infrastructure is defined to be run using Docker (in use for local development only). But no guarantees are made that the platform can be deployed as-is to any Docker-capable hosting service.
🏗️ 510-only:
See details on how to deploy new code in theinfrastructure-repository.
| Term | Definition (we use) |
|---|---|
version | A name specified in the CalVer-format: YY.MM-MICRO |
tag | A specific commit or point-in-time on the git-timeline; named after a version, i.e. v22.1.0 |
release | A fixed 'state of the code-base', published on GitHub |
deployment | An action performed to get (released) code running on an environment |
environment | A machine that can run code (with specified settings); i.e. a service, or your local machine |
Parts of the code in this repository were written and reviewed with the assistance of AI tools, including large language models (LLMs).
All AI-generated code has been reviewed by human contributors before being merged. The humans involved take responsibility for the correctness and quality of the code.
If you have questions or concerns, please contact the maintainers.
Released under the Apache 2.0 License. See LICENSE.