Skip to content

usil/fields-multiverse

Repository files navigation

Fields Multiverse

A simple platform to register all your fields and its equivalences across all your systems multiverse .

Use case

Let's say we have 3 big and important systems (inside or outside) our company, each one has its own way and style of fields, attributes, codes, etc and we need to integrate them

Example: Paypal, Payoneer and Google Pay

These systems have their own way to save their customer gender information.

Example:

System Field Values
Paypal sex M - male
F - female
Payoneer gender_identity 0 - male
1 - female
Google Pay gender_class MA - male
FE - female

What would happen if you tried to integrate these three systems?

If you don't know how each system stores your customer information, you'd have problems. But that's why fields-multiverse was created ❤️

Requirements

Environment variables (Settings)

name description value(Sample)
NODE_ENV Type of environment where the application is running
FIELDS_MULTIVERSE_HOST The application host 0.0.0.0
FIELDS_MULTIVERSE_PORT The application port 1337
FIELDS_MULTIVERSE_JWT_SECRET Secret used to encode JWT tokens changeme ⚠️
FIELDS_MULTIVERSE_API_TOKEN_SALT Salt used to generate API tokens changeme ⚠️
FIELDS_MULTIVERSE_APP_KEYS Identifier of server changeme1,changeme2
FIELDS_MULTIVERSE_DATABASE_CLIENT Type of database mysql
FIELDS_MULTIVERSE_DATABASE_HOST Database host 0.0.0.0
FIELDS_MULTIVERSE_DATABASE_PORT Database port 3306
FIELDS_MULTIVERSE_DATABASE_NAME Database name fields_multiverse_db
FIELDS_MULTIVERSE_DATABASE_USERNAME Database username root
FIELDS_MULTIVERSE_DATABASE_PASSWORD Database password changeme ⚠️
FIELDS_MULTIVERSE_DATABASE_SSL For SSL database connection false

Local demo with docker

export $(cat .env | xargs)
docker compose up -d --build

For production environments, use some mysql service like AWS RDS. Don't use mysql with docker.

In your favourite browser, go to http:localhost:1337 . You will be prompted with the admin user creation. Choose some password and that's all

Create fields

Follow this to create gender fields (sample): https://github.com/usil/fields-multiverse/wiki/Hello-world-sample-:-Gender-field

Create token

All the endpoints require a token in form of Authorization header

header key header value description
Authorization Bearer AKfycbyF7II security token with 3600 ml of duration

To create a token, follow these steps

  • Enter strapi system
  • Click Settings module
  • Click on Global Settings - API Tokens
  • Click on Create new API Token.
  • After following these steps, the system will show you a token which you must save and send as Authorization header in your endpoints.

For more detailed explanation check:

Http Endpoints

name endpoint description
Get the equivalences of one field /api/equivalences-v1?filters[base_field_name][$eq]=gender&filters[base_field_value][$eq]=male More details here
Get all the equivalences between 2 systems. /api/equivalence-v1-complex/query1?source_system=system_2&target_system=system_1 More details here

For advanced queries, check

Customization

This repository only supports 10 systems. If you want to add more systems you will need to start it in developer mode, add your new fields, rebuild, etc and save the changes in your git repository

To start the development mode easily, you could use docker. Only add this volume to the fields-multiverse-core service

volumes:
    - ./:/opt/app  

and set the NODE_ENV variable to production

Roadmap

  • Equivalences v2: New design to grow with rows instead of growing at the column level

Contributors


JRichardsz

Diego Ramos

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published